#help-development
1 messages ยท Page 363 of 1
Yeah if you are new to SQL its a fkg mess working with it
I would say mongo is quite easy for beginners. At a small scale you can get away with knowing zero of its query syntax and sure, ur small enough to probably just not know indexes exist right now and your performance will massively suffer but that's an issue for later you.
Oh i tuned off at the wrong moment. Discussion time? 
is it not possible that anyone would just show a tiny example of how "mongo"db works?
Yes one moment ๐
Yeah discussion momment
I really don't have any good java code for it any more. Do you just mean how you interact with it?
MongoDB drivers have great docs
They're simple and easy to use, apart from some small hassles (e.g no automatic UUID type in golang)
can somebody show me a screenshot of how a random "mongo"db table looks like?
Lets make a concrete example. Like a toplist query or storing user data of players.
So i can show some code.
mognodb doesn't have tables
its not sql
how is that different from sql? there's a table called "player". is has the fields "_id", "currentUsername", etc etc. and then there's a few entries, and they all have values for each of those fields
How are you saving uuids as UUID, in my case they are saved a BinData
All data is stored in their version of JSON called BSON which adds extra types
to me, it looks like the same as sql, except that the whole system uses a racial slur as name
yeah it seems like MySQL with JSON. Basically just sql with extra steps
You don't define a schema. You add any key/value as and when you want. An _id doesn't always have to be of the same type, it can be a UUID somewhere and a ObjectId if you want somewhere else
Your choice what you want
so it's basically just a mysql table with "id" and "json_data" fields.
Mongo is great when you have not much relations in database and your system is build to be mostly readonly. So there you can pretty simple to just push Json payload data without mapping it to tables types
When you create the mongo client you can set the UUID strategy or something
now I can finally understand why it's called "mongo"db lol
Haven't used the java client in around a year now so I'm not 100%, but it's something like that
instead of having a fixed scheme like "id, name, uuid, etc etc" it just has "id, <blob of data>"
yeah that would also totally be doable with normal sql
Here is how a toplist search would look like
private final MongoCollection<PlayerData> collection;
public List<PlayerData> getTopKills(int amount) {
List<PlayerData> values = new ArrayList<>();
Bson sort = Sorts.descending("Kills");
collection.find().sort(sort).limit(amount).into(values);
return values;
}
You can literally use objects because with a half decent Codec you can serialize anything to json/bson
And you would use skip to do pageability
How do you use serialize directly objects? I tried it yesterday with no sucess
everything you people sent just confirms my assumption that "mongo"db wasn't called "mongo" for no reason, it's just a normal relational databse, but instead that it maps "a" to "b" and "c" and "d", it just maps "a" to "some random blob of data" and hence the owner called it "mongo", which, as I already said, is racial slur against disabled people in at least 20+ languages, including the language of the dude who invented it
hee?
I'm convinced you're just both insane and have some kind of personal vendetta against Mongo.
No mongo doesnt mean that
Mongo is a simple HashMap talking about java terms
Redis is a key<>value
Yeah works similar as Redis, but redis doesnt use Bson
but it at least has stuff like a pup/sub system
Each document is a hashmap, mongo itself is not a hashmap.
what is a "document"?
Who even cares about the name of a piece of software... The name of this couldnt be less relevant.
Also MongoDB has no notion of keys.
Mongo is a document database. It stores data in documents.
A sql field
a "document" is basically "whatever" right?
yeah document is your data mainly
No
table
Please Verano
A document is not a field...
right my bad
idk, I would not call my library "FuckJewsTheyAllShouldDie"
Sorry smile, Im just over thinking how to fix my issue with mongo whilre working with int
I'd understand it if the inventor of MongoDB would NOT be german. But he is
anyway, discussion ended for me today. All you people explained to me is that "MongoDB" is just a poor man's version of SQL. It seems to just be "key<>whatever". And nobody seems to care that the dude who invented it used a racial slur for his system despite knowing that it's a racial slur in his ow nlanguage
Mongo is only a slur if you use it like one. We are responsible for what is being perceived as offensive.
And we should not be offended by every little word like "mongo". Nobody uses this word as a slur anymore.
Only people with room temperature iq.
what you people call "document" is what is called "blob" in mysql
I'm looking in spigot's forums and the google in general for the best way to make a "dummy" NPC that is just an entity with a player skin (if too complicated, I'll go with a Villager)
That just teleport someone who right clicked it on a specific location.
I'm not asking on how to make an Interact listener but on how to make this entity ?
Can someone help me with that ?
Thats an oversimplification but sure. Call it a blob.
well, what else is it?
Smile are you currently free? Because with collermar and mfalex, we couldnt fix the issue while wortking with int in mongp
You are not properly evaluating your received messages. You literally took
Verano at face value my guy.
So i would love to you take a look and try to help
not sure what you mean with "You are not properly evaluating your received message". Maybe my english skills aren't good enough to fully comprehend this
mind explaining it in a bit simpler english for me please?
I mean that a bunch of kids blurted out words like keys and blobs and you didnt look
at how credible the source is. If we focus on technical details then i can explain where mongodb
has its strenghts and weaknesses compared to relational databases.
I m looking in spigot s forums and the
Yeah because you cant say that a db is bad or not, without an specific contaxt
That is what we learn the the first month at our database subject
that would be nice if you could explain that to me
I am always open to learning new things
I still dislike the idea of a german dude calling sth "mongoDB"
that's like me inventing sth and calling it "n**gadb" but anyway
I'd love to learn about the advantages of mongo, so if you could explain to me, that'd be nice
If it was good then i would literally not care...
And if it was "WhiteCrackerTrashDB" i would also not care
Anyways
"CancerDB" sounds cool
acutally no wait
firebase seems odd because people die in fires
cancel them
so what's sth that mongodb does better than mysql?
to me it looks like mongodb is just a weird redis
No database is better than other, they depend the enviroment you ar eusing
can someone connect to my server (1.19.2) to tell me what they see (on their side) dm me if you can
Off the top of my head:
Because Mongo is a document database, it scales significantly easier than an SQL database. Mongo can shard and scale out of the box if you want.
Having no schema can both be a positive and negative for many reasons.
so mongo is just "persistent redis"?
redis can be persistent as well ๐
well that's the main out of the box change
redis being persistent is a bit weird
it's like making snapshots n all
dont u have to pay for that vrsion?
if so ,where's the difference to a mysql table that just stores a table like "id"=int and "data"=blob?
Mongo and redis both shard out really easily
sql is a lot more complex when sharding
Mongo is a big Map<String, whatever>
Yh I remember in the end google made ProxySQL or something like that to make it scale
MongoDB stores its data as Bson, which is similar to Json but has some benefits regarding
the DB architecture. It allows to query objects by their properties without having
to directly iterate every document on every query.
Genuine question, can you index the contents of the data in that blob? So you have json in that data, say there's a username field in that json. Can you index the username in that blob or would you have to have username as a column in the table?
In my books the ease of use of mongodb is a big plus.
Designing robust and scalable relational data models is very labour
intensive and error prone.
if it's a blob, only when parsing every entry ofc. so, in general, no
Well then that's a big reason why that's different.
MongoDB has a closer depiction of the actual objects you would use in your runtime environment.
You can index whatever field in mongo you want.
okay, that's finally an explanation I can understand, thanks
This means that serialisation of Objects for MongoDB is very powerful because
you can take the same approaches as you would for Json.
So in this:
_id is a forced index that is unique. Your _id field must be a unique index and every document must have an _id field
currentUsername is indexed, but uniqueness is not enforced.
currentlyOnline is indexed, uniqueness also not enforced
it still seems to me like it's not very different from a mysql table that just maps <someKey> to <someJsonData>
Well you cant search through the <someJsonData> in a SQL database
ofc you can?
In mongodb you can efficiently query for every property and even index every property you want
oh wait
I understand it now
Okay, yes, I do undertsand it now
thanks for clarifying
Well the big difference there is there is no schema. There are no rows and columns, there is no table.
Any document can have any fields and values it wants, the only restriction is it must have a unique _id field. The same is not true for SQL, the columns have predefined names and types.
I am still upset about why they called it "mongo"db, that's like calling it "retarded"db
but yeah, so be it. at least now I understand how it works
public class PlayerCloseMenu implements Listener {
Plugin plugin;
@EventHandler
public boolean onPlayerCloseMenuEvent(InventoryCloseEvent event) {
if(event.getInventory()!=new WelcomeInventory(plugin).getInventory()){
event.getPlayer().sendMessage("Wrong inventory");
return false;
}
Inventory delayInventory = new DelayInventory(plugin).getInventory();
Player player = (Player) event.getPlayer();
int id = Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(plugin, new Runnable() {
@Override
public void run() {
player.openInventory(delayInventory);
}
}, 0, 10);
Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() {
@Override
public void run() {
player.openInventory(delayInventory);
Bukkit.getServer().getScheduler().cancelTask(id);
}
}, new GetPluginInfo(plugin).getDelayTime());
return true;
}
}
I'm trying to open new inventory after closing the old one, im detecting it via InventoryCloseEvent and then rapidly opening new one until scheduleSyncDelayedTask cancels task, it looks like event is not even working, because even on fail compare it do not send any message. does anyone know otherway of making it work? (dont mind awfull way of getting data, working on it)
event.getInventory()!=new WelcomeInventory(plugin).getInventory() This will always be true
^
Oh and ofc, like JSON, you can have complex document structures still. Those can be indexed as well, e.g here I can index permissions.node still.
so how can i be shure that the closed inventory is the one i want
Why would you do that?
thanks, I have understood it now, I should probably just have googled sth about "mongo"db but I was reluctant to do so because I am still upset about that name so I never did google anything about
Use data structures like Sets or Maps and put your inventories in there.
it is just one inventory so that doesnt make sense
If its just one then only create it once and not every time the event fires.
it does make sense, because currently you create a new inventory everytime someone opens an inventory
that is not ONE inventory. that's like 1-2 new inventories per event
Unless getInventory returns a static instance of an inventory (Which i strongly hope is not the case)
made it static now
they do "new", it cannot be the same instance

Right, but getInventory() could return a static instance
hmmm yeah in theory, you are right
thats what i've meant
Yeah... Please dont
btw if an instance method ever always returns a static "thing", your design is flawed in the first place
Someone recently bashed me on this discord because i proposed a design change to a functional problem
too little info to bash you, nor the person who said otherwise
Always like the "Ill make it work and refactor later" mentality. Never happens.
Very kind of you
i dont understand rn. In one class i have defined delayinventory that i want to be opened when player is closing welcomeinventory, the delayinventory should be opening all the time until the specified delay ends.
"refactor later" is however still better than "refactor never" ๐
but yeah you are right
Its basically the same thing in most cases XD
exactly haha
just 12 hours ago, I copied the whole "autoCondenseToggle" method to "autoSmeltToggle" in my D2I plugin. I should have just made it generic, using a "autoToggle<WhatEverIsToggleable>" method, but I cba
Anyways i wanted to be productive for at least 2h today and all i did was fight with gradle and argue on discord.
So im out for today ๐

i know that feel... I still gotta make someone get out of custody for tax fraud regarding the amount of sheep they keep on 27 hectars, but.... guess what
good night lol
(btw 27 hectars is not very much)
I have now just read a bit of things about mongodb, and I learnt many new things, and I can confirm that I was wrong ealier, when I said "mongodb is just a sql table with key<>blob" stuff. However I still stand my ground that "mongodb" is a weird name lol
it comes from humongous with db tagged on the end
yeah I know, I've read that too
however you also gotta take into account that the dude who invented it was german, and that in geman, the word "mongo" is a bit like the word "re..:82..retarded"
but yeah, that probably wasn't his intention
still, it's always weird when I read this word
it's a bit like if you're english and you'd read "retardedDB"
but yeah, I hereby take back everything I said against MongoDB, everything I said against it was because of my own lack of knowledge, and the only thing I now have against it is the poor choice of naming. Other than that, mongodb seems to be a nice thing.
hes not online
lol
how can i force open the "Enter Title Book" menu to a player and get what the player type in it?>
yo gamers, is there a way to get around this? FileConfiguration returns a List<?>, any way to get around this warning?
make it List<..> instead of List<List<..>>
But it is a list of lists
like this?
a:
- not a
- not b also
```??
key: [
["D", "diamond"],
["E", "ender_eye"],
["C", "ender_chest"]
]
like so, array of arrays
thats json?
it is json, that line is parsing the json in the config
it works fine, its just annoying having that warning lol
idk if you can put data like this in yml file tbh
valid json is valid yaml
oh sorry, yeah its yaml not json lol
oh so i can set json array?
but yeah the parsing works fine, its just annoying getting that warning
you can just suppress that warning, its throwing it because ide can't know if your config contains list inside of list
yep @Sup..("deprecation")
i'm lazy to spell the word :/
gotcha, so just ignore it in the ide, no way to tell java itself to ignore it huh
yes, as yaml is superset of json
well, its ide, not java
ah yeah, fair point
new information received*
so uhm any one have exp with this?
When you guys write update checkers, do you typically just check for updates once when the server starts or do you run a repeat task to check say every 24 hours?
at startup only
Yeah you only ever really need to do it on startup
It's not very likely someone's going to see an update popup in console or in chat mid-runtime and be like "OKAY! Time to shutdown and update!"
My only worry is that some people (myself included) may only restart their server once every like 2 weeks lol
But yeah, you definitely right about that
Meh, if they only restart it every two weeks, this message still applies ^
They'll be the type of people to keep their servers running as long as possible anyways lol
Lolol yeah, your right. I'm just going overboard with my first plugin I think ๐
Will keep the update check on startup only
i set my update checkers to run on startup and normally every 2 hours
is best way to send server-icon over rest to convert it to base64 ?
Java itself doesnโt give a fuck, if it doesnโt exist itโll error. Iirc you can get rid of the warning by wrapping it with requireNonNulls or something from Objects class, but the warning doesnโt matter much
Yeah haha after I thought about it more I was like oh yeah thats just the IDE
I just wanna make the file not yellow in vscode anymore ๐
my ocddddd lol
so you like annoying the fuck out of people, gotcha 
The only plugin that needs to have an update check every other hour is EcoEnchants which seems to update at that frequency
if you didn't figure out, you can suppress it with @SuppressWarning(โuncheckedโ)
not sure if its intellij specific tho
i havent released any yet
the one i have doesn thave update checker
Ayee that did fix it ๐ no more yellow file name in vscode haha
sweet relief
I'm going to release a plugin that checks for updates FOR the update checker but requires an update checker lib that checks for updates every 30 seconds
perfect
๐
make sure to send the update message atleast 300 times if one is found
and every 5 minutes in game
to all players
Hahhaha, the ultimate troll plugin
with a title
๐ค Players please bug your server administrators to bug the developer of EbicPluginX to update the update checker inside of their plugin.
yeah
add a command that allows players to live reload to update it
YES
just forcefully install PlugMan
plug women
Man these plugin description pages are insane. People have like all these fancy custom banner images with decorations, and im just out here with plaintext and bold/italics formatting lol.
ask midjourney to design your plug-in page graphics
I actually just picked up a 4090, I could stable diffusion it up haha. Although its not so good with text
stop flexing
chatgpt + stable diffusion time
Lolol and I use it to play minecraft and factorio, definitely not money wasted
It is nice being able to generate ai waifus in 10 seconds tho ๐
are you a discord mod on any serve
Does my own server count lolol
how can i open this menu to a player and get the text when sign?
I figure once kerbal 2 and the forest come out in 9 and 10 days I might get a little bit more use out of it lol
Like to open a book without actually having a book in your hand?
i did that, but i need to open the menu that request the title i'm trying to make a nick system
all the nicksystem in book gui and its awful if the nickname inserted in anvil
Ohhh so you only want the screen to pop up for signing the book
not the book itself
isn't book signing clientsided
packets will not help too with this?
I always thought you could only make a player open a written book
i did book gui, but i want to get text from a player
is there's another way? like open a book and quill and receive the text?
I'm not sure, but perhaps this will send you in the right direction
https://wiki.vg/Protocol#Edit_Book
this site is outdated a bit but good starting point
I don't think it is, the Open_Screen is outdated, I had to decompile and its quite different than whats listed there
Oh snap can I do that? I will if I can =]
I learned a lot having to do the decomp myself though haha
@trail lintel the same ๐ฆ
and yeah you can only make written books be opened
I should think so, if you make an account? Haven't tried tho.
then the only way to open an anvil and get the name from item?
there's also sign guis
oh i forgot the sign is exists xd
If you are trying to do nicknames though why do it through the book gui? Why not just a command?
i need to make smth cool like hypixel i did all the steps but the custom nickname is annoying
I see, hypixel does it through a book gui? It must be possible then ๐ keep crackin at it
persistence is key haha I had to dig for ages to get the info I needed
true but hurts a bit
wait, is Bukkit.getWorldContainer() just returning root directory
as all worlds are there
?
yes
yep
let's hope we get a worlds folder one day
you can just make a path .
as the spigot instance path
anyone have a good signgui api?
I believe writable books were made completely clientside at some point
last two replies there
what is this black magic o.o
displayGuiScreen?!?
ohh its not part of the spigot api ok
What could cause this?
the player that placed the block (that initializes the hologram) sees it right, but other players see an armor stand
is it a real armor stand or packet created
It's this:
ArmorStand hologram = (ArmorStand) gen.getLocation().getWorld().spawnEntity(gen.getLocation().clone().add(0.5, -0.75, 0.5), EntityType.ARMOR_STAND);
Which is an actual armor stand I suppose
i have getCommand("enchant").setExecutor(new Enchant()); but the command doesnt execute at all
add it to plugin.yml
it is
can I see it?
commands:
enchant:
default: true
permission: enchant.command.enchant
description: allows the user to open the enchant menu
permission-message: You do not have permission to use this command.
usage: "Usage: /<command>"
but in all of my other plugins it doesnt matter
i have this command and it works
menu:
default: true
permission: kot.command.menu
description: allows the user to opne the cosmetics menu
aliases: kotmenu
permission-message: You do not have permission to use this command.
usage: "Usage: /<command>"
@atomic swift your class is defined like this right?
public class Enchant implements CommandExecutor
ye
also naming conventions where
me?
jman
too late i already made the IString and StringImpl
its like 2 buttons?
ye ik
so hard to rename Enchant to EnchantCommand
yeah
this is my full class
package info.sokobot.enchant.commands;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import info.sokobot.enchant.guis.Table;
public class EnchantCommand implements CommandExecutor {
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
if (!(sender instanceof Player)) return false;
Player player = (Player) sender;
System.out.println("1 dollar, one dollar, one dollar foot long");
Table.openGui(player);
return true;
}
}
@Override where
override the method
it said @ Override cant be used
how did it even let you do that without an override o.o
last tiem
bc it treats it as a normal method
why do you have Player player = (Player) sender; tabbed out?
yeah but you implementing an interface
it should bitch that you arent implementing the required methods
idk
bc i didnt put the return in and it did that
if this is 16 or higher you can remove the cast
if (!(sender instanceof Player player)) return false;
then you can use player where you need it
it always errors the plugin out
idk y
is it java16 or higher
no i set it to java 16 or higher and it just dies
are you running java 16 as the server
Asking about your attempted solution rather than your actual problem
Can't use spigot (not api) in build.gradle? I get this error:
Could not find org.spigotmc
1.16.5-R0.1-SNAPSHOT.
why does Main.getInstance().getDataFolder() return the jar
?main
where do you use it
YamlConfiguration cfg = YamlConfiguration.loadConfiguration(
new File(Main.getInstance().getDataFolder(), "panel.yml"));
Damn epic out here bein ebic he knows everything haha

looks correct to me, check for errors
java.lang.IllegalArgumentException: The embedded resource 'panel.yml' cannot be found in plugins/enchant-0.0.1-SNAPSHOT.jar
are you calling JavaPlugin.saveResource
before you ask yes i have saveResource("panel.yml", false);
lol
Yes
make sure its in the jar
time to boot up recaf
somehow the jar cant be found
idk
Can I send my build.gradle?
is main ln 44 the save resource
ye saveResource("panel.yml", false);
have you considered reastarting, not using plugman
too slow
forge and spigot dont mix to start with and have you ran buildtools
why does it die if the resource exists
plugman at a guess
bc panel exists
forge is modding, server side and client. Spigot is plugins server side only lacking a lot of features forge/fabric do
Yes I am using arclight for a server with mods + plugins recommended to me on the pixelmon mods discord
How do I run it as buildtools? I am using Intellij
What
That doesn't make sense, also you will see no support for mod and plugin servers a lot of times they plain suck
If you need essentials use FTBUtils
I'm not asking for server support, I just want to know how I can solve that the build.gradle does not find the spigot (no api) even in a project that does not have forge
Run BuildTools
?bt
Hi im back, im still having integer isssues with mongo db๐ก
Im really stressed i have lost 1d day of hard working caused of this shity issue
This happen when someone die, I used <Player>.spigot().respawn() in a PlayerDeath Listener
https://streamable.com/ybt2mt
It respawn the player, but right after, the death screen appear...
Hmnn the url is marked as terrorist organization related, atleast in my country
๐ฌ
???
why not just use the doImmediateRespawn gamerule?
Didn't knew that this existed
thanks ig ^^'
I believe it skips the death screen
I remember u from somewhere?
I was just seeing that, do I run it in any folder or should it be inside the project?
I'm famous then
any random folder is fine
you can delete the folder after
Okok thank you!!
Does anyone know a plugin that can prevent VPN / Proxies? Even if the plugin costs money its all good!
So the channel should be #help-server
Can someone explain me why my player time counter is negative?
This is a really stupid question but i cant understand why haha
Except them back up directories like onedrive or google drive lol
gson? or what
playtime?
Do you store it as a long?
If not you should
a
hm,
so @sterile token I use gson but I had to set my long serialization policy
GSON stores longs as a string
try that
Let me know if that works
these are all mongo types
Kotlin i dont understand it
I fixed
Thanks man
But now issues with Material#getMaterial() and the material im passing is not null
Im currently confused
Instead of incrementing every tick, it uses the world time during saving. Of you mess with the world time and make it fo in reverse like for example its night and you set it day. The time goes in reverse to be day not forward. So when it saves when doing that for example it will reduce the playtime
No no i mean, played time not related to word mainly how many time the player plays in the server
Playtime is connected to world time.
Or well used to be, may not be the case anymore lol
Hee?
Im just trying to count the total timehe has played inside the network
?paste
alright so paste.md5 doesnt work for this bruh
my question is why'd buildtools fail when i ran it for 1.8.8
1.8.8 ๐
what a lot of servers still runs that and im also interested in the differences
but its an issue if i cant even build the damn server
Hmnn
[WARNING] The requested profile "remapped" could not be activated because it does not exist.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:3.4.1:jar (default-cli) on project bukkit: MavenReportException: Error while generating Javadoc:
[ERROR] Exit code: 1 - D:\Creation\Minecraft\Bukkit\src\main\java\org\bukkit\material\Door.java:194: error: reference not found
[ERROR] * @see Material.WOODEN_DOOR
...
[ERROR] Command line was: cmd.exe /X /C ""C:\Program Files\Java\jdk1.8.0_341\jre\..\bin\javadoc.exe" @options @packages @argfile"
[ERROR]
[ERROR] Refer to the generated Javadoc files in 'D:\Creation\Minecraft\Bukkit\target\apidocs' dir.
[ERROR]
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Exception in thread "main" java.lang.RuntimeException: Error running command, return status !=0: [C:\Windows\system32\cmd.exe, /D, /C, D:\Creation\Minecraft\apache-maven-3.6.0/bin/mvn.cmd, -Dbt.name=582a, -P, remapped, javadoc:jar]
at org.spigotmc.builder.Builder.runProcess0(Builder.java:976)
at org.spigotmc.builder.Builder.runProcess(Builder.java:907)
at org.spigotmc.builder.Builder.runMaven(Builder.java:876)
at org.spigotmc.builder.Builder.main(Builder.java:693)
at org.spigotmc.builder.Bootstrap.main(Bootstrap.java:27)
Send your command please
"C:\Program Files\Java\jdk1.8.0_341\bin\java.exe" -jar Buildtools.Jar --generate-source --generate-docs --remapped --rev 1.8.8
oh you are using remppaed
so?
remapped doesnt exists on 1.8
uh
i excluded remapped
it failed again
its complaining about missing references
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:3.4.1:jar (default-cli) on project bukkit: MavenReportException: Error while generating Javadoc:
[ERROR] Exit code: 1 - D:\Creation\Minecraft\Bukkit\src\main\java\org\bukkit\material\Door.java:194: error: reference not found
[ERROR] * @see Material.WOODEN_DOOR
just use only -rev argument
i kinda sorta want the javadocs lol
is there an archive of previous versions somewhere
thx
even if the only argument is --rev 1.8.8 it fails with this
wtf
@sterile token
what issue?
Did you download latest build tools? And please paste the issue in paste
well idk why it fails just that it does with above message. Also since 1.8 is so old i assumed i wouldnt need buildtools but imma try
yup broke again
is there a way to get a list of ALL generated chunks in a world, no matter whether currently loaded or not?
Not without you iterating over the region files manually
that's no problem
looping through and https://hub.spigotmc.org/javadocs/spigot/org/bukkit/World.html#isChunkGenerated(int,int)
otherwise store them on load or go for the region file
how many chunks does a region file include?
^ that method is your friend
hm I just thought, it's probably easier to just start in the center, then do a "spiral" loop or sth
damn 4096 chunks in one region?
I thought it was less lol
haha ACF is so funny, this will spam the chat so much when someone enters an invalid material name
this plugin is going to be funny
yo everyone I need help with basic 3rd grader's math
imagine these are chunks, 1 is the center chunk. now I need a x,z for loop that iterates over all the surrounding ones
but I cannot come up with anything
I probably need a three-way nested for loop but tbh I have no clue how
it's too early for my brain to work. if someone could tell me how, that'd be nice
i would see the surrounding chunks as a layer which you can magically add to the initial chunk location and bitshift them by 4
int offset = 0;
while(true) {
for(int x = -offset; x<= offset; x++) {
for(int z = -offset; z<= offset; z++) {
Chunk chunk = world.getChunkAt(x, z); // Yeah I know this would load the chunk, just an example
}
}
}
this should probably do what I was asking for I hope?
(except that I forgot to offset++)
no wait
bullshit
this would just brute force in one direction
that would also loop over all the already done chunks again
hmmm
I just need a loop that does it like this:
probably the best way to do this would be to use the diagonals
but I cannot come up with any math
chunk1 << 4*layer if im not dumb
the actual order is not important, I just need to loop over all chunks, from the center unwards, until I hit a "layer" where there is no more generated chunk
wdym
Harder than it looks
damn md_5 do you want to kill me?
hold on for 2 mins pls
The below answers are less mathy more cody
sure, I got time haha
hm unfortunately all these answers relies on a given array where he just needs the indexes for
just get the diagonal for 2 opposite directions and you get the corner chunks
my math classes are 10 years ago, tbh I don't even know what you mean with "the diagonal"
HashSet<Point> checked = new HashSet();
for(int i=1;i++;i<radius){
for(int x=coordx-i;x++;x<coordx+i){
for(int y=coordy-i;y++;y<coordy+i){
Point p = new Point(x,y);
if(checked.contains(p)) continue;
checked.put(p);
//check chunk here
this is a very stupid solution
but it is likely to work
I basically just need to loop over all existing chunks. to do that, I thought I just start at the spawn, then do some spiral loop over the nearby chunks, until I hit a "layer" where no chunk is generated, then I'm done
thanks, I'll quickly try it
but I don't know whether "3" is the end point, I need it to start in the center
that would be just a linear function to get the corner chunks from which you can then loop through
I'll be back in 10 minutes, then try this, thank you
oh I wanted to answer to @smoky oak
as said, it's too early for my brain to work
thats why there is a dot
just a tiny thought... imagine a world is 50kx50k... and a chunk is 16x16... that'd mean it has 10 MILLION chunks?!?!
because in that case, Moterius' solution is not very optimal haha
hm it'd really be nice if you could explain this to me like I'm a 3 year old who knows english and java but nothing else
if i have more thann 30 seconds i can do the math for a proper spiral
sure, I'm going for a smoke anyway haha
take your time, much appreciated โค๏ธ
This seems to be way harder than i originally thought itd be
The ring order is irrelevant but it should be at least spiral like, like this
The order in each layer is irrelevant
Only important thing is โring 1, then the next outer ring, etcโ
currentRing = 0;
while(!doneYet()) {
for(everyChunk : allChunksOfCurrentRing(currentRing)) {
// do something
}
currentRing++;
}
sth like this lol
int shift=0;
while(true){
shift++;
int checkx_1 = startx - shift;
int checkx_2 = startx + shift;
int checky_1 = starty - shift;
int checky_2 = starty + shift;
for(int checkx = startx - shift; checkx++; checkx < startx + shift){
if(!chunkLoadedAt(checkx,checky_1) || !chunkLoadedAt(checkx,checky_2) {}
}
for(int checky = starty - shift + 1; checky++; checky < starty + shift - 1){
if(!chunkLoadedAt(checky,checkx_1) || !chunkLoadedAt(checky,checkx_2) {}
}
}
``` @tender shard
thanks, lemme try this quickly
this excludes the origin chunk btw
it also is missing your check and return logic
return shift, its the 'radius' of the current ring
erm tbh this is confusing me
oops
int
forgot the int for the loop counters
also you have to add the function to check if the chunks loaded and what you do if that happens, this is only the math
current x,z is cuz i forgot that y is up
yeah the "is chunk generated" check is no problem etc, I am just wondering on how to do the actual math for this loop
well replace all y with z
chunk coord is checkx with checkz_1 checkz_2
heres how the coords in the first loop work
and the second loop is the same thing for the outermost columns instead
the +1 -1 is to exclude the corners since they've been checked in the first loop
does that make sense?
haha sorry but I still dont get it, however I think I got an idea, which I'll try in 10 minutes
ok
my inital idea would be to get the corner chunks beforehand and loop then one time around with the given coordinates and calculated offsets
that would require a base equation like chunk1 << 4+layernr or something which gives you the needed coordinates
I am now approaching a lazy solution by just getting each side individually
I think that's the easiest solution and I would even get the chunks in the correct order
if a corner is checked twice, that's not an issue for me btw
btw, maybe it's helpful to tell my actual attempted solution: I need to loop over all chunks in a world to get rid of a certain block type
and it should be a "one-time" running plugin, instead of constantly listening to chunk loads
aint that what ive been doing with lists
why the fuck have I not peeked at dynmap's code yet
I thought you used a List or Set with ALL checked chunks?
well originally
I am currently just returning a List for every "side" of the current "ring"
the second variant just runs through all coordinates, first the along the x sides then along the z sides
so ive got this velocity code and it works sometimes beauitfully and sometimes its absolutely shit lol
Vector v2 = e.getEntity().getLocation().toVector().clone();
Vector normalized = v2.clone().subtract(v1.clone()).normalize();
Vector destination = v2.subtract(normalized.multiply(1.5));
Vector velocity = destination.clone().subtract(p.getLocation().toVector().clone());
p.setVelocity(velocity);```
for an entity damage by entity event
ok cool
yeah i was wondering if anybody could improve it lol
sometimes it sends you directly to the enemy
other times you get shot straight up or far to the left
You didn't say what it is supposed to do
If I create a /ban command in my plugin, which command will be executed in games? ( My command or the default /ban Minecraft command )
one command name can probably have several executors.
What
you can probably assign more than one command executor to one command name?

they are different commands
then
One executor per command by default.
if you create a ban command in your plugin simpleban
/yourpluginname:commandname
Ok
nvm.
i probably should not overcomplicate things if i am trying to help someone lol.
uh whats a maven archetype
In the context of software development using the Apache Maven build system, an archetype is a template or a set of templates for creating a new project.
An archetype defines the project structure and its initial contents, such as source code directories, resource directories, configuration files, build scripts, and other project artifacts. It provides a quick and easy way to set up a new project that follows a certain standard or best practice.
thanks chatGPT
just the default
where are you creating the project...
with maven ?
yea?
if you are running archetype:generate you get a default option
idk what cursed command you use to create the maven project
button

that is for developing a specific archetype
I presume that is not what you are trying to do
just click new project ?
๐
How do people learn to use bungee stuff? I'm trying to work out how to send data from server a to server b ๐
bungee is maybe not the best way to share data between servers
as you need players on both servers for it to work
I mean, I want to run a command in server a and generate a structure in server b
Well is server b guaranteed to have players on it
if yoru servers are on teh same box/subnet you can use sockets
I mean, I want to make a copy of my private mines plugin into a bungee supported system
Too old! (Click the link to get the exact time)
lol
I wanted the link
I just found it funny how it seemed random
It was random indeed
whats the name of the respawn anchor entity
I don't think the response anchor is an entity
I mean actually its probably a TileEntity
But it's just be called respawn anchor
So if i want to stop anchors from exploding items i have to look for tnt prime event?
Player interact event and check if it's a respawn anchor
also do i use event.blockList().clear();
or event.blockList().remove();
Hello , just a stupid question xd
so i want to broadcast a message to all online players(i know how to) ,
but what i dont know how to is make a player click on the message , and he will execute a custom void method (Not COMMAND!)
i know it ask for a String , but i want to use custom method is it possible?
thats sad xd
the basic concept is the following:
send a message that on click runs /commandName <UUID specific to the command callback you wanna run>
lookup the uuid in an expiring cache and get the Consumer<CommandSender> from it, then execute that
alright thanks
i can do this ?
arneMessageJoin.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "joinarena " + arenaSumo.getName()));
correct?
the players keep crashing if i send a message while the the receiver has me as a hidden player
everything is in the api
any logs? code? errors? custom client?
No custom client, there's no log to give, only a client error message, code that triggers it is to have a player.hidePlayer and sending a message, the player that can't see the other crashes when the message is received @hybrid spoke
i think it's specific to 1.19.3
spigot oversight I presume when implementing chat signatures
are you running spigot or paper ?
spigot
i think so too
Is there any way I can make a minecart invisible?
where do we report spigot bugs?
?jira
thanks
How to change width of custom inventory
Help
i need something like Bukkit.createInventory(holder, height, width, name)
Inventories are always capped at a width of 9 slotsโฆ but you can adjust the rows by putting 9*rows as the slots parameter
you can't, minecraft is 9 per row
you could try a crafting bench
but it's not really an inventory
how
i don't know exactly how you could get one, search the forums for custom workbenches
bro thats messed up
I wonder if its possible to get a graphic to cover some of the rows to pretend they are not there ๐ค
that you can do with a texture pack
I meant without a texture pack
How can I add a maven dependency if the plugin I need to depend on doesn't have maven support and I can only have a .jar file
Is there a way to get the slot you are shift clicking an item into?
That seems annoying to do
Alright, gonna attempt to
Songoda is terrible. So annoying
mvn install:install-file -Dfile=<path-to-file> -DgroupId=<group-id> -DartifactId=<artifact-id> -Dversion=<version> -Dpackaging=<packaging>
What's packaging
jar
You can deploy differently packaged things into a maven repo
E.g pom or jar
You want jar
[INFO]
[INFO] ------------------< org.apache.maven:standalone-pom >-------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] --------------------------------[ pom ]---------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.106 s
[INFO] Finished at: 2023-02-15T12:05:04-03:00
[INFO] ------------------------------------------------------------------------
$ mvn install:install-file -Dfile=FabledSkyblock-2.5.1-DEV.jar -DgroupId=com.songoda -DartifactId=skyblock -Dversion=2.5.1-DEV -Dpackaging=jar
Hover over the error first
no implements Listener
Does anyone uses ormlite?
Not in a while. Whats your concern?
After version 5.0 its generating a log folder even if logging is disabled (it doesn't write anything) but the folder and a file named latest.log is created, do you happen to know an easy fix?
Hm no idea
Ty, anyway. Just wondering what are you using now?
When working with relational DBs then Hibernate.
But i switched to document based DBs for spigot.
send the full maven error log
Mh, ok ty
how to get a file content in resources folder?
getResource
returns an InputStream
myPlugin.getResource("myFile.txt");
if you need it as List<String>: throw the inputstream into a inputstreamreader, then throw that into a bufferedreader, then you can loop over lines()
huh wtf
wait wait wait
are you trying to add someone else's jar to your local repo?
or your own maven project?
someone else's jar, or your own project?
yeah then, what you tried to do, is actually correct
I need to add https://www.spigotmc.org/resources/economy-bank.7674/ as a dependency
what's the output of "mvn -version"?
Apache Maven 3.9.0 (9b58d2bad23a66be161c4664ef21ce219c2c8584)
Maven home: C:\apache-maven-3.9.0
Java version: 19.0.2, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jdk-19
Default locale: en_US, platform encoding: UTF-8
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
You know what, that plugin is full abandoned, I'm just not even gonna add support for it
hm weird, I do not reall yunderstand why it fails for you
HOWEVER
easy fix:
- Clone this repo:
https://github.com/brunyman/EconomyBank - Open it in IntelliJ
- run "mvn install"
Did you manually tinker with the pom inside your maven repo?
they just run `mvn install:install-file", there is no pom
Did not
Ok this is a good alternative
mvn install:install-file shouldn't require nor create nor whatever care about any pom file
But since resource is dead. I'm not gonna support it
And leaving a 1 star review while im at it
do not leave a 1 star review
Songoda has its own website now iirc
Nah I'm not gonna do that
Songoda makes me wanna pull my hair out
if you rate sth one star, you'll get a one star rating back from the dude lol
But the dev was kind enough to literally zip his local repo and send it to me privately
if you upload plugins yourself, just refrain from giving out 1 star reviews yourself
Did the plugin have anything offensive in its name? Then you can leave a 1 star review 
Nah I was joking. I won't leave a 1star for any reason
Was just mocking alex a bit
yeah yeah, very mature
oh you probably do not have permissions to view it
you're not mocking me, but just defending people who on purpose still continue to use that word
I keep forgetting that Is a considered a slur bow
Im going to end up getting cancelled on Twitter one of these days
how was this dude called again that kacper is so obsessed with?
this dude who looks like a penis and thinks he's the greatest because he owns like 5 cars?
erm
i dont remember
mvn install wants all the values in quotes now
no
someone else had that issue and putting them in '' fixed it
then they had some weird symbols in their path
maven itself doesnt care, it just processess what gets passed to it
I know this from experience since it was a pain to get mvn archetype:generate to work from javas processbuilder
(although tbf I can only speak about maven 3.6.3)
Thats only an issue if paths have a space in them
So a windows issue
Hello guys, i would like to setup spigot and maven for Minecraft 1.7.10 but I don't know how to write the dependencies, can someone know how to do it ? Thanks for your answers
Holy fuck 1.7.10?
That's like
ancient
it's history
even BUILDTOOLS doesn't support it
you need to use plain bukkit
if you can get a build of it that is
1.7 ๐คฃ
i'm an arcaic people
well you can try get a bukkit build
just out of curiosity, why 1.7?
tbh it was a great version
Get a bukkit jar from somewhere and throw it in your local maven repo...
I just love this version ๐
๐ค ~yeah but things in 1.7.10 are also in 1.19.3 for example
on 1.17.10 I got 9 essence collectors stolen from me (avaritia)
never again
i was asking in case you were running a 1.7 server cause u wanted to have multiple versions and maybe you thought the server had to be on the "oldest" version possible.
precisely there is everything to create
if u want it cause u want it, sure, nothing against
if you can code you should try minestome
minestom
it's basically just the bare network protocol
and you can change everything
(includes world and stuff)
i've tried but i dont know why maven are not able to import the dependencies
did you install it via mvn install:file ?
no
I love Minestom hehe
You just gotta bear in mind it's for certain kinds of projects. Don't try make a survival server in it unless you're truly ambitious and willing to sink years
whats the Command Dispatched Async error?
it's amazing for like transitional lobbies (such as waiting for data to be fetched)
:-
Bukkit.getScheduler().runTask(plugin, () -> task);
same and i tried new BukkitRunnable(..).runTask();
and i tried this:
new Thread(() -> { skinMenu(player, args); }).start();
what? xd
you should never do that on spigot unless you have a good reason
?paste some code so I can help you better
hi, how do I send fake-blocks fast like structure-blocks do it?
uhhmm
I am currently using multiblock-change-packets but they are waaayyy too slow, lagging out the client all the time
@Override
public boolean execute(CommandSender sender, String arg1, String[] args) {
if(!(sender instanceof Player)) return true;
Player player = (Player) sender;
if(!Major.hasPerm(player, "pgxpo.nick")) {
player.sendMessage(Major.MU("&cOops.! You do not have enough permissions"));
return false;
}
NickStep step = Major.getStep(player.getUniqueId());
switch (step) {
case SKIN_INVALID:
case SKIN:
new Thread(() -> {
skinMenu(player, args);
}).start();
break;
case RANK:
rankMenu(player, args);
break;
default:
acceptionMenu(player, args);
break;
}
return true;
}
@rough drift
Player#sendBlockChange
way too slow
i'm too lazy to open the browser ๐
you can just check player.hasPermission
what does skinMenu do
this sends a packet for every block changed, taking extreme amounts of bandwidth exploding the client on higher scale
I mean I guess, just use a chunk update packet
Ghost blocks
that is actually changing
Minigames as well ๐
actually changing would not hurt the client as much, but fake-blocks do
I am sorry what
fake blocks hurt the client less
if(args.length > 0) {
Pattern pattern = Pattern.compile("^[a-zA-Z0-9_]{3,16}$");
String name = args[0];
if(name.equals("-r")) {
new SignGUI()
.lines(new String[] {
"", Major.C("&eName Here &lโฌ"), "", Major.C("&0NickSystem")
})
.onFinish((p, lines) -> {
Major.NICKS.put(player.getUniqueId(), nicker);
Bukkit.getServer().dispatchCommand(player, "/nick");
return null;
})
.open(player);
return;
}
if(pattern.matcher(name).matches()) {
Major.NICKS.put(player.getUniqueId(), nicker);
} else {
Major.setStep(player.getUniqueId(), NickStep.SKIN_INVALID);
}
Bukkit.getServer().dispatchCommand(player, "/nick");
return;
}
String randomSkinName = Major.mySQL.randomSkin();
BookUtil.openPlayer(player, BookUtil.writtenBook()
.author("PGxNick")
.title("PGxNick")
.pages(
new BaseComponent[] {
Major.getStep(player.getUniqueId()).equals(NickStep.SKIN) ? new TextComponent(Major.C("&0Please choose how you look?\n\n\n")) : new TextComponent("&0Please choose how you look?\n&cInvalid Skin Name!\n\n\n"),
yourSkin,
alexOrSteve,
random,
custom
}
)
.build()
);
String randomSkinName = Major.mySQL.randomSkin(); this fetching random data from mysql
I mean you just throw out the bits that actually change it, but it has the methods they just need to be modified for a specific use-case.
run the dispatch command in a new task
i removed some vars cuz the message is too long
do u mean
then tell me why you can send thousands of blocks a second with changes while lagging out the client with fake-blocks that are more than like 500 blocks/s
Bukkit.getScheduler().runTask(plugin, () -> { Bukkit.getServer().dispatchCommand(player, "/nick"); })
ha? whats the issue?
Thing is you can't do the first one either
dispatchCommand needs to be run in sync
everything else should be fine
the issue comes from the dispatchCommand method?
yea
i hate java
but yep thanks you dude u helped me a lot
spigot is doing these weird things
look at FAWE, look at structure blocks
they send chunk update packets
one chunk at a time
why? and the docs sucks i cannot make my code from the docs i have to research every thing :/
not blocks at a time
Threading issues
which is not possible with fake blocks
rather than making everything work nicely in multi threaded environments they just lock it
It is
you would need to calculate a completely new chunk temporarely and fakely
do you have the slightest clue about the protocol?
sad
and then send it
that would lag out the server then
it is indeed expensive to copy a few chunks and overwrite the clone of them with the blocks that should change
since you'll be using NMS for it anyways you can just access the raw array
make a copy of it using System.arraycopy and edit it
there is no faster way
then I gotta iterate through millions of blocks
oh wait
do this
and edit the index
like blocks[15]
translate the blocks to edit into the index?
hmm ok imma try ty
a range from 1-as many blocks as possible per second
hm
Wait don't system.arraycopy
there is a better way
I'll tell you once I am back home if you want
gtg now lmao
cya
just ping me then
is there maven artifacts or something to get BuildData for any version?
I need to get spigot mappings in an application
tough one
main entry point is https://hub.spigotmc.org/versions/
from there you can get yourself the build data ref
Any idea why a counter is negative, its a stupid question but doesnt make sense
what counter?
A player time counter, which counts how many time he has played
have you tested out what I said earlier
What?
I dont use anything related to world nor spigot, its a custom counter