#help-development
1 messages · Page 1433 of 1
oh ok lemme try
awaitng confermation
why is Inventory#getItem annotated NotNull but returns null using EquipmentSlot.HEAD and they dont have a helmet
🥲
how do i replace a modifier for an item? like if an item has a new attribute modifier how do i change it instead of adding a new one?
alright let's get back @ivory sleet so i need to create a pool?
because mistakes happen, open a bug report
Yea chili
do i need to create a new class or do i just need to make a new public void?
didnt mean to put it that way, was just inquiring about it 😄
you have to remove it and add it, they're immutable
will open report in a moment after eating
bukkit is incredibly inconsistent with its nulls and air itemstacks around inventories
best to always check for both air and null
even the nullability annotions are wrong here and there
wrong annotations dont get fixed if no one reports them
i don't report things
we aint snitches
snitches get stitches
aha i created a lag plugin
well then stop constantly moaning about them
@EventHandler
public void InvClose(InventoryCloseEvent event) {
if(event.getInventory().getTitle().equalsIgnoreCase("§7[ §bHerobrine Crate §7]")){
Inventory inv = event.getInventory();
Player player = (Player) event.getPlayer();
new BukkitRunnable(){
public void run(){
player.getPlayer().openInventory(inv);
}
}.runTaskTimer(this, 0, 1);
}
}
how to do it better lol
i refuse
cuz if i dont do the every 1 tick it kinda just closes and waits a long time and opens again
also moaning seems very sexually charged
wat
idk either
if its being delayed your server is probably lagging
its a crates plugin
server/plugin
and it opens the inv at the end of the roll
which indicates i probably did something
they call it spigot for a reason
this is the whole skript
eventhandlers in bottom
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
idk why it so gay
surely the delay is coming from the delay you added in the runnable
well i did it without the runnable
and that was with the longest delay
with runnable its just a lag machine
whole skript huh
skript?
its all of it yeah
i didnt want to get more problems with init and all that registering events from other classes
but like
how would you do it
No you have to do smtng like this:
class Conclure extends JavaPlugin {
Jedis redis;
JedisPool redisPool;
void onEnable() {
redisPool = new JedisPool(new JedisPoolConfig(),"localhost"); // ofc change this
redis = jedisPool.getResource();
redis.subscribe(new RedisListener(),"channel");
}
void onDisable() {
redis.close():
}
}
class RedisListener extends JedisPubSub {
//override methods
}``` iirc
whats the best way to code something? like what makes a clean code, clean
first it has to be code
SOLID is a good start
i always feel like no matter what i try, i end up with shitty code
Then avoid anti patterns
what the hell it got to do with maven
Oh
is still java mof*** xd
Thought u were still on that
Ofc u can’t
and i cant just open event.getinventory either
yea but like whats an example of really clean code
cuz that makes a weird ass fricking delay
It’s hard Lucas
yea ig
yea you can
Some argue for that LuckPerms is clean I would say it still contains snippets of some anti patterns like abstraction inversion and arguably leaky abstraction maybe.
Uh
Then it definitively overused interfaces
no u cant
the close inv event
But yeah interfaces are generally clean as it’s a very good way to decouple code but sometimes you want cohesive code and more trivial navigable code in which cohesion will help with that
how long is the delay
like until the timer made that is random is over
Random r = new Random();
double seconds = 7.0 + (12.0 - 7.0) * r.nextDouble();
the timer for the crate is random there
whenever it runs out it opens the inventory for a split second and does the player.close inventory its meant to in the end
What does a # mean in help forums?
Example: (Player)#getLocation();
.
Update to this: Cache must have been messed up, cuz I deleted it and it works now lol
Player#getLocation or Player::getLocation would mean an instance method
that is, you call the method on a variable/field/return value of type Player
rather than on the Player class directly
you can't open an inventory in the inventory close event
then how am i supposed to stop the player from closing it until it does it automatically
how
with the bukkit scheduler
example?
Bukkit.getScheduler().runTask(plugin, () -> { die })
where do i put that
you put it where you want to schedule the task
what about it are you stuck on
what to put in as args
your plugin and the task to run
man that makes no sense
i did that
extend and instantiate a Runnable and pass it as the second argument
its the 2nd argument that makes no sense
that's a lambda
which is just a fast way of implementing an interface with 1 method
ur confusing me alot here lol
new BukkitRunnable(){
public void run(){
ItemStack item = inv.getItem(13);
player.getInventory().addItem(item);
player.updateInventory();
player.closeInventory();
cancel();
}
}Bukkit.getScheduler().runTaskLater(CratesMain.getPlugin(), );
cancel();
Bukkit.getScheduler().runTask(plugin, new Runnable() {
@Override public void run() { die }
})
does functionally the same thing
oh
new Runnable() instantiates a new Runnable
the { then extends Runnable
and implements the run method from it
this is an anonymous local class
well it says error at die
yes, the main class is not an instance of the main class
replace that with what you want to run
our implementation of Runnable represents what we want to run as a task
our implementation of the run method contains the code that runs
if (delay >= .5){
done = true;
Bukkit.getScheduler().runTask(new CratesMain(), new BukkitRunnable() {
@Override public void run() { public void run(){
ItemStack item = inv.getItem(13);
player.getInventory().addItem(item);
player.updateInventory();
player.closeInventory();
cancel(); }
})
like that
i feel like its not like that
put it in the event
the place to change the plugin version is in build.grade, right?
depends
like in in the event
or on the other side of }
dependencies {
compileOnly 'org.spigotmc:spigot-api:1.8.8-R0.1-SNAPSHOT'
}
im not sure in gradle, since i used to use maven
You need to declare the repos also
But yeah
https://www.spigotmc.org/wiki/build-you-spigot-plugin-with-gradle-groovy/ Idk use this as reference maybe
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
omfg
this shit
aint
wanna work
@EventHandler
public void InvClose(InventoryCloseEvent event) {
if(event.getInventory().getTitle().equalsIgnoreCase("§7[ §bHerobrine Crate §7]")){
Inventory inv = event.getInventory();
Player player = (Player) event.getPlayer();
Bukkit.getScheduler().runTask(new CratesMain(), new BukkitRunnable() {
@Override public void run() { public void run();{
ItemStack item = inv.getItem(13);
Player player;
player.getInventory().addItem(item);
player.updateInventory();
player.closeInventory();
cancel(); }
}
}
}
gay
what are you even trying to do
trying to stop a player from leaving the crates gui while its spinning
then why are you telling the player to close their inventory
idk u said to put the task in
i told you to reopen the inventory after a 1 tick delay
you can not open an inventory in the inventory close event
you need to wait 1 tick before you open it again
and don't construct a new instance of your main class
obtain the existing instance
only one instance of your main class must exist, and it must be constructed by bukkit
i feel like i'm repeating myself
yes but you are instantiating your main class
k(new CratesMain(), n
you are creating a new instance of your main class
you are calling the constructor of your main class to create a new plugin object
don't do that
there must only ever be one
Check for inventory close event and then open your inv if the name is the name of the inv
huh
you told me to wait 1 tick xd
And you use the scheduler in a runnable
in the event handler
Bukkit.getScheduler().runTask(plugin, new Runnable() {
@Override public void run() { die }
})
replace die with code that reopens the inventory
the die shit will run 1 tick later
public void InvClose(InventoryCloseEvent event) {
if(event.getInventory().getTitle().equalsIgnoreCase("§7[ §bHerobrine Crate §7]")){
Inventory inv = event.getInventory();
Player player = (Player) event.getPlayer();
wait(1, 2);
Bukkit.getScheduler().runTask(new CratesMain(), new BukkitRunnable() {
@Override public void run() { player.openInventory(inv); }
})
}
}
oh
remove wait
yes
you are now scheduling a task to run 1 tick in the future
and that task reopens the inventory
public void InvClose(InventoryCloseEvent event) {
if(event.getInventory().getTitle().equalsIgnoreCase("§7[ §bHerobrine Crate §7]")){
Inventory inv = event.getInventory();
Player player = (Player) event.getPlayer();
Bukkit.getScheduler().runTask(new CratesMain(), new BukkitRunnable() {
@Override public void run() { player.openInventory(inv); }
};
}
}
```?
like that
invert your if condition
and instead of continuing, return
instead of
if (condition) {
// stuff
}
do
if (!condition) return;
// stuff
ye
@EventHandler
public void InvClose(InventoryCloseEvent event) {
if(event.getInventory().getTitle().equalsIgnoreCase("§7[ §bHerobrine Crate §7]")){
Inventory inv = event.getInventory();
Player player = (Player) event.getPlayer();
Bukkit.getScheduler().runTask(new CratesMain(), new BukkitRunnable() {
@Override public void run() { player.openInventory(inv); }
}) return;
}else if (!(event.getInventory().getTitle().equalsIgnoreCase("§7[ §bHerobrine Crate §7]"))){
return;
}
}
at least you tried
lol
for example this
if(event.getInventory().getTitle().equalsIgnoreCase("§7[ §bHerobrine Crate §7]")){
//stuff
}
make it this
if(!event.getInventory().getTitle().equalsIgnoreCase("§7[ §bHerobrine Crate §7]")) return;
public void InvClose(InventoryCloseEvent event) {
if (!event.getInventory().getTitle().equalsIgnoreCase("§7[ §bHerobrine Crate §7]")) return;
Inventory inv = event.getInventory();
Player player = (Player) event.getPlayer();
Bukkit.getScheduler().runTask(new CratesMain(), new BukkitRunnable() {
@Override public void run() { player.openInventory(inv); }
})
}
much more readable
its this
/D:/cratesWorld/src/main/java/me/barry/CratesMain.java: D:\cratesWorld\src\main\java\me\barry\CratesMain.java uses or overrides a deprecated API.
vs this
worry or not?
change the BukkitRunnable to Runnable
you're not supposed to use BukkitRunnables like that, and the method to schedule them like that is hence deprecated
and that is why you are getting the warning
then how am i supposed to do it
you obtain your main class instance
and use it
instead of making a new one
i explained how earlier today
you make a constructor
you add your main class as a parameter
you make a field
you put the parameter in the field
no it was like 8 hours ago
exactly
@wraith rapids do people still static abuse their main class LMFAO HAHAHA
they are abusing it
when people ask how to do it it's pretty much 50/50 DI and static getters
by 8 hours ago do u mean literally
I ALWAYS use DI and I see people using getters and it looks so bad
yes ofc lmfao
you should know how many messages you fricking send
I send MILLIONS
i don't keep a tally
I do
i probably have like 2000 deleted messages on paper
ive sent ~5000
that is the assignment yes
did i find it
bruh
probably
so is that the line
you need more than 1 line
you need
- a field to hold the main class instance in
- a constructor to get the main class instance with
- an assignment to take the parameter from the constructor and put it in the field
but why would i need this if im literally in the main class
private MyMainClass myMainClass;
private Main plugin;
public Class(Main plugin) {
this.plugin = plugin;
}
oh ye what u said thing ye
or is the listener in the main class
then use this
thats so ugly
ok
BRUH
i don't even have the effort to start an oop rant and what this means
@EventHandler
public void InvClose(InventoryCloseEvent event) {
if (!event.getInventory().getTitle().equalsIgnoreCase("§7[ §bHerobrine Crate §7]")) return;
Inventory inv = event.getInventory();
Player player = (Player) event.getPlayer();
Bukkit.getScheduler().runTask(this, new Runnable() {
@Override public void run() { player.openInventory(inv); }
});
}
I know why you need to do seperate
But its 1:20 am for me and i just want the function in it self to work
why
what a disgusting creature
it looks like a mouldering raisin that grew a pair of teeth
yeah
ok so it cancels the close
but it also cancels the automatic close lol
and i cant close the gui now
zoi's pfp looks more like a strange mix between a sloth + a bat
you'll have to implement exemption logic for it
I love my pfp its so cute
and lazy
and cool
idk add a boolean and set it to true and check it or whatever
This is my actual logo but I dont really use it much apart from some stuff
did you know there's a version of me without the santa hat
lets say i already have a boolean named done in the gui, how do i get that boolean and use it in the event
sadly it can't send messages in this channel for some reason
you get the boolean
which is weird because I have no roles on either account
i'm self verified
it needs to be outside the method
it needs to be a field, not a variable
fields are accessible throughout the entire object
variables are only accessible in the method they were declared in
ya
static fields are accessible across any objects of a class and the class itself
@EventHandler
public void InvClose(InventoryCloseEvent event) {
if (!event.getInventory().getTitle().equalsIgnoreCase("§7[ §bHerobrine Crate §7]")) return;
Inventory inv = event.getInventory();
Player player = (Player) event.getPlayer();
if (done == true){ return;}
Bukkit.getScheduler().runTask(this, new Runnable() {
@Override public void run() { player.openInventory(inv); }
});
}
like dat
done == true is equivalent to just done
it's already a boolean, you don't need to compare it with anything
if (done == true){ return; } you dont need the brackets
if (done) return;
I made this plugin.yml file with
main: me.Towster.ZombieApocolypse.Main
name: ZombieApocolypse
version: 1.0
author: Towster
api-version: 1.16
commands:
GodBoots:```
It sais that this is an invalid plugin.yml file but I can't seem to find what is wrong with it
^
what is the exact error message
yes, and if it is false, the if doesn't go through
a == b returns a boolean
it returns true if a is b
ya
false == true returns false
Could not load 'plugins/ZombieApocolypse.jar' in folder 'plugins'
org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml
check if the plugin yml is being compiled
send the entire error message
that is not the entire error message
you are cutting off 90% of it
^
yeah i get it, its like skript where it just checks if a variable is set
show your plugin.yml
no it doesn't
most likely formatting issue
they did
== compares two values
here
it returns true if the value on the left is the value on the right
ah gotcha
Could not load 'plugins/ZombieApocolypse.jar' in folder 'plugins'
org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml
at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:162) ~[patched_1.16.5.jar:git-Paper-465]
at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:148) ~[patched_1.16.5.jar:git-Paper-465]
at org.bukkit.craftbukkit.v1_16_R3.CraftServer.loadPlugins(CraftServer.java:388) ~[patched_1.16.5.jar:git-Paper-465]
at org.bukkit.craftbukkit.v1_16_R3.CraftServer.reload(CraftServer.java:942) ~[patched_1.16.5.jar:git-Paper-465]
at org.bukkit.Bukkit.reload(Bukkit.java:708) ~[patched_1.16.5.jar:git-Paper-465]
at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:54) ~[patched_1.16.5.jar:git-Paper-465]
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:159) ~[patched_1.16.5.jar:git-Paper-465]
at org.bukkit.craftbukkit.v1_16_R3.CraftServer.dispatchCommand(CraftServer.java:806) ~[patched_1.16.5.jar:git-Paper-465]
at org.bukkit.craftbukkit.v1_16_R3.CraftServer.dispatchServerCommand(CraftServer.java:768) ~[patched_1.16.5.jar:git-Paper-465]
at net.minecraft.server.v1_16_R3.DedicatedServer.handleCommandQueue(DedicatedServer.java:411) ~[patched_1.16.5.jar:git-Paper-465]
at net.minecraft.server.v1_16_R3.DedicatedServer.b(DedicatedServer.java:378) ~[patched_1.16.5.jar:git-Paper-465]
at net.minecraft.server.v1_16_R3.MinecraftServer.a(MinecraftServer.java:1209) ~[patched_1.16.5.jar:git-Paper-465]
at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:997) ~[patched_1.16.5.jar:git-Paper-465]
at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$a$0(MinecraftServer.java:174) ~[patched_1.16.5.jar:git-Paper-465]
at java.lang.Thread.run(Thread.java:832) [?:?]
Caused by: java.io.FileNotFoundException: Jar does not contain plugin.yml
... 15 more
bruh
not being compiled with it
ye you have to add it manually
with winrar
yup
bruh patched_1.16.5.jar:git-Paper-465
this happened to me before
a few builds out of date lmao
thx and sorry
so now I have to add it manually every time
are you using maven to compile Towster?
no just the InteliJ java Artifacts
if(done == true)
use maven
Java Dependancies i think?
oh wouldn't have a lcue how to add it with that
if (done != false)
got it
done == true returns true so might aswell just put if(done)
i would recommend use maven
oh no
gradle ftw
ant

yes
no
it doesnt work
fucking yagpdb lmfao
you're doing it wrong
haha cant type yes 
well yeah
anyways, yes gradle
no maven
yes gradle
madle/graven are very nice
btw anyone got a protocollib decent vids? bout to dive into armorstands
ant
maven
gradle OR maven
ant
maven ftw
lmao
javac + 7z
maven not grandle
No
maven
when i was first learning i found there are close to no in-depth resources for protocol lib
maven or noob
i'm sure redempt has some dependency manager that uses a .txt file
ur noob
Gradle >> maven
javac > maven
cause gradle requires a higher skillcap than maven sorry to break it
maven >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> grandle
gradle > maven, maven is easier to use however
He has everything but with text files for sure
lmfao no
conclure can you halp me convert
men
lol
Not true
- how do i set done to false
Gradle is as easy as maven
done = false
^
debatable
it aint work
grandle is a maven fork
conclure halp me
gradle
Ye pulse
did you declare it as a field
lol
"grandle" lol
im bad
someone enabled slowmode lol
how?
yep seems like it
grandle is a maven fork
maven vs gradle is too hot for this discord
no it isnt?
yes it is
happy to help if you need though
I was told it is and noone would lie to me
lol what
What
lol i need proof
gradle is nothing like maven
some guy sold me Gradle was a mavenfork
Gradle is nowhere fucking a maven fork lmao
That doesn’t make maven better than gradle like what’s ur point ma guy
I might be wrong because it looked like a new player but idk
ZoiBox you gotta rethink your brain
i mean they couldve forked it, deleted all the source and written their own
bruh
how to set as field
tell that to the guy who told me this information
bro you didnt even make sure it was factual smh
gradle doesnt even use xml lmao
Exactly lol
Zoi still what does that have to do with gradle being worse than maven
maven
tho it does have backwards compatibility with pom.xml files because people are lazy
It’s literally irrelevant
so you take anything you hear to be fact? lol
because it uses maven, the better compiler
Wat
Ok this person is trolling Conclure lmao
ok it doesent
What have I done
He’s almost worse than the helpchat kotlin karens
but this guy in an ally way told me it does
private static boolean DONE = false;
@wraith rapids ?
he isnt almost. He is guarnateed
the guy in the dark ally way told me it uses maven and now I know its wrong
but still maven is better imo
maybe you were that guy
ive been using it for years
Anyways conclusion gradle > maven
why would you name your variables in full caps
cause you never ever used gradle i am guess
I defo wasn't lmfao it was some guy who I had this same argument with
stop, please lmfao
and yes, gradle > maven
only final variables need to be uppercase
naming convention for static fields
oh wait nvm final too
it is? never knew
oops i forgot about it having to be final too
BUT for me maven is better cause ive been using it for years
can someone redirect me to a site that tells me how to add plugin.yml manually so I don't have to be in this consversation atm
Whadafuck
I know it
graven
it works for me why would I change
so you're saying experience is the reason why you are saying its better 💀
Fair enough it works
i mean to be fair, gradle is faster but use whatever youre more comfy with
omfg this shit
But my point isn’t whether it works or not
how do i make a boolean a field
ALSO ALSO ALSO git clone and then just mvn clean install
easy no othjer stuff
how do i access a boolean in multiple places
so because it's easier for oyu means it's better?
no need to open anything you just clone and compile
severe doubt this kid even is good at maven. If he is arguing maven is better then I don't know what to say. You know that I used maven in my library and gradle in other projects, and still admit that maven is still worse in many ways.
same with gradle lol
Hello?
In fact, gradle is signficiantly faster in buildtime
and many other changes
which saves a shit load of time for big projects
i tried to compile Geyser once... 5 minutes compile time to end up erroring out anyways
imagine coding luckperms and building it with maven tho
for what I use it for, depends and compiling (I dont need it for anything else) it works perfectly for me
Geyser uses maven with in-xml java reflection for some reason
ok sure. But that doesn't mean you can go around spamming maven > gradle when you haven't even used gradle to an extent that allows you to recognize its usefulness..
like, their pom.xml litterally has a CDATA block in it with org.reflections code lmao
boolean boolField = MethodHandles.lookup().unreflectConstructor(Boolean.class.getConstructor(boolean.class).newInstance(true));
after all, idk what stuff you bring up to this discord lately lol
I know that but someone said something regarding it so I gave my opinion and now it has turned into this
and no I havent properly used Gradle
doesent mean I havent tried and had many issues with it
yall send stuff that i got no clue where to put or what to do with
Gradle
its because you dont use it correctly then
It’s like saying brainfuck is better than java because you haven’t used java
anyways, steam let me play my game ffs
I know that its just I cba changing if it means ima have issues may as well stick with what I know especially if it works exactly for what I need it for
then wtf is your point that you brought up the first place??????
Don’t go around naively saying gradle is worse then pal
in IntelliJ, im trying to create a new item, and im trying to keep it compatible with 1.8, so the autofill in IntelliJ, when im choosing a material, which version does it autofill with, im trying to get firecharge and it autofills with FIRE_CHARGE
you brought up the point, and said now that "it's an opinion"
after you dont back it up
ok thanks steam lmao
Barry sry
life is spain without the s
I confess I trolled you but what’s the problem
I'm not going around saying maven is better because I understand Gradle is faster but if someone asks then I'll say I use maven
Sure I totally respect that
since when was borrowing games a thing?
i love how gradle vs maven instantly triggers slowmode
ikr lmfao
since forever?
🥲
like, its just steam library/family share lmao
oh
thought it was like at the movies you borrow them out of the machines
is that still a thing?
...
like this
the borrow button is what shows up when you open the page for a game thats installed on your system but dont own, and the owner didnt enable library share
only issue is uh
where can i get the javadocs on spigot for different versions
you cant
nonexistant steam account lol
lol
i want the material list for 1.8
i mean its litterally the anonymous steam login
ik helpchat has some copies i think
got u
click your version
sheesh thanks 👍
lol steam anonymous login breaks so many things
Lol
thats cool
what about 1.3 😦 noone cares about my 1.3 server
:<
🥲
man
this shit aint wanna work
@EventHandler
public void InvClose(InventoryCloseEvent event) {
if (!event.getInventory().getTitle().equalsIgnoreCase("§7[ §bHerobrine Crate §7]")) return;
Inventory inv = event.getInventory();
Player player = (Player) event.getPlayer();
if (doneroll =MethodHandles.lookup().unreflectConstructor(Boolean.class.getConstructor(boolean.class).newInstance(true));) {return;}
Bukkit.getScheduler().runTask(this, new Runnable() {
@Override public void run() { player.openInventory(inv); }
});
}
https://helpch.at/docs/1.8.8/ im not seeing the entire material list? i might be blind ngl
search it up
its the full javadocs
go to the searchbar and search up "Material"
Or actually do this:
Press ctrl F or command F for the find keyword
then search for "Material"
then find the class under "All Classes"
these are one of the javadocs that have it so all the content is on one page
how do i make a boolean accessable in 2 events
🥲
ikrlmfao
still easy
not for me
this is the most basic thing you could possibly know
for me youre throwing around random words
move the field outside the method
i fricking did
bruh
better not use inventory name to find your inventory ever again bro
ur obv doing smth wrong
ikr use inv.getTitle
field is variable
couple things here btw:
- Do NOT compare Inventory titles. Instead, use
InventoryView - Use
ChatColorbecause it supports multiple versions instead of the weird§symbol. - Don't cast
Playerto event.getPlayer(). Always check. In this case, it returns aHumanEntityand you gotta go check. -
if (doneroll =MethodHandles.lookup().unreflectConstructor(Boolean.class.getConstructor(boolean.class).newInstance(true));) {return;}
wtf is this? You know what the dude said was a joke right.. lmao.
5) ```java
Bukkit.getScheduler().runTask(this, new Runnable() {
@Override public void run() { player.openInventory(inv); }
});
new Runnable() {
@Override public void run() { player.openInventory(inv); }
});
can be simplified to
() -> player.openInventory(inv);
() -> player.openInventory(inv);
was buggy as hell so no
it does the exact same thing
remove the semicolon then
you have to listen to us and trust us
we've been doing this for ages already
with the ->?
the runnable extension is just easier to understand so I showed it instead of the lambda
Makes sense
do whatever
clearly not
no
look up a java beginner guide and come back tomorrow
you'll save everyone's time and nerves
- tomorrow is school
- its 2 am, ive wasted my time if i dont just get this shit done
at this rate you'll just waste even more of your time
come back tomorrow after school
sorry
But you're just gonna feel more tired, more struggle, and more suffering with not knowing how to do stuff
have the patience
to learn
you know it will be much much better and feel much better
everyone says learn java omg learn java
after you are done learning
how the fuck am i going to learn it
google a tutorial
we are not a walking java tutorial
jetbrains tutorials
well its all a bunch of text
its not always a bunch of text
like do you mean making a calculator and shit
if you have a problem with or a question about the tutorial or guide, you can ask that here
to learn the material better and get a hands on experience
but we do not want to fucking write a java tutorial for you
not what im asking
do you understand how many people come here every day
what im asking is, whats the visual output of java, if its not minecraft plugins
Cap
stfu
man protocollib its so under documented i might as well go back to using nms for packets lol
😇
you run them in a console window usually
basically just text
you just need to learn the absolute basics with that
how the frick is that gonna teach me shit
stuff like fields, methods, constructors
in a console
most of it will be you writing shit
less than 5% will be looking at it run
what runs isn't relevant in the beginning
it's what you write
its not even a console like 50% of the time
he just said 5?
barry do you know how to sysout a line with a line separator?
tell us
no searching allowed
and also one line sysout only
wat
yeah i see it sometimes
idk
i want you to print
hello
world
i guess + newLine + "extra line"
using one system.println statement
yes how do you do newLine
just getting some basic shit down you know
No.. what is "newLine"
ohh
String newLine = System.getProperty("line.seperator");
this u mean
thats about all java i know
aswell as camelcase
Hm, okay
System.lineSeparator
Lol I learned it from u ngl
are there others of that
see the sidebar on the left
what?
there are more excercises on the sidebar on the left
click the topics to expand them
each of the topics also has a link to a tutorial
you should probably read the tutorial first
oh did someone reply to something
im at java data types
Yes nny
uh huh
i can see the message but I can't tell that it's a reply to something
why not
because I use ripcord, and ripcord doesn't support replies
You also make your ui look like a dying sun
i'm a pretty red guy
lmao?
im about to shit on protoocllib and go with nms
You know. I wish there was an entity wrapper
for packets
is there some utility class i could copy and paste
lmao
i'll have to look into replicating entity packets at some point
for the farm optimizer plugin i'll eventually write
reimplementing entities asynchronously will surely be interesting
ah ic
f dis ima get sleep 25/59
good
Is it possible to change how fast you "pull up" your item, or is the animation completely client sided?
basically change the rate of this animation https://i.demeng.dev/jCLDTOPiEb.gif
I pull up
its an attribute i think
do you know what the animation is called lol
no i dont
ive just been referring to it as "pull up" lmao
i think its attack speed
if you want to quickly change attributes
amogus
ok im so confused rn
lower attack speed = slower animation right
but if i put it -5 nothing happens at all, and 0.0000001 is like half a second
wut
Hi, I have a little question, do you guys still support Java 8? Or you dropped it? Cause I still build my plugins against it but I was wondering if I had to go on the new LTS (J11)
Unless something changed in the past month Spigot will remain on Java 8 for now
But it's recommended to go to Java 11
As its LTS
I have a listener class that auto smelts ores (when you mine iron ore, iron ingots are dropped instead), I also have a listener that you can mine a whole vein of an ore while sneaking. But when I try to sneak and mine it, it is only giving me the ore
Seems like Paper will go full Java 11 once 1.17 will be released
Yeah just let us read your mind, see your code through the internet without you posting it and give you honest and helpful constructive criticism on it.
Thats like trying to get a flu shoot over a zoom call
show us your code.
you can always build against j8 if you want, its just that newer version have more featuers
Use lists instead of sets
Sets cannot have repeating values
And I don't know what you are trying to do considering your utils aren't utils
Your util methods don't do anything... I presume you are trying to do it to get the set edited but to do that you would have to return the new set rather then just return void and use the output of that set (which as I said before something like a list would be better we sets cannot have duplicate values )
whoClicked.getInventory().remove(new ItemStack(Material.DIRT, 4));
why does this only remove 4 dirt if there's only 4 dirt, and not if there's 5 blah.
because you're referencing 4 dirt blocks and not 5?
You're looking for an itemstack that has 4 size, not removing 4 size
removeItem() iirc
There doesn’t seem to be a way to listen for creepers igniting on spigot, I wonder if there is a packet I could listen to
How do I check if a mob has spawned
any mob But I want to know what that mob is
use EntitySpawnEvent
got it thanks!
Guys, I'm doing a school project (That I will not physically do). I need to setup a big architecture for a network. I would like to use 2 ore more load balancer(Latancy algorithm) that redirect the traffic to other load balancer (based on player base). I think that I should use hardware load balancer but I wonder what software load balancer can I also use?
how can i start the version 1.16.5 faster?
how could I run multiple commands when a message is clicked with a TextComponent?
What do you mean?
Are you talking about the 20 second warning about not being on the latest version?
just make a third command that executes the other 2
That can be solved with:
-DIReallyKnowWhatIAmDoingISwear
In the batch file you use to launch the server
is this really the only way?
I don't think a textcomponent can have multiple commands
try adding multiple click events to one textcomponent and see if that works otherwise do the command thing
Found a super efficient way to free more memory:
while (true){
System.gc();
}```
may i ask if this is sarcasm?
😂
😛
may i ask if this is sarcasm
we truly do live in a world
World loading
So there is something really weird happening and i have no idea why. I have a method with code that teleports players to a location but im getting a null error when trying to set the world of the location. But this null error only happens the first time the method is called after reloading.
When i sysout the world it shows up fine and i split the method and it's showing that .setWorld(world); is null even though it's not
wow amazing
reloading is evil, perhaps your plugin is calling the world before its loaded in completely?
but i am in the world and im using player.getWorld() as world
How could I make a command run without any output?
what do you mean?
you don't
oh mybad I misred
just don't send them a message and always return true
so the end return false; would be return true; now?
return false sends output to the player with the correct syntaxes defined in plugin.yml
return true does nothing and makes the server believe the correct syntaxes has been used
@dusty heraldCan a world not be fully loaded even if your in that world?
I dont know but if you reload weird shit can happen
that's why many people advise against doing it
So should i just delay the teleport?
make sure the world isn't null
ok worked, thanks
When i sysout the world it gives me this CraftWorld{name=FlagWars-testmap-1}
but then i get a null error for setWorld(world);
World world = player.getWorld();
System.out.println(world);
spawn.
setWorld(world); //<- null here
player.teleport(spawn);```
maybe your spawn location is null
but why is the spawn line not null then?
Show me the full stack trace
at me.Kidalder.FlagWars.FlagWars.startGame(FlagWars.java:283) ~[?:?]
at me.Kidalder.FlagWars.Commands.FlagWarsCommand.onCommand(FlagWarsCommand.java:29) ~[?:?]
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[spigot-1.16.5.jar:3026-Spigot-79d53c2-d54b500]```
that is spigot
spawn.setWorld or setWorld()
i split it into to lines
ok, could I do this somehow with commands that exist or something?
So I have code that makes the player run some commands, is it possible to stop the output of them
i doubt it
though
its spawn. setworld(world);
debug your code
i did
check if world or spawn is null
neither one is null
print spawn
If the Location does not exist but a default value has been specified, this will return the default value. If the Location does not exist and no default value was specified, this will return null.```
Ok well it's null but the location exists in the config
how did you save this Location?
If the world isnt loaded at start it won't work IIRC
show us config
it's requested during the method and the player exists in the target world
can you send ur full code
and config please
round your coords 😢
Can't do that, this is the pure location from bukkit

