#help-development

1 messages · Page 1433 of 1

sullen marlin
#

remove the spaces

glass pond
#

oh ok lemme try

sharp bough
#

the link you sent me has such a clean code lmao

#

no more than 2 tabs anywhere

glass pond
#

awaitng confermation

upper vale
#

why is Inventory#getItem annotated NotNull but returns null using EquipmentSlot.HEAD and they dont have a helmet

ivory sleet
#

🥲

subtle vector
#

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?

muted idol
#

alright let's get back @ivory sleet so i need to create a pool?

sullen marlin
ivory sleet
#

Yea chili

muted idol
#

do i need to create a new class or do i just need to make a new public void?

upper vale
#

didnt mean to put it that way, was just inquiring about it 😄

sullen marlin
upper vale
#

will open report in a moment after eating

wraith rapids
#

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

sullen marlin
#

wrong annotations dont get fixed if no one reports them

wraith rapids
#

i don't report things

wispy fossil
#

we aint snitches

wraith rapids
#

snitches get stitches

fiery inlet
#

aha i created a lag plugin

sullen marlin
#

well then stop constantly moaning about them

fiery inlet
#
@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

wraith rapids
#

i refuse

fiery inlet
#

cuz if i dont do the every 1 tick it kinda just closes and waits a long time and opens again

wraith rapids
#

also moaning seems very sexually charged

fiery inlet
#

boys

#

how to help me

sharp bough
#

run a delayed aask

#

1 tick later

fiery inlet
#

wat

sullen marlin
#

I dont see why it would be delayed

#

either it works or it doesnt

fiery inlet
#

idk either

sullen marlin
#

if its being delayed your server is probably lagging

fiery inlet
#

its a crates plugin

sullen marlin
#

server/plugin

fiery inlet
#

and it opens the inv at the end of the roll

#

which indicates i probably did something

wispy fossil
fiery inlet
#

this is the whole skript

#

eventhandlers in bottom

#

idk why it so gay

sullen marlin
#

surely the delay is coming from the delay you added in the runnable

fiery inlet
#

well i did it without the runnable

#

and that was with the longest delay

#

with runnable its just a lag machine

wraith rapids
#

whole skript huh

fiery inlet
#

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

ivory sleet
# muted idol do i need to create a new class or do i just need to make a new public void?

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
fiery inlet
#

no one know how to fix me problem?

#

no

#

sad

sharp bough
#

whats the best way to code something? like what makes a clean code, clean

fiery inlet
#

first it has to be code

ivory sleet
#

SOLID is a good start

sharp bough
#

i always feel like no matter what i try, i end up with shitty code

ivory sleet
#

Then avoid anti patterns

fiery inlet
#

oh so yall can answer him

#

but my problem is impossible

#

out of this galaxy

ivory sleet
#

Remember java is fundamentally object oriented

#

Barry idk

#

I’m not a maven user

fiery inlet
#

what the hell it got to do with maven

ivory sleet
#

Oh

fiery inlet
#

is still java mof*** xd

ivory sleet
#

Thought u were still on that

fiery inlet
#

no xd

#

i cant cancel inventorycloseevent

ivory sleet
#

Ofc u can’t

fiery inlet
#

and i cant just open event.getinventory either

sharp bough
fiery inlet
#

cuz that makes a weird ass fricking delay

ivory sleet
#

It’s hard Lucas

sharp bough
#

yea ig

sharp bough
ivory sleet
#

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

fiery inlet
sharp bough
fiery inlet
#

u cant cancel that event

#

"uncancellable"

sharp bough
#

but i did it

#

for a plugin

#

let me find it

ivory sleet
#

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

wraith rapids
#

how long is the delay

fiery inlet
#

like until the timer made that is random is over

wraith rapids
#

what

#

give me meaningful words

#

a second?

#

10 seconds?

fiery inlet
#
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

stoic iris
#

What does a # mean in help forums?
Example: (Player)#getLocation();

fiery inlet
#

.

wraith rapids
#

instance method

#

Player.getLocation() would be a static method

civic adder
#

Update to this: Cache must have been messed up, cuz I deleted it and it works now lol

wraith rapids
#

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

fiery inlet
#

if u really want numbers

wraith rapids
#

you can't open an inventory in the inventory close event

fiery inlet
#

then how am i supposed to stop the player from closing it until it does it automatically

wraith rapids
#

you can delay it to happen 1 tick later

#

so it happens after the event is done

fiery inlet
#

how

wraith rapids
#

with the bukkit scheduler

fiery inlet
#

example?

wraith rapids
#

Bukkit.getScheduler().runTask(plugin, () -> { die })

fiery inlet
#

where do i put that

wraith rapids
#

you put it where you want to schedule the task

fiery inlet
#

so in the event

#

ok i found out, at the end of }

#

ok i dont know lol

#

papi help

drowsy helm
#

what about it are you stuck on

fiery inlet
#

what to put in as args

wraith rapids
#

your plugin and the task to run

fiery inlet
#

man that makes no sense

wraith rapids
#

your main class instance represents your plugin

#

pass it as the first argument

fiery inlet
#

i did that

wraith rapids
#

extend and instantiate a Runnable and pass it as the second argument

fiery inlet
#

its the 2nd argument that makes no sense

wraith rapids
#

that's a lambda

#

which is just a fast way of implementing an interface with 1 method

fiery inlet
#

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();
wraith rapids
#
Bukkit.getScheduler().runTask(plugin, new Runnable() {
    @Override public void run() { die }
})

does functionally the same thing

fiery inlet
#

oh

wraith rapids
#

new Runnable() instantiates a new Runnable

#

the { then extends Runnable

#

and implements the run method from it

#

this is an anonymous local class

fiery inlet
#

well it says error at die

wraith rapids
#

yes

#

die isn't a method

fiery inlet
#

and also error if i write in the main class

#

oh fixed that one

wraith rapids
#

yes, the main class is not an instance of the main class

fiery inlet
#

but the die thing

#

what the heck i put there

wraith rapids
#

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

fiery inlet
#
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

wraith rapids
#

put it in the event

slender veldt
#

the place to change the plugin version is in build.grade, right?

ivory sleet
#

depends

fiery inlet
slender veldt
#
dependencies {
    compileOnly 'org.spigotmc:spigot-api:1.8.8-R0.1-SNAPSHOT'
}
ivory sleet
#

Yethats

#

Right

slender veldt
#

im not sure in gradle, since i used to use maven

slender veldt
#

thanks 👍

ivory sleet
#

You need to declare the repos also

#

But yeah

fiery inlet
#

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

wraith rapids
#

what are you even trying to do

fiery inlet
#

trying to stop a player from leaving the crates gui while its spinning

wraith rapids
#

then why are you telling the player to close their inventory

fiery inlet
#

idk u said to put the task in

wraith rapids
#

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

fiery inlet
#

i havent created more than 1 class this whole time

#

ur just confusing me now

wraith rapids
#

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

crude charm
#

Check for inventory close event and then open your inv if the name is the name of the inv

fiery inlet
#

how do you have to put up the wait thing

#

with the nanos

#

or whatever

crude charm
#

huh

wraith rapids
#

don't use wait

#

wait freezes the server

fiery inlet
#

you told me to wait 1 tick xd

wraith rapids
#

yes

#

using the fucking bukkit scheduler

crude charm
#

ye in a runnable

#

bruh

fiery inlet
#

youre confusing me even more

#

i just deleted all of that cuz u said just wait 1 tick

wraith rapids
#

yes, wait 1 tick

#

using the bukkit scheduler

fiery inlet
#

how to do

#

where to put

crude charm
#

And you use the scheduler in a runnable

wraith rapids
#

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

fiery inlet
#
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

wraith rapids
#

remove wait

fiery inlet
#

i know

#

and thats how u mean?

wraith rapids
#

yes

#

you are now scheduling a task to run 1 tick in the future

#

and that task reopens the inventory

fiery inlet
#

oh i get it now

#

ffs

#

ok aint work xd

crude charm
#

remove the nesting

#

too many brackets

fiery inlet
#
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

crude charm
#

no

#

check for the opposite and return

fiery inlet
#

it says its unneccesary

#

since its a void

wraith rapids
#

invert your if condition

#

and instead of continuing, return

#

instead of

#
if (condition) {
   // stuff
}
#

do

if (!condition) return;
// stuff
crude charm
#

ye

fiery inlet
#
@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;
        }
        }
wraith rapids
#

at least you tried

fiery inlet
#

lol

crude charm
#

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;
wraith rapids
#
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); }
        })
            
}
crude charm
#

beautiful

#

my eyes

wraith rapids
#

much more readable

crude charm
#

its this

fiery inlet
#

/D:/cratesWorld/src/main/java/me/barry/CratesMain.java: D:\cratesWorld\src\main\java\me\barry\CratesMain.java uses or overrides a deprecated API.

crude charm
#

vs this

fiery inlet
#

worry or not?

wraith rapids
#

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

fiery inlet
#

ur right

#

so what exactly do i tell you if it doesnt work without making you rage

wraith rapids
#

it won't work

#

you're still instantiating your main class

fiery inlet
#

then how am i supposed to do it

wraith rapids
#

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

fiery inlet
#

can you send it again

#

cuz im not scrolling up 2000 pages

wraith rapids
#

no it was like 8 hours ago

fiery inlet
#

exactly

wraith rapids
#

and I can't use search

#

you however, can

crude charm
#

@wraith rapids do people still static abuse their main class LMFAO HAHAHA

#

they are abusing it

wraith rapids
#

when people ask how to do it it's pretty much 50/50 DI and static getters

fiery inlet
#

by 8 hours ago do u mean literally

crude charm
wraith rapids
#

no i don't remember when it was

#

do you know how to create a constructor

crude charm
#

yes ofc lmfao

fiery inlet
#

you should know how many messages you fricking send

crude charm
#

I send MILLIONS

wraith rapids
#

i don't keep a tally

crude charm
#

I do

wraith rapids
#

i probably have like 2000 deleted messages on paper

crude charm
#

ive sent ~5000

fiery inlet
#

this.main = main;

#

that?

wraith rapids
#

that is the assignment yes

fiery inlet
#

did i find it

crude charm
#

bruh

wraith rapids
#

probably

fiery inlet
#

so is that the line

wraith rapids
#

you need more than 1 line

crude charm
#

2?

#

oh wait just make the method one line

#

nvm

wraith rapids
#

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
fiery inlet
#

but why would i need this if im literally in the main class

wraith rapids
#

private MyMainClass myMainClass;

crude charm
#
private Main plugin;

public Class(Main plugin) {
this.plugin = plugin;
}
wraith rapids
#

you're not in the main class

#

you're in the listener class

fiery inlet
#

oh ye what u said thing ye

wraith rapids
#

or is the listener in the main class

fiery inlet
#

the listener is in the main class

#

its all 1 big class

crude charm
#

bruh

#

why

wraith rapids
#

then use this

crude charm
#

thats so ugly

fiery inlet
#

ok

crude charm
#

BRUH

wraith rapids
#

i don't even have the effort to start an oop rant and what this means

fiery inlet
#
@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

crude charm
#

why

wraith rapids
#

what is your avatar

#

it looks like a pimple with terminal cancer

fiery inlet
#

me?

#

lol

#

its a sloth

wraith rapids
#

what a disgusting creature

fiery inlet
#

but i do agree

#

it looks weird in ur profile pic

wraith rapids
#

it looks like a mouldering raisin that grew a pair of teeth

fiery inlet
#

yeah

fiery inlet
#

ok so it cancels the close

#

but it also cancels the automatic close lol

#

and i cant close the gui now

ancient plank
#

zoi's pfp looks more like a strange mix between a sloth + a bat

wraith rapids
#

you'll have to implement exemption logic for it

crude charm
#

and lazy

#

and cool

fiery inlet
#

so i get what you mean exception

#

but how to do it i dont get

wraith rapids
#

idk add a boolean and set it to true and check it or whatever

crude charm
#

This is my actual logo but I dont really use it much apart from some stuff

fiery inlet
#

a public boolean

#

or wut

wraith rapids
#

did you know there's a version of me without the santa hat

fiery inlet
wraith rapids
#

sadly it can't send messages in this channel for some reason

wraith rapids
#

which is weird because I have no roles on either account

crude charm
#

why no roles

#

😦

wraith rapids
#

i'm self verified

fiery inlet
#

it goes red

crude charm
wraith rapids
#

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

crude charm
#

ya

wraith rapids
#

static fields are accessible across any objects of a class and the class itself

fiery inlet
#
@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

wraith rapids
#

done == true is equivalent to just done

#

it's already a boolean, you don't need to compare it with anything

crude charm
#

if (done == true){ return; } you dont need the brackets

wraith rapids
#

if (done) return;

hoary tiger
#

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
crude charm
#

^

fiery inlet
#

well done can also be false

#

as that is its default value

wraith rapids
#

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

crude charm
#

ya

wraith rapids
#

true == true returns true

#

because true is true

wraith rapids
#

false == true returns false

hoary tiger
#

Could not load 'plugins/ZombieApocolypse.jar' in folder 'plugins'
org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml

wraith rapids
#

because false is not true

#

therefore the == true part is redundant

crude charm
wraith rapids
#

send the entire error message

#

that is not the entire error message

#

you are cutting off 90% of it

crude charm
#

^

fiery inlet
#

yeah i get it, its like skript where it just checks if a variable is set

wraith rapids
#

no it doesn't

drowsy helm
#

most likely formatting issue

crude charm
#

they did

wraith rapids
#

== compares two values

wraith rapids
#

it returns true if the value on the left is the value on the right

drowsy helm
#

ah gotcha

hoary tiger
#

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

crude charm
#

bruh

wraith rapids
#

java.io.FileNotFoundException: Jar does not contain plugin.yml

#

literally read

drowsy helm
#

not being compiled with it

crude charm
#

ye you have to add it manually

wraith rapids
#

with winrar

crude charm
#

yup

onyx shale
drowsy helm
#

or just setup maven to work correctly

#

and add it

crude charm
#

this happened to me before

wraith rapids
#

a few builds out of date lmao

hoary tiger
#

thx and sorry

crude charm
#

so now I have to add it manually every time

drowsy helm
#

are you using maven to compile Towster?

hoary tiger
#

no just the InteliJ java Artifacts

solemn shoal
#

if(done == true)

crude charm
hoary tiger
#

Java Dependancies i think?

drowsy helm
#

oh wouldn't have a lcue how to add it with that

wraith rapids
#

if (done != false)

hoary tiger
#

got it

solemn shoal
#

done == true returns true so might aswell just put if(done)

drowsy helm
#

i would recommend use maven

fiery inlet
#

oh no

crude charm
#

same

#

use m,aven

#

or else

solemn shoal
#

gradle ftw

wraith rapids
#

ant

crude charm
crude charm
#

no grandle

solemn shoal
#

yes

crude charm
#

no

fiery inlet
#

it doesnt work

solemn shoal
#

fucking yagpdb lmfao

wraith rapids
#

you're doing it wrong

crude charm
#

haha cant type yes extremefloosh

fiery inlet
#

well yeah

solemn shoal
#

anyways, yes gradle

crude charm
#

no maven

solemn shoal
#

yes gradle

ancient plank
#

madle/graven are very nice

onyx shale
#

btw anyone got a protocollib decent vids? bout to dive into armorstands

wraith rapids
#

ant

crude charm
#

maven

paper viper
#

gradle OR maven

solemn shoal
#

ant

paper viper
#

OR ant

#

fine

#

idc

crude charm
#

maven ftw

paper viper
#

lmao

solemn shoal
#

javac + 7z

crude charm
#

maven not grandle

ivory sleet
crude charm
#

maven

drowsy helm
crude charm
#

maven or noob

paper viper
#

lmao

wraith rapids
#

i'm sure redempt has some dependency manager that uses a .txt file

paper viper
#

ur noob

ivory sleet
#

Gradle >> maven

crude charm
#

no u

#

maven

solemn shoal
#

javac > maven

paper viper
#

cause gradle requires a higher skillcap than maven sorry to break it

crude charm
#

maven >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> grandle

drowsy helm
#

gradle > maven, maven is easier to use however

ivory sleet
paper viper
#

conclure can you halp me convert

fiery inlet
#

men

paper viper
#

lol

ivory sleet
fiery inlet
#
  1. how do i set done to false
ivory sleet
#

Gradle is as easy as maven

wraith rapids
#

done = false

crude charm
#

^

drowsy helm
#

debatable

solemn shoal
fiery inlet
#

it aint work

crude charm
#

grandle is a maven fork

paper viper
#

conclure halp me

solemn shoal
#

gradle

ivory sleet
#

Ye pulse

wraith rapids
#

did you declare it as a field

paper viper
#

lol

solemn shoal
#

"grandle" lol

paper viper
#

im bad

solemn shoal
#

someone enabled slowmode lol

fiery inlet
crude charm
#

grandle is a maven fork

solemn shoal
#

maven vs gradle is too hot for this discord

solemn shoal
crude charm
#

yes it is

drowsy helm
#

happy to help if you need though

crude charm
#

I was told it is and noone would lie to me

drowsy helm
#

lol what

paper viper
solemn shoal
#

lol i need proof

drowsy helm
#

gradle is nothing like maven

crude charm
#

some guy sold me Gradle was a mavenfork

paper viper
#

Gradle is nowhere fucking a maven fork lmao

ivory sleet
crude charm
#

I might be wrong because it looked like a new player but idk

paper viper
#

ZoiBox you gotta rethink your brain

drowsy helm
#

i mean they couldve forked it, deleted all the source and written their own

fiery inlet
#

bruh

solemn shoal
fiery inlet
#

how to set as field

crude charm
paper viper
#

bro you didnt even make sure it was factual smh

solemn shoal
#

gradle doesnt even use xml lmao

paper viper
#

Exactly lol

ivory sleet
#

Zoi still what does that have to do with gradle being worse than maven

crude charm
#

maven

solemn shoal
#

tho it does have backwards compatibility with pom.xml files because people are lazy

ivory sleet
#

It’s literally irrelevant

drowsy helm
paper viper
#

"go jump off a cliff"

#

alright i'll do it

crude charm
ivory sleet
#

Wat

paper viper
#

Ok this person is trolling Conclure lmao

crude charm
#

ok it doesent

hoary tiger
#

What have I done

ivory sleet
#

He’s almost worse than the helpchat kotlin karens

crude charm
#

but this guy in an ally way told me it does

fiery inlet
#
private static boolean DONE = false;

@wraith rapids ?

paper viper
#

he isnt almost. He is guarnateed

crude charm
#

the guy in the dark ally way told me it uses maven and now I know its wrong

#

but still maven is better imo

paper viper
#

maybe you were that guy

crude charm
#

ive been using it for years

ivory sleet
#

Anyways conclusion gradle > maven

solemn shoal
#

why would you name your variables in full caps

paper viper
#

cause you never ever used gradle i am guess

crude charm
solemn shoal
#

stop, please lmfao

and yes, gradle > maven

drowsy helm
paper viper
#

oh wait nvm final too

solemn shoal
#

it is? never knew

paper viper
#

oops i forgot about it having to be final too

crude charm
hoary tiger
#

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

crude charm
#

I know it

ancient plank
#

graven

crude charm
#

it works for me why would I change

paper viper
ivory sleet
#

Fair enough it works

solemn shoal
fiery inlet
#

omfg this shit

ivory sleet
#

But my point isn’t whether it works or not

fiery inlet
#

how do i make a boolean a field

crude charm
#

easy no othjer stuff

solemn shoal
#

yeah?

#

git clone and gradlew build lmao

fiery inlet
#

how do i access a boolean in multiple places

drowsy helm
#

so because it's easier for oyu means it's better?

crude charm
paper viper
# ivory sleet Fair enough it works

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.

solemn shoal
#

same with gradle lol

hoary tiger
#

Hello?

paper viper
#

In fact, gradle is signficiantly faster in buildtime

#

and many other changes

#

which saves a shit load of time for big projects

solemn shoal
#

i tried to compile Geyser once... 5 minutes compile time to end up erroring out anyways

paper viper
#

imagine coding luckperms and building it with maven tho

crude charm
solemn shoal
#

Geyser uses maven with in-xml java reflection for some reason

paper viper
solemn shoal
#

like, their pom.xml litterally has a CDATA block in it with org.reflections code lmao

ivory sleet
paper viper
#

after all, idk what stuff you bring up to this discord lately lol

crude charm
#

and no I havent properly used Gradle

paper viper
#

"grandle"

#

you cant even spell it properly bro

crude charm
#

doesent mean I havent tried and had many issues with it

fiery inlet
crude charm
solemn shoal
#

its because you dont use it correctly then

ivory sleet
#

It’s like saying brainfuck is better than java because you haven’t used java

solemn shoal
#

anyways, steam let me play my game ffs

crude charm
paper viper
#

then wtf is your point that you brought up the first place??????

ivory sleet
#

Don’t go around naively saying gradle is worse then pal

slender veldt
#

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

paper viper
#

you brought up the point, and said now that "it's an opinion"

#

after you dont back it up

solemn shoal
#

ok thanks steam lmao

ivory sleet
#

Barry sry

paper viper
#

life is spain without the s

ivory sleet
#

I confess I trolled you but what’s the problem

crude charm
ivory sleet
#

Sure I totally respect that

crude charm
solemn shoal
#

i love how gradle vs maven instantly triggers slowmode

crude charm
#

ikr lmfao

solemn shoal
ivory sleet
#

🥲

solemn shoal
#

like, its just steam library/family share lmao

crude charm
#

thought it was like at the movies you borrow them out of the machines

#

is that still a thing?

paper viper
#

...

crude charm
#

like this

solemn shoal
#

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

slender veldt
#

where can i get the javadocs on spigot for different versions

solemn shoal
solemn shoal
#

nonexistant steam account lol

crude charm
#

lol

slender veldt
solemn shoal
#

i mean its litterally the anonymous steam login

paper viper
#

ik helpchat has some copies i think

#

got u

#

click your version

slender veldt
#

sheesh thanks 👍

solemn shoal
#

lol steam anonymous login breaks so many things

paper viper
#

goes all the way to 1.5

#

lol

ivory sleet
#

Lol

slender veldt
#

thats cool

crude charm
#

what about 1.3 😦 noone cares about my 1.3 server

slender veldt
#

:<

ivory sleet
#

🥲

fiery inlet
#

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); }
        });

    }
slender veldt
paper viper
#

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

fiery inlet
#

how do i make a boolean accessable in 2 events

wraith rapids
#

declare a boolean field

#

and then access that field

fiery inlet
#

man

#

i dont know wtf that means

ivory sleet
#

🥲

wraith rapids
#

look up a java tutorial

#

this is literally java 101

crude charm
#

ikrlmfao

fiery inlet
#

its 2 am

#

just fucking help with this finalshit

crude charm
fiery inlet
#

not for me

wraith rapids
#

this is the most basic thing you could possibly know

fiery inlet
#

for me youre throwing around random words

crude charm
#

move the field outside the method

fiery inlet
#

i fricking did

crude charm
#

bruh

sage swift
crude charm
#

ur obv doing smth wrong

crude charm
sage swift
fiery inlet
#

i dont even know what a field is

#

so f yeah im prob doing something wrong

sage swift
#

field is variable

fiery inlet
#

i put

#
boolean doneroll = false;
#

outside

paper viper
# fiery inlet ``` @EventHandler public void InvClose(InventoryCloseEvent event) { ...

couple things here btw:

  1. Do NOT compare Inventory titles. Instead, use InventoryView
  2. Use ChatColor because it supports multiple versions instead of the weird § symbol.
  3. Don't cast Player to event.getPlayer(). Always check. In this case, it returns a HumanEntity and 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);
fiery inlet
#

() -> player.openInventory(inv);

was buggy as hell so no

paper viper
#

??

#

it does the exact same thing

fiery inlet
#

that doesnt work

#

nop

paper viper
#

its just a lambda

#

yes

wraith rapids
#

it does the exact same thing

paper viper
#

remove the semicolon then

#

you have to listen to us and trust us

#

we've been doing this for ages already

fiery inlet
#

with the ->?

wraith rapids
#

the runnable extension is just easier to understand so I showed it instead of the lambda

paper viper
#

Makes sense

fiery inlet
#

do i do it with the ->

#

arrow thing

wraith rapids
#

do whatever

paper viper
#

just wondering, you've learned some Java... right

#

hopefully

wraith rapids
#

clearly not

fiery inlet
#

no

paper viper
#

ok yeah no

#

im out

wraith rapids
#

look up a java beginner guide and come back tomorrow

#

you'll save everyone's time and nerves

fiery inlet
#
  1. tomorrow is school
  2. its 2 am, ive wasted my time if i dont just get this shit done
wraith rapids
#

at this rate you'll just waste even more of your time

paper viper
#

Yep

#

2 am aint gonna get jackshit done

wraith rapids
#

come back tomorrow after school

paper viper
#

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

fiery inlet
#

everyone says learn java omg learn java

paper viper
#

after you are done learning

fiery inlet
#

how the fuck am i going to learn it

wraith rapids
#

google a tutorial

paper viper
#

coursera

wraith rapids
#

we are not a walking java tutorial

paper viper
#

jetbrains tutorials

fiery inlet
#

well its all a bunch of text

wraith rapids
#

yes

#

this is a bunch of text too

paper viper
#

its not always a bunch of text

fiery inlet
#

like do you mean making a calculator and shit

paper viper
#

coursera and codeacademy does interactive coding

#

meaning you code as you go

wraith rapids
#

if you have a problem with or a question about the tutorial or guide, you can ask that here

paper viper
#

to learn the material better and get a hands on experience

wraith rapids
#

but we do not want to fucking write a java tutorial for you

fiery inlet
#

not what im asking

wraith rapids
#

do you understand how many people come here every day

paper viper
#

Man you gotta understand

#

we are elderly people

#

we are old men

fiery inlet
#

what im asking is, whats the visual output of java, if its not minecraft plugins

ivory sleet
#

Cap

paper viper
#

we encounter like 20 of you each day

#

lmao

paper viper
onyx shale
#

man protocollib its so under documented i might as well go back to using nms for packets lol

ivory sleet
#

😇

wraith rapids
#

you run them in a console window usually

#

basically just text

#

you just need to learn the absolute basics with that

fiery inlet
#

how the frick is that gonna teach me shit

wraith rapids
#

stuff like fields, methods, constructors

fiery inlet
#

in a console

wraith rapids
#

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

paper viper
#

its not even a console like 50% of the time

fiery inlet
#

he just said 5?

paper viper
#

barry do you know how to sysout a line with a line separator?

#

tell us

#

no searching allowed

#

and also one line sysout only

fiery inlet
#

wat

paper viper
#

one call too only

#

sysout -> System.println

fiery inlet
#

the system.out.println

#

or what

paper viper
#

Yes

#

now print two lines

fiery inlet
#

yeah i see it sometimes

paper viper
#

using one statement

#

how do you do it

#

for example

fiery inlet
#

idk

paper viper
#

i want you to print

hello
world
fiery inlet
#

i guess + newLine + "extra line"

paper viper
#

using one system.println statement

#

yes how do you do newLine

#

just getting some basic shit down you know

fiery inlet
#
System.out.println("first line" + newLine + "second line")
```?
#

that or what

paper viper
#

No.. what is "newLine"

fiery inlet
#

wdym

#

a line seperator?

paper viper
#

yes how do you do that

#

assume mac

fiery inlet
#

ohh

#
String newLine = System.getProperty("line.seperator");

this u mean

#

thats about all java i know

#

aswell as camelcase

paper viper
#

Hm, okay

ivory sleet
#

System.lineSeparator

paper viper
#

weird that you know about that specifically

#

lmao

jade perch
#

Beat me to it

#

Sadge

ivory sleet
#

Lol I learned it from u ngl

wraith rapids
#

interactive excercises

#

do a few

#

then do a few more

fiery inlet
wraith rapids
#

see the sidebar on the left

fiery inlet
wraith rapids
#

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

jade perch
#

He can't see replies

#

Cuz he is weird

wraith rapids
#

oh did someone reply to something

fiery inlet
#

im at java data types

jade perch
#

Yes nny

wraith rapids
#

uh huh

fiery inlet
#

well he answered it?

#

wdym

wraith rapids
#

i can see the message but I can't tell that it's a reply to something

fiery inlet
#

why not

wraith rapids
#

because I use ripcord, and ripcord doesn't support replies

jade perch
#

You also make your ui look like a dying sun

wraith rapids
#

i'm a pretty red guy

onyx shale
#

its spawning a fookin pig m8

paper viper
#

lmao?

onyx shale
#

im about to shit on protoocllib and go with nms

paper viper
#

You know. I wish there was an entity wrapper

#

for packets

#

is there some utility class i could copy and paste

#

lmao

wraith rapids
#

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

onyx shale
paper viper
#

ah ic

fiery inlet
#

f dis ima get sleep 25/59

wraith rapids
#

good

onyx shale
#

ayy finally

#

after i had to manually write shit

paper viper
#

"fakeDog"

#

lmao

onyx shale
#

he do be kinda sus

#

now time to use the the metadata packet

upper vale
#

Is it possible to change how fast you "pull up" your item, or is the animation completely client sided?

quaint mantle
#

I pull up

quaint mantle
upper vale
#

do you know what the animation is called lol

quaint mantle
#

no i dont

upper vale
#

ive just been referring to it as "pull up" lmao

quaint mantle
#

i think its attack speed

upper vale
#

alr thanks anyways ❤️

#

ill check

quaint mantle
#

if you want to quickly change attributes

paper viper
#

more like

#

"DaBaby Lib"

#

lol

onyx shale
#

and crashed the server

#

and.. bricked the world

quaint mantle
#

thank you so much for the idea

paper viper
#

lmao

#

np

onyx shale
#

well metadata packets are a pain in the arse

#

but its working i guess

drowsy helm
#

out of everything you could've done

#

sus dog

#

pls leave

wraith rapids
#

amogus

upper vale
#

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

opal sluice
#

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)

dusk flicker
#

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

pearl hollow
#

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

opal sluice
quaint mantle
#

Thats like trying to get a flu shoot over a zoom call

#

show us your code.

pearl hollow
solemn shoal
dusk flicker
#

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 )

sage swift
#

also recursive will quickly cause stack overflow

rugged topaz
#
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.

dusty herald
#

because you're referencing 4 dirt blocks and not 5?

drowsy helm
#

You're looking for an itemstack that has 4 size, not removing 4 size

young knoll
#

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

hoary tiger
#

How do I check if a mob has spawned

drowsy helm
#

like a specific type of mob?

#

or just any mob

hoary tiger
#

any mob But I want to know what that mob is

drowsy helm
#

use EntitySpawnEvent

hoary tiger
#

got it thanks!

cold field
#

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?

flint elk
#

how can i start the version 1.16.5 faster?

dusty herald
#

📰

#

🖇️

outer sorrel
#

how could I run multiple commands when a message is clicked with a TextComponent?

opal juniper
#

Are you talking about the 20 second warning about not being on the latest version?

quaint mantle
opal juniper
#

That can be solved with:

-DIReallyKnowWhatIAmDoingISwear

#

In the batch file you use to launch the server

outer sorrel
quaint mantle
#

I don't think a textcomponent can have multiple commands

dusty herald
#

try adding multiple click events to one textcomponent and see if that works otherwise do the command thing

quaint mantle
#

Found a super efficient way to free more memory:

while (true){
  System.gc();
}```
lilac dagger
#

😂

quaint mantle
#

😛

wispy fossil
#

may i ask if this is sarcasm
we truly do live in a world

flint elk
unkempt peak
#

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

dusty herald
unkempt peak
#

but i am in the world and im using player.getWorld() as world

outer sorrel
#

How could I make a command run without any output?

unkempt peak
dusty herald
#

oh mybad I misred

#

just don't send them a message and always return true

outer sorrel
#

so the end return false; would be return true; now?

dusty herald
#

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

unkempt peak
#

@dusty heraldCan a world not be fully loaded even if your in that world?

dusty herald
#

I dont know but if you reload weird shit can happen

#

that's why many people advise against doing it

unkempt peak
#

So should i just delay the teleport?

dusty herald
#

make sure the world isn't null

outer sorrel
#

ok worked, thanks

unkempt peak
#

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);```
dusty herald
#

are you trying to set the world of a location?

#

psst

#

maybe spawn is null?

unkempt peak
#

sorry wrong line

#

i edited it

dusty herald
#

maybe your spawn location is null

unkempt peak
#

but why is the spawn line not null then?

dusty herald
#

Show me the full stack trace

unkempt peak
#
        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]```
dusty herald
#

whats on line 45

#

spawn.setWorld?

unkempt peak
#

that is spigot

dusty herald
#

ah shit ur right

#

mobile

#

283?

#

29*

unkempt peak
#

setWorld(world);

#

is 283

dusty herald
#

spawn.setWorld or setWorld()

unkempt peak
#

i split it into to lines

outer sorrel
#

i doubt it

#

though

unkempt peak
#

its spawn. setworld(world);

dusty herald
#

debug your code

unkempt peak
#

i did

dusty herald
#

check if world or spawn is null

unkempt peak
#

neither one is null

dusty herald
#

check if spawn is null avaeyes

#

one of them has to be

#

or you wouldn't get the NPE

sage swift
#

print spawn

dusty herald
#
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.```
unkempt peak
#

Ok well it's null but the location exists in the config

dusty herald
#

how did you save this Location?

quaint mantle
#

If the world isnt loaded at start it won't work IIRC

dusty herald
#

show us config

dusty herald
quaint mantle
#

can you send ur full code

dusty herald
#

and config please

unkempt peak
quaint mantle
#

round your coords 😢

dusty herald