#help-development
1 messages · Page 476 of 1
Is that file empty?
use winrar or something and check
Ok cool. I'd try deleting the generator.yml that was created on the server and restarting.
Let it try and refresh itself.
yep
alrighty
still empty
delete the file#createNewFile
thats most likely is what is breaking
also generators.yml and generator.yml
ur missing the s
Looping is counted in ticks or seconds?
Runnables use ticks, nearly everything else is in milliseconds.
How many ticks is 1 second and is runnables used for looping?
20 ticks is 1 second
shouldn't this be ["ew"]?
java.lang.NullPointerException: Cannot invoke "org.bukkit.configuration.file.FileConfiguration.getStringList(String)" because "org.mobgens.api.GeneratorConfiguration.configuration" is null
String lists are formatted like this:
section-that-is-a-list:
- String1
- String2
- etc
ohhh
my bad
wait
so
how would i get all the things in generators
like if its generators.ew and generators.eww
thats a config section
You are dealing with a simple string. So use #getString()
tyty
Path subsections are separated using the period symbol. .
So you want #getString("generators.ew.test")
so um
public static @Nullable Set<String> getGeneratorList() {
ConfigurationSection section = configuration.getConfigurationSection("generators");
return section.getKeys(false);
}```?
that would return ew iirc
epic
That will return a list of all the section names under "generators"
You will have to iterate over that list and use the string to complete the path.
also
@Override
public @Nullable FileConfiguration loadFile(@NotNull String path) {
File file = new File(plugin.getDataFolder(), "generators.yml");
if (!file.exists()) {
try {
plugin.saveResource("generators.yml", false);
} catch (Exception e) {
e.printStackTrace();
}
}
return YamlConfiguration.loadConfiguration(file);
}``` should this be returning null?
cuz it is
for some reason
java.lang.NullPointerException: Cannot invoke "org.bukkit.configuration.file.FileConfiguration.getConfigurationSection(String)" because "org.mobgens.api.GeneratorConfiguration.configuration" is null
private static final FileConfiguration configuration = utils.loadFile(plugin.getDataFolder().getAbsolutePath() + "/generators.yml");```
why
That depends on when you are calling that. Since it's a variable that's initialized out of any local scope, it will likely be null since you have not created the file yet.
the un-needed static just hurts
and the either instanced utils or lower case class name
private final YamlUtils utils = new YamlUtils();
private final FileConfiguration configuration = utils.loadFile("generators.yml");``` just these
utils shouldnt really need to be instanced
That shouldn't even work if those are global variables.
that is the correct time for static
if you need a plugin instance for example, you pass it in the method or have a static getter in your main class
?paste the error
java.lang.NullPointerException: Cannot invoke "org.bukkit.configuration.file.FileConfiguration.getConfigurationSection(String)" because "org.mobgens.api.GeneratorConfiguration.configuration" is null```
oh
full error
Is it possible to implement/extend multiple things like command executor and bukkitrunnables at the same time?
I mean
you can implement multiple things you can only extend one
Same class
whats GeneratorConfiguration.java line 29
java.lang.LinkageError: loader constraint violation: loader org.bukkit.plugin.java.PluginClassLoader @549e60c5 wants to load interface net.rosamei.alixapi.commands.CommandInfo. A different interface with the same name was previously loaded by org.bukkit.plugin.java.PluginClassLoader @50a32b2c. (net.rosamei.alixapi.commands.CommandInfo is in unnamed module of loader org.bukkit.plugin.java.PluginClassLoader @50a32b2c, parent loader 'app')
Somone knows why? never saw this error
Alr thanks
ConfigurationSection section = configuration.getConfigurationSection("generators");```
configuration is null there
ye
i would recommend making the yaml utils class static now, then asigning the configuration in a constructor
Do we need to extend or implement anything to make items?
shouldnt need to
No, just use the ItemStack class
yeah i literally just did that xD
Alr
same error
doe
thus
public static @Nullable FileConfiguration loadFile(@NotNull String path) {
Plugin plugin = MobCore.getPlugin();
File file = new File(plugin.getDataFolder(), path);
if (!file.exists()) {
try {
plugin.saveResource(path, false);
} catch (Exception e) {
e.printStackTrace();
}
}
return YamlConfiguration.loadConfiguration(file);
}``` is the problem
what are you pasing into the method
well this is the variable that is null
private final FileConfiguration configuration = YamlUtils.loadFile("generators.yml");```
assign it on a constructor
you have 2 instances of the class then somewhere
my whole
Just realised something, when I'm gonna give the player the item, wouldn't the list of vanilla items pop up? How would I give an item I just created a little bit earlier?
file
Save the instance of it somewhere and pass it into your methods.
Uhm alright
Just checking, instance means like p in player p = sender eight?
Right?
More or less
player.getWorld().getName().equals("world") is player here an instance or the entitiy
by entity i mean bukkits ya know
alr
is it better to make item in another class or is it fine if i do it in the same as command class
Yes
can i just implement commandexecutor for my item class? i know its kinda not needed but still it makes stuff easier
@Override
public boolean onCommand( CommandSender commandSender, Command command, String s, String[] strings) {
return false;
}
ItemStack token = new ItemStack(Material.DIAMOND,1);
ItemMeta itemMeta = token.getItemMeta();
itemMeta.
itemMeta acts asif its never heard of setdisplayname before
any alternatives?
@Override
public @NotNull Generator getGenType() {
Map<String, Generator> gens = RegistryHandler.registeredGenerators;
return gens.values().stream()
.filter(gen -> gen.getMaterial().equals(getGenerator().getMaterial()))
.findFirst()
.orElse(null);
}```
since this entire thing is for a command anyways imma just put it in the commandclass
you cant do that outside the method
which is why it's saying that method doesn't exist
oh alr
thanks
@Override
public boolean onCommand(CommandSender commandSender, Command command, String s , String[] strings) {
if (commandSender instanceof Player)
Player p =(Player) commandSender;
getPlayer().getWorld.getName().equals("AFK");
ItemStack token = new ItemStack(Material.DIAMOND,1);
ItemMeta itemMeta = token.getItemMeta();
itemMeta.setDisplayName(ChatColor.YELLOW + "" + ChatColor.BOLD + "AFK" + ChatColor.GREEN + "" + ChatColor.BOLD + " Token");
getworld dosnt work, how else can i do that?
and i dont even need.getname right? i just wanna get the world where this task will happen
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
alr
when i select from the menu it shows .getworld as red-
wait NO WHY DID I DO AN IF STATEMENT LMAO
because command sender can be console too
alr
you just need to add {} and put the rest of the code in it
got it
done, i gtg ill come back and finish the item
public class afkon implements CommandExecutor {
@Override
public boolean onCommand(CommandSender commandSender, Command command, String s , String[] strings) {
Player p =(Player) commandSender;
p.getPlayer().getWorld().getName().equals("AFK");
ItemStack token = new ItemStack(Material.DIAMOND,1);
ItemMeta itemMeta = token.getItemMeta();
itemMeta.setDisplayName(ChatColor.YELLOW + "" + ChatColor.BOLD + "AFK" + ChatColor.GREEN + "" + ChatColor.BOLD + " Token");
itemMeta.lore(Collections.singletonList(ChatColor.BOLD + "" + ChatColor.GOLD + "Trade With AFK Villager"));
return true;
}
private boolean getPlayer() {
return true;}
}
now i need to give the player the item then extend it to bukkitcollectibles, how to give it to the players
you need to extend it to bukit collectibles because?
how could I load a world without stopping the server?
with WorldCreator It stop the server for a few tick
wtf is
private boolean getPlayer() { return true; }
also why are you blindly casting sender to player
why is there an "equals" that does literally nothing
why are you not passing meta back to item
why are you not doing anything with the item

Runnable
?scheduling
^^
multiworld
what
I guess you mean it lags the server
not stopping
like freezing
hum i have question is that possible to have just unique jar file because i have 3 files
orginal-artefact.jar
artefact.jar
main-1.0-snapshot.jar
iirc there isnt a way to create a world without blocking in spigot, only paper have async world stuff
main-1.0-snapshot.jar is the only one you need to use
is it in their api or you can just use bukkit runnable so it would work?
i dont use paper api so i wouldnt know
spigot isnt designed to be async so it most likely wouldnt work
ok but when i package it he create main-1.0 in last (3 times to run to have this file)
that isnt normal, you should get that file every time you run package
public class ClassName {
private static BukkitTask flyingTask;
public static void createTask() {
flyingTask = ...;
}
}
or where ever you create the task
To loop the function
I am stupid I'm taking a big ass break to learn java after this
you dont need to extend bukkit collectibles for that
is it possible to load world in another thread
So how do I give player the item and what are the more than 100 mistakes I've made that's gonna make it not work
how to use firebase with spigot?
i would create the item on onEnable and save it to a class var with a getter then every 10 min loop over the players
What on earth are you trying to do with firebase?
keep user data i'm assuming
ignoring the jank, https://paste.epicebic.xyz/uwuqiweciq.java why would the json be getting \n laced through it, only on the tempData
Can I just do @override and put it on top of the command for on enable? I'm dumb cuz I dont know what var is, I'm also dumb cuz where do I get a getter and I'm dumb as hell cuz I dont know how to loop.
var is short for variable
@override for on enable
i can show you what i mean if you want
Oh
Yes please
give me like 20 min
is it possible to load world in another thread
or at least make it not causing the server to freeze
best you can do is to not preload the spawnchunks
?
is possible to use firebase in spigot?
yes
but you need to learn java and maven/gradle stuffs first
i just get this error Encountered an unexpected exception java.lang.SecurityException: Invalid signature file digest for Manifest main attributes at sun.security.util.SignatureFileVerifier.processImpl(SignatureFileVerifier.java:340) ~[?:?] at sun.security.util.SignatureFileVerifier.process(SignatureFileVerifier.java:282) ~[?:?] at java.util.jar.JarVerifier.processEntry(JarVerifier.java:327) ~[?:?] at java.util.jar.JarVerifier.update(JarVerifier.java:239) ~[?:?] at java.util.jar.JarFile.initializeVerifier(JarFile.java:762) ~[?:?] at java.util.jar.JarFile.getInputStream(JarFile.java:845) ~[?:?] at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:173) ~[spigot-api-1.19.2-R0.1-SNAPSHOT.jar:?] at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:144) ~[spigot-api-1.19.2-R0.1-SNAPSHOT.jar:?]
you cant prevent the lag in spigot, you can only make it smaller by not preloading the spawnchunks
alright tks
it was not addressed to you brother 😭
Well I thought it was lol I'm stupid, I've just been going off tutorials I've seen
I'm sorry I'm not impatient but u done?
Thanks for this btw
just testing it now
Alr
@rigid sage https://github.com/The-Epic/AFKRewardsExample or if you just want the jar
do /afkrewards set while holding the item you want as a reward, and change the world name in config.yml then /afkrewards reload and it should give them the item every however may minutes, set in config, they are there
WOW THANKS MAN
thanks alot, imma learn more java first before going into this, really appreciate it man
the config will generate once the pl has be loaded right?
yeah
yeah
how do I get the source code of a minecraft server?
do i have to decompile the server jar and apply mappings?
or is there another way
?nms
@sly berry ^
alr
There‘s also eclipse and netbeans, but i‘d use IntelliJ
Alr
Do you have any way to load a world without lag the server @@
or just a way to keep server running as well as loading the world
@remote swallow sorry for the ping, it detects player movement or just gives it to ppl in the world
gives it to each player in the world every X minutes they've been
you can change the world in config.yml
So is it possible to force chunk to not loading?
my spigot jar got skill issue i be3lieve
cuz
executable items aint loading
its in plugins folder but the plugin aint pluginning
Read the startup log
i installed the buildtools thingy and executed it, then i've added
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.19.4-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>```
to my dependencies but it doesn't allow me to use nms
i'll check it out
nope, i can't get it to work
what doesn't work about it
?notworking
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
Well
You'll need knowledge of both java & python for that
Basically you'll need to write a protocol
and send custom packets
you could use redis pubsub
subscribe on java
publish on python
but it's a rather complex task
I'd recommend you learn java first
if you want to make any sort of plugin
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
Dear god
Time to break that system into a few steps
Learn Java sockets
Lor just use SSH
and host it on a virtual screen you can detach
on mobile use JuiceSSH as a good ssh client
means its secure compared to whatever you could create from scratch
it also uses this thing
You can not do that, The socket is already in use
when i tried rcon it was hella buggy and sometimes wouldnt even connect
and idk how to even connect to rcon properly
if your server has a decent amount of ram use discord srv
discordsrv doesnt have remote console
pretty sure it does
wait lemme try
I've worked with the creator of discordsrv before
he's smart enough to have done it already
whos the creator, is it scarz or vanka or whatever his name is
scarcz
oh they finally are back to being DiscordSRV support not NotcordSRV
aight i installed discordsrv now what
set it up
Alright guy, I have a unique issue. There is unique world generation differences when comparing vanilla to spigot (and paper) 1.12.2 (Yes I know its old, its for 2b2t okay). This is specifically related to cave generation and it seems like some kind of rounding error. Screenshot is linked https://imgur.com/a/sbANNYt
create a discord bot instance and a server, invite said bot and add the token to discord and the channel id in the config
shoot its not webhooks?
I would like, with your assistence to figure out which patch is causing these issues
it would get rate limited pretty quick
do i need to do any bot coding or is it auto
Hello, how can I check if 3 specific items have been thrown on the ground?
auto
ok good
any range?
2 blocks
hmm
I had a look here but the old patches related to pure world generation (not structures/mobs) I could find just fixed MC-54738
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/nms-patches?at=refs%2Fheads%2Fversion%2F1.12.2
I'd probably do a scheduler thing
with proper handling to avoid memo leaks
just have a list of matching item uuids
loop through that list
group them together
something like
might be noise generation
If possible, please point me to the patch file which could host such changes
I linked a folder of patchs that are used
where do i change the bot token
it might not even be in a patch, it could just be anything to do with world gen/chunk gen
well from my understanding only the patches are the difference between vanilla and spigot/paper etc?
pretty much
if its not chunk gen it might not be in craftbukkit but spigot patches
nvm grouping them is annoying
config.yml
Yeah I compared my client mod to vanilla world generation
the chunks made match exactly in terms of caves
from my understanding 2b2t has gone through multiple version changes
so the chunks that you're at might be generated in a previous version
so im thinking only the patchs for paper/spigot could cause these world generation things
No i confirmed this wasnt the case by generating serveral localhost servers with different software and the seed set
all had the same phenomina except vanilla
I have tried
craftbukkit
spigot
paper
what about more exotic software?
wdym?
forks of paper
I havent checked those because it takes time to set up all of these servers and check them
😅
but basically the client mod generates the world using vanilla world generation
and compares it to the chunks the server sends
so vanilla server + vanilla world gen client mod == match
but anything else + vanilla world gen client mod == differences with cave generation
if you have a look at the screenshot it makes me almost think the blocks were being rounded the wrong direction
when using the noise to block placement
well hmm
block placement/removal threashold etc
you'll need to severely reverse-engineer the whole world gen process
and compare numbers
basically make a spigot fork
and make a ton of debug lines
Well i was hoping i could just read the differences made in paper/spigot that create this world gen change
printing out numbers
In here I already checked the WorldGen patches
please lmk if you see anything else that may be related
to WorldGen or the noise used for such
or especially cave generation
For sure, although I feel that would take a lot of effort and time compared to looking at the minecraft server fork patches that they apply
block populators could be a start
which patch file do you think it would be located in, within the folder of patches above
or a group of patches
there is something about populators in the Chunk class
Here is the only thing i found, unsure if its related to my issue
+ // CraftBukkit start
+ BlockSand.instaFall = true;
+ Random random = new Random();
+ random.setSeed(world.getSeed());
+ long xRand = random.nextLong() / 2L * 2L + 1L;
+ long zRand = random.nextLong() / 2L * 2L + 1L;
+ random.setSeed((long) locX * xRand + (long) locZ * zRand ^ world.getSeed());
+
+ org.bukkit.World world = this.world.getWorld();
+ if (world != null) {
+ this.world.populating = true;
+ try {
+ for (org.bukkit.generator.BlockPopulator populator : world.getPopulators()) {
+ populator.populate(world, random, bukkitChunk);
+ }
+ } finally {
+ this.world.populating = false;
+ }
+ }
+ BlockSand.instaFall = false;
+ this.world.getServer().getPluginManager().callEvent(new org.bukkit.event.world.ChunkPopulateEvent(bukkitChunk));
discordsrv works perfectly ty :>
it creates a new random with the same seed to not tick the existing random but
try it out
I apoligize but would it be possible to simplify that explanation down i tiny bit
I dont usually work directly on spigot/paper sorry
Random random = new Random();
random.setSeed(world.getSeed());
This creates a copy of the random so that when you call nextLong it doesn't interfere with the world's random generation
effectively making it maintain compatibility with vanilla
Gotcha
Thanks
also might be related to this
Unexpected terrain generation change in the end
that was on 1.16
true, and its only for nether/end
i tried to use InventoryOpenEvent but it doesn't work, i tried to send a message to the player when it runs but it doesn't work. In the same class I have an InventoryCloseEvent and it works can you help me?
?nocode
It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.
Whats the issue? not working is not descriptive
When I open the inventory it should check "Inventory open" in chat and remove the arrow but it doesn't work. Invence onCloseInventory works fine
?notworking
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
you see no message on opening?
You will only receive an open event if it's an inventory other than the Players.
Player inventories are client side and fire no event for open
From memory
oh
open a chest and it will fire
so I can't send a message when I open the player inventory?
no
okay thanks
Does that mean there is like no way to track that?
the client no longer seeds a packet when the player opens their own inventory. Only interactions
When did it send a packet tho?
many years ago
Time doesn't work here, we're talking about minecraft, tell me the version
Like I'm going to remember what version something stopped happening
thats current
Just be up to date with latest and it's all good
pretty sure that was a mis-quote
Nah it wasn't. I was just saying that there's no reason to remember when things like that changed
ah
I was just a little late to respond
I have done the build tools thing
but i cannot seem to find any packets in there
packets?
?nms Did you follow this howto precisely?
client to server
it is the name used for it
what packets are you looking for?
not when you've given no context
i replied to the message
i am looking for the "packets" which are sent between the client and server, like block updates, sound and player positions
he told you to follow the nms howto and you are talking about packets so I'm assuming you are looking for NMS packets
if you followed the howto nms you will have all the packets available
there's only one step on the website
java -jar BuildTools.jar --rev 1.18.2 --remapped
this
and I did that
i have to put the entries in the pom.xml file in "Spigot" folder right?
these would be located in the minecraft.jar
I'm trying to read a json file, what should I do If I want to get the value code from this json?
I have the JsonObject, but don't know what should I put on json.get("?")
{
"data": {
"id": 40,
"code": "094006746161",
"balance": {
"starting": "60.00",
"remaining": "60.00",
"currency": "GBP"
},
"note": "My note",
"void": false
}
}
how do I get the damage cause in EntityDamageEvent?
to be exact, the entity
someone talking about packets ayo
have you tried putting code in the get?
Do people use deobfuscated code for packets?
I thought it's like a yaml, so I did json.get("data.code") but it throws NPE exception.
json.get("code")
the other way you might have to do it, is to get data and then iterate over that
I typically just use JsonSimple
so.......how do I get that?
are you building a plugin or just trying to see MC source?
then add --generate-source to your buildtools commandline
once run you will have a work folder
its located in the maven repo, unless you want the full decompiled version, then its in the work directory of buildtools
Still throws npe exception
what does the NPE say?
you cant just get code
you have to get data json object
then get code from it
((JsonObject) json.get("data")).get("code")
Basically JsonObject.get(String) is null
Like this perhaps?
JsonObject json = JsonParser.parseString(response.body().string()).getAsJsonObject();
JsonObject data = json.get("data").getAsJsonObject();
String code = data.get("code").getAsString();
yeah that would work too
It works perfectly, thank you so much guys for the help!
I figured that might have happened, however as I stated it depends on the lib. I am not super familiar with using Gson, I typically use Json Simple 😛
so a way you could iterate data is like so
JSONArray array = (JSONArray) JSONValue.parse(string);
JSONObject latestUpdate = (JSONObject) array.get(array.size() - 1);
Not sure if this works with Gson, but this is how you would do it with JsonSimple or a way anyways lol
at all have you asked chat gpt if it may know
I don't need AI's help 🙂
we dont need it but it could stand the change to speed stuff up
another few years and AI will be writing full plugins and you will all be out of work
X doubt
Then it's onto full games
it would need music writing, texture creating and other stuff for that
dialogue lines, story writing
Yes
have you seen teh leaps AI has taken in teh past few years?
Look at some of the paintings it has created recently
It's even creating porn as good, or better, than real actors
Good porn is a low bar
Deep fakes almost indistinguishable from the original
10 years ago AI was about the standard of canned responses to specific prompts
As in every (technical) aspect the acceleration decreases over time.
It will take at least another 30 years before AI can write code on request that is stable, maintainable and expandable for any project that isn't "give player a block when he steps on a GRASS_BLOCK".
The improvements are accelerating
You are thinking about Human technical development
That slows down as time progresses
AI is accellerating.
No I'm not. And especially for games that receive updates AI will suffer.
It learns from challenges that were already solved. When a new feature is created it won't be able to solve it because it has no data. You would still need humans to serve it that data
AI is overhyped
for a few years
There is a new AI just recently released which tests itself
It posits problems and judges it's own solution
then refines over and over
And even if AI could write code as good as humans you'd still have to give it very specific instructions. Including the handling of some edge cases - such specific instructions cannot be written by anyone. You still need technical knowledge. Also lets be real: There's a lot of simpler jobs to replace with AI than programming
It will reach a stage where the AI designers no longer understand what the AI is doing, but the results will be what was asked of it.
It’s like what fire ship says
Instead of coding directly you’ll be telling chat gpt what to code
But it’s not gonna build your whole app for you
Yeah but for the next 20-30 years it will see hard limitations + as I just said it needs very specific instructions.
Honestly I'd appreciate an AI that does the work for me by just knowing how to ask for it.
I'd rather spend 10 hours writing an essay for what it should do than to code it for 6 weeks.
Being that specific with your requests will be an uncommon skill that you will get a lot of money for.
Especially if you can review if the AI implemented everything correctly by taking a look at the code afterwards
Eventually it will
You still have to be very explicit about each tiny part
That would require AI to understand exactly how humans think and that will not be achieved in the near future
It will be AI deciding what will sell the best, another AI producing that product and yet another AI tricking people into spending your government assigned credits on it.
It will be AI deciding what will sell the best
If the AI uses internet to decide that, whatever you will create will contain nudity of some sort
a chatGPT job if I ever saw one
Yup there it is
Enchanting enums, how they mystify,
With every value distinct and sly,
A set of constants, an ordered list,
Each one a symbol, not to be missed.
Some may hold strings, others just ints,
But all carry meanings, like subtle hints,
They organize data with neat precision,
Adding structure to code, a programmer's decision.
From weekdays to colors, to states of mind,
Enums make code more readable, easy to find,
They keep bugs at bay, errors in check,
Simplifying code, with fewer lines to trek.
Oh, the wonder of enums, a coder's delight,
A simple tool, that makes everything right,
From novice to pro, they make coding fun,
A powerful feature, a language has won.
No need to get political
drag is political now?
it wrote this for me
Enums, oh enums, so steadfast and true,
A list of constants, defined anew,
With each value named, a unique hue,
A powerful tool, for coders to imbue.
An enum's purpose, it's plain to see,
To give a type, a sense of identity,
A finite set, of values quite tidy,
To make code, more clear and tidy.
From colors to days, to states of play,
An enum can hold, a myriad of ways,
To classify data, in so many ways,
And make programming, a breeze and a craze.
Oh enums, how you simplify code,
By providing clarity, in the developer's abode,
You give meaning, to data untold,
And help coders, to lighten their load.
So let us cherish, these constants so fine,
And use them with care, in every design,
For enums are a tool, that can refine,
And make programming, an art so divine.
No
But I thought you were referring to the whole debate about the drag story times
And all that stuff
And let’s just not get into it
it rhymed tidy with tidy 💀
Hey can someone know hwo to import in gradle its own plugin ? Like i have 2 plugin and i want to use a custom event from one in the other ! 😄
I don't know gradle but I can explain how it works with maven, maybe you can do the translation
For maven it's really simple. You just run mvn clean install which install the jar inside your .m2 repository.
Then you just add it as a dependency like any other project (see example below)
Since maven (and I'd assume gradle aswell) checks the local repository before searching online it will find it.
<dependency>
<groupId>de.fabsi</groupId>
<artifactId>eventengine</artifactId>
<version>1.0.0</version>
<scope>provided</scope>
</dependency>
you need the maven publish plugin for gradle and you can gradlew publishToMavenLocal then just need the mavenLocal repo and your good
Cannot read the array length because "this.paginableSlots" is null
Paginable: https://sourceb.in/392tvWx4a7
Gui: https://sourceb.in/o2CcD1CTXw
Idk, why this problem is showing

I’m guessing you never initialize the array
its inizialized because when i add into the list with setPaginableSlots
share that logic too
https://sourceb.in/o2CcD1CTXw this is the GUI
can you also share the full error ^
yes
Caused by: java.lang.NullPointerException: Cannot read the array length because "this.paginableSlots" is null
and i knew that already but i don't know why
its the slots
not the icon array
you set the paginable items list
but never the call setPaginableSlots
yes i did in line 19 and 25 in the update
in what update ?
https://sourceb.in/o2CcD1CTXw in the gui
^^
im stupid
if I have a block location, how can I get every block in a 1 radius around that like so I would get all 26 around the 1 block
I mean, three for loops and a simple if x == 0 y == 0 and z == 0 ?
alternatively, could use the blockface enum
and exclude the SELF variant
Set<Block> blocks = ..
for (BlockFace face: BlockFace.values()) {
blocks.add(block.getRelative(face));```
Just exclude SELF ^ otherwise you end up with 27 blocks in that set
if you don't want the origin
?jd-s
yea that didnt work.. I was saying a box like 3x3 but its doing this weird thing
wdym
?paste your code
looks fine to me
just make a for loop
block face is just fucked 
actually I'd crteate your own enum setOf
theres a few odd BlockFaces you don;t want
Yep I'd do a static final Enum.setOf
the block faces are fucked tho
thats why you create your own, only using the ones you want
none of the stupid WEST_NORTH_WEST
Enum.setof(BlockFace.NORTH_WEST, BlockFace.NORTH, BlockFace.NORTH_EAST...
I mean, it is missing some they need tho so like
like, its missing NORTH_WEST_UP
for a 3x3
just go with a for loop 
you can run it three times, one for y-1, one for y and lastly y+1
Yours is probably simpler
mine would be easier to read is all
yours would be 3 for loops
so same
yea
so, ehm, in here
Location loca = event.getBlock().getLocation();
for (int x = loca.getBlockX() - 1; x <= loca.getBlockX() + 1; x++) {
}
would I just make like a list or set of all of the X's and do same for Y and Z then clear all those blocks with the first in each list and 2nd in each list and so on or what
what
u went to spigot plugin development to get help with skript
weird
Skript has a discord
ok so ehm @echo basalt is this what I do? I'm confused what to do with these for loops
my man
?
for (y = -1; y <= 1; y++) {
for (x = -1; x <= 1; x++) {
for (z = -1; z <= 1; z++) {
event.getBlock().getRelative(x,y,z).setType(Material.AIR);```
for(int xRelative = -1; xRelative <= 1; xRelative++) {
for(int zRelative = -1; zRelative <= 1; zRelative++) {
for(int yRelative = -1; yRelative <= 1; yRelative++) {
Block relative = block.getRelative(xRelative, yRelatize, zRelative);
// do whatever
}
}
}
Im trying to clone a SlimeWorld, but no world is created and this shows up in the console
[19:29:09 INFO]: [ChunkHolderManager] Waiting 60s for chunk system to halt for world 'private-192909'
[19:29:09 INFO]: [ChunkHolderManager] Halted chunk system for world 'private-192909'
Someone can help here
SlimeWorld slimeWorld = getSlimeWorld(world)
.clone("private-" + now.format(formatter));
SlimeNMSBridge.instance().loadInstance(slimeWorld);
SlimeWorldManager
contact the plugin developer
Did something change in 19.4
Regarding player display name?
As in, nametags?
I'm doing player.setDisplayName(name) and I can see my own new name
But other players don't see it
Got another plugin?
dead discord
what version are you using?
Then find an alternate or make your own
@small current what version is your project?
1.19.4 spigot api
aswm latest
the last slimeworldmanager commit was in 2020
ASWM
anyone know why when I am compiling my plugin IntelliJ sometimes fails to delete target and so I have to do it manually
Run it again
Hello I have a question. They exist a plugin that execute bungee command with a gui? Pls
Stop
Ok
putting it in every channel
Olivo
Do you know of any changes in display name in 19.4?
I can see my own nickname I set using player.setDisplayName but others can't. they just see default name
????
That wasn't for you
Ok
hm no
I added a new dependency, could that have anything to do with it?
No idea. Happens to me at times too. Somethings probably trying to use the file or it's windows being funny
That dependency requires Java 16
I am big confused
client?
Then your shade plugin is outdated
how can I update it?
Change the version in the pom
just use a bitshift
yeah
where can I know what the latest version is?
The maven website
It's not feather either
tag to see.
Feather
I'm literally loading up vanilla
It's not feather either
it seems to have worked but now I have this
It tells you what to do
oh right, theres a link
Could it have something to do with offline mode?
Are displaynames handled differently?
Maybe by a plugin like authme to prevent stuff?
Offline mode 💀
Yeah I know
Offline mode 💀
As someone who has 5 accounts it's annoying
Offline mode 💀
what exactly are you trying to change with setDisplayName ?
I am surprised setDisplayName does anything beyond change changes to the nema
It doesn't
I figured it out
It's something with auth
While the player isn't logged in
You can see
As soon as you log in, the display name is reverted
makes more sense then yes
Offline mode + auth things
average offline mode problem
Indeed
how do i use completablefutures?
I have seen that shet in luckperms
They are used to obtain a result at some point in the future
And then run a callback when the result is ready
@orchid trout
Depends on the use case scenario
It' s usually like
Oml that is advenced
CompleteableFuture.supplyAsync.thenAccept
For example this is my CachingDatabase Interface
FancyFuture is my CompletableFuture wrapper that does some funky changes
this is the void generic type
worth mentioning the term null can be expressed in terms of Void sometimes
Generic types?
You know when you create a string list
it's a List<String>
String is the generic type here
How are you java devs not losing your head over all the crazy stuff
I use generic types quite often
anyone here have experience with AnvilGUI? (the package)
https://github.com/WesJD/AnvilGUI
this thing
Hey!
When I call a static method from another class in the OnDisable() method, I get a NoClassDefFound error in console.
public void onDisable() {
InventoryMGR.restoreAllInventories();
}```
Does someone know a solution or had the same problem? Thanks!
theres no third item for me to click on and complete the action even tho I set it in the code
public static void openStoreAmountInput(Player player, ItemStack item, Inventory inv, String type) {
new AnvilGUI.Builder()
.onComplete((completion) -> {
if ((!completion.getText().isEmpty()) && completion.getText().matches("[0-9]+")) {
if (type.equalsIgnoreCase("buy")) {
buyItem(player, item, inv, Integer.parseInt(completion.getText()));
} else if (type.equalsIgnoreCase("sell")) {
sellItem(player, item, inv, Integer.parseInt(completion.getText()));
} else {
player.sendMessage(plugin.lang.getString("something-went-wrong")
.replace("&", "§")
);
}
return Collections.singletonList(AnvilGUI.ResponseAction.close());
} else {
player.sendMessage(plugin.lang.getString("invalid-amount")
.replace("&", "§")
);
return Collections.singletonList(AnvilGUI.ResponseAction.close());
}
})
.title("Enter an amount")
.text("Enter amount here")
.itemLeft(new ItemStack(Material.ENCHANTED_BOOK))
.itemRight(new ItemStack(Material.ENCHANTED_BOOK))
.itemOutput(new ItemStack(Material.ENCHANTED_BOOK))
.plugin(plugin)
.open(player);
}
hello, I bought a plugin, who do I need to write to in order to receive the plugin?
fixed (I removed #itemLeft, #itemRight and #itemOutput)
You'll be given access automatically once your payment is validated
Can anyone help me with SWM or ASWM?
I paid the money but I didn't get access
once your payment is validated
Can anyone help me with world cloning in SWM?
how do i delete one of my spigot resources
Report it and request deletion
yes
ok
How can I find the nearest biome of a type
https://paste.md-5.net/irisowobud.java
Sometimes it does start, sometimes it has way too many start iterations, yet I don't know why
any ideas?
Line 274; #onJoin
why is it all in a single class
dunno in what to split them
I prob. found the cause
https://paste.md-5.net/folefagoce.coffeescript
This for some reason won't execute sometimes
it will sout "starting", but won't log that message via Logger afterwards
Any ideas why?
my npcs are having epileptic shocks and sometimes their body rotates like a helicopter anyone know how to fix it? I want to make them look at the nearest player
https://paste.md-5.net/coyiqutabi.cs
some things I'm seeing at a glance
invert your atan2 args for yaw
I'd create a dedicated runnable class for the look logic to not clutter your npc management class so much
Does somebody know something? It kinda was swept away by the other messages :)
umm is InventoryMGR dependency? if so, is it loaded when you disable?
otherwise no clue
error.printStackTrace();
return new ErrorData();
});``` what is errordata men
can i just replace with null
error.printstacktrace(); is handling it right?
https://paste.md-5.net/kuvuxepuwe.php
Why after x iterations of this code, the first log doesn't log?
it just souts the stuff, but doesn't log that [START] [0]
What you return from that function will be result of that future if it fails
but it its exception then doesnt it mean it fail already
?
It doesn't have to fail
But if it fail
Result be provided by exceptionally function
i dont understand
If error occurrs, the exceptionally function (content of it) will be executed and the return is what the function of yours returns
i know
u said u don't understand
do i have to return anything
u can return null, but handle that null in the places u use that method
If you don't want to use return from exceptionally, why even use it? I mean you can always just return null yes
my npc is weirdly rotating. He is flicking or something i dont know how to describe it. Also his head isnt turning towards a player can anyone help?
yes
record a vid
how to find out if the player has chosen the right item? I use PlayerItemHeldEvent, but when I pick up an item, nothing happens, and when I remove it, the code is executed.
but there is no getItem method.
I thought about doing this, but it didn't work out for me
here
sorry it took so long i got off track
put it here
It looks fine to me
ChatGPT can't code
Hello
you can't depend on chatgpt
in a matter of fact he helped me out alot
i also made a plugin out of chatgpt
google is a better solution 100% of the time currently
Y i guess
Z then
you used chatgpt and then asked for help for 20 hours straight in this discord. So obviously it's not able to do everything
like this 🔃
well the only thing missing was a line
so it helped
W
i got muted for a week
but im back
hopefully next time its a ban
?paste
nop
target.getInventory().setItem(3,event.getCurrentItem()); this line of code is returning null for some reason
it only works after switching from an item. and gives error
there is no such method
1.16.5
Google your question before asking it:
https://www.google.com/
Yes, the result is the same as in the video @quaint mantle
Works only in case of switching from the block. If the previous slot is empty, then it does not work
there is no errors now
easiest way to do this is to just
location.setDirection
and then grab yaw and pitch
i completely remade it
it sucked ahh
If only there was a class to describe a direction...
You should honestly just get the yaw of the player and clip the direction to the nearest 45°
Saves you around 100 lines of code
@ocean hollow Not tested, generated by BLOOM 560m
private Direction getDirection(Location player) {
if (player == null || player.equals(null)) {
return Direction.NEGATIVE;
} else {
Direction dir = Direction.fromDegrees(Math.toRadians((float) player.getY()));
dir.normalize();
for (int i = 0; i < 4; i++) {
dir.set(i, dir.get(i).negate());
}
return dir;
}
}
Try getting an idea from this, it's completely fucked
"player == null || player.equals(null)"
😄
future.exceptionally(error -> {
if (error!= null) {
throw new RuntimeException(error);
}
}));
}
}
Well yes
the intelligence of the version I am running is peanut
(It's already fuckin impressive that 0.15% of the entire model can do this lmao)
Oh didnt read that it was generated
lol
generated too*
Returns the direction of the armor standing.
he's just standing there, menacingly
https://hub.spigotmc.org/jira/browse/SPIGOT-214 is there a specific reason this jira issue hasn't been touched in so long lol
can you get a subsection of a worldedit/fawe schematic?
I wonder if this is a good idea, I want to at some point in the future make it so mobs can dig through the floor to get to you in cases where the mob is unable to get into your base for a different plugin, would it be a good idea for performance reasons to simplify the logic so that all mobs share the same routes if they determine something is inaccessible and cap the amount of routes to something like 2 routes per cardinal direction on a slow update speed?
yes
how would I do that?
with code?
easiest would be to just iterate through coordinates and get what is there
i have a Clipboard object
might also be possible to use a mask for it but I have yet to look into masks too much
and i want to make a new Clipboard starting from xyz to x1y1z1
just iterate through a for loop and get your points
you can get the blocks at the internal coordinates of a schematic
We have someone working on this literally as we speak
that seems quite inefficient, since i need to get a section of the schematic to generate chunks
But usually the reason why JIRA issues don't get touched for a while is because nobody PRs
let choco cook, it's only been 8 years
I'm just looking through jira rn lol
actually I heard that choco is working on minecraft 2 as well
when is that coming out bud
let's say i were to do that, how would I then make those blocks into a Clipboard?
no clue I've never created schematics via clipboard but I'm sure that's documented in their documentation
or via api I mean
I only read them
ah i see
thanks
i'll do some testing
also i can just run the cutting and reconstruction of the schematic async so no big deal
how do i open an inventory from the click of a itemstack in another inventory as just closing and opening dont work?
Delay it one tick
ty
ffs gradle multi-module never works
So I created a custom item with a shaped recipe and was wondering how I can give it a custom texture, because in reality its just a wooden sword thats unbreakable and that has a damage modifier
First time using gradle, that .jar is the plugin?
well it worked
it is the plugin
lol
build/libs
I'm trying to find an item in a player's inventory with .getItemMeta() and cast it to Damageable, but am getting a ClassCastException exception because "CraftMetaItem" can't be cast to Damageable. Shouldn't .getItemMeta() return a copy of ItemData, not CraftMetaItem?
edited class names
Make sure you have the right damageable import
Thank you, second set of eyes is all it takes 🙏
Ight so I made a resource pack and all that but now it's just straight up not working even though I set the whole model id and all that in the json file and code anyone know what may be happening?
update: got multi-module projects to work
this is wack
Or what I should look for to possibly fix it
Model ids are for CustomModelData
damage is something else iirc
just look at the vanilla resource pack
how can i modify a entity inside of a command
No like I have a weapon that is crafted using a a netherite sword and two nether stars but I want to apply a texture to it
Because right now it just has the wooden sword texture
So I made a resource pack
- get the entity
- modify it
you either:
- have multiple classes extending JavaPlugin
- are creating a new instance of your plugin
spawnEntity spawns a new entity
spawnEntity returns an entity
you cast it to whatever and then apply metadata
Creeper#setPowered
etc
Already told you the problem
why dont you make a second class for your events
bro
line 162
line 19
they both extend JavaPlugin
like he told you not to do
bro
do you know java
im not an expert or anything
but i can understand you arent listining
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
It's always one thing here, one thing there



