#help-development

1 messages ยท Page 1422 of 1

drowsy helm
#

well you never return

onyx shale
#

You didnt add a reference to to protocollib

plain quest
#

what about this any ideas?

sullen marlin
#

Use brackets in your if statement and the error is obvious

drowsy helm
#

you're just printing then still making the packet lsitener

#

use reflection

vast quest
plain quest
#

same for the action enum

drowsy helm
#

I think the spigot jar doesn't include it or something like that. Can't remember exactly. I have a method if you want it

sullen marlin
#

Cause mojang broke the class

vast quest
#

OH

#

I forgot to add else

#

I see now :d

drowsy helm
#

thats what we've been saying lmao

vast quest
#

yes

#

its was so painfully obvious

solemn shoal
#

is there a way to change java's current directory?

drowsy helm
#

like working dir?

vast quest
#

uh

solemn shoal
#

yeah

#

in C# you can just do Environment.CurrentDirectory = "new path";

#

i've tried System.setProperty("user.dir", Path.of(newpath).toAbsolutePath().toString()); but that doesnt seem to work

vast quest
solemn shoal
#

check if protocollib is installed, if not disable your plugin with a warning

solemn shoal
drowsy helm
#

looking it up rn

vast quest
drowsy helm
#

actualy nvm

#

just means top if statement isn't being satisfied

#

thats weird

#

oh you tried that

#

is this for ap lugin?

vast quest
#

this is weird

solemn shoal
#

setting user.dir doesn't affect subsequent file accesses

#

as you can see by my output it does infact get the argument correctly and throws no errors, yet file accesses arent changed

drowsy helm
#

how are you verifying the current working dir

solemn shoal
#

how do you mean?

drowsy helm
#

how do you know it's not switching dirs

solemn shoal
#

the original working dir only has 3 jars, whilst the one im setting to has 30+

#

when i specify scan directory instead of switching current directory, i get this:

#

whilst when changing current directory, i get this:

drowsy helm
#

hmm i think File always does working dir as the dir of the jar

#

not actual working dir

solemn shoal
#

i could test that

vast quest
solemn shoal
#

nope

drowsy helm
#

could always just have a home dir variable instead of using java's system

solemn shoal
#

jar is in the libs folder

drowsy helm
#

interesting

solemn shoal
#

it takes the working dir of your executing process

#

(aka if you use bash to launch it, itll use whatever dir you were in with bash as working dir)

drowsy helm
#

thats some strange behaviour

solemn shoal
#

seems normal to me

drowsy helm
#

im assuming exactly the same code to scan for jars with both methods

solemn shoal
#

yep

vast quest
#

Java is weird

solemn shoal
#

baseDir is only set if you pass --dir <some directory>

#

it defaults to "."

vast quest
#

this makes no sense omg

solemn shoal
#

lol

#

doesnt seem to happen in your protocollib check

dire marsh
solemn shoal
#

also issue may be your imports

#

yeah what sam said

vast quest
#

well when I remove the protocolib stuff

#

it doesnt give that error

dire marsh
#

of course it doesnt

vast quest
#

like the packetstuff

dire marsh
#

it isn't imported/used anymore

solemn shoal
#

its your import

vast quest
#

Oh

#

so

drowsy helm
#

have you tried isPluginEnabled

#

instead

vast quest
#

do I just put it on anothjer class

#

nope

solemn shoal
#

lol

drowsy helm
#

*part of PluginManager btw

vast quest
#

o

dire marsh
#

put it in a ProtocolLibLoader class or something and then in your main class check if protocollib is loaded and instantiate that class if so

vast quest
#

Oh

#

ok

drowsy helm
#

why?

#

its the same thing he is doing with more steps

dire marsh
#

No

#

read what i said previously

drowsy helm
#

gotcha

vast quest
#

Question

#

how can I call a method in another class that isnt static

drowsy helm
#

class#method()

#

you need a reference to the class instance

vast quest
#

so I still need to use staticc

drowsy helm
#
public class MyClass1{
  MyClass2 mc2 = new MyClass2();
  mc2.myMethod();
}

public class MyClass2{
  public void myMethod(){
  }
}```
#

no you shouldn't need to use static

vast phoenix
#

how would I find out why I'm getting Timed out?

vast quest
#

o

vast phoenix
#

it has to be something in my plugin since it just started happening

vast quest
#

I see

vast phoenix
#

and there is no console output about it

drowsy helm
#

timed out is a network thing usually

maiden thicket
#

any loops at all

#

infinite loops would also cause timed out

drowsy helm
#

would dump an error in console

maiden thicket
#

infinite loops?

drowsy helm
#

yeah the thread dies and it will report in console

maiden thicket
#

doesnt do that for me usually

vast quest
#

now I get more errors!

maiden thicket
#

do you have protocollib on ur server?

vast quest
#

No thats what im trying to do

drowsy helm
#

did you end up putting it in another class

vast quest
#

I need to check

maiden thicket
#

add

#

it to ur

#

plugins folder

#

xd

vast quest
#

no thats what im trying to check

drowsy helm
#

i think sam was right

maiden thicket
#

oh

drowsy helm
#

how you are still importing it in your main class

#

so it's gonna throw a fit

maiden thicket
#

Bukkit.getServer().getPluginManager().isPluginEnabled("ProtocolLib")

vast quest
#

Im not I placed it on another class

maiden thicket
#

i believe

drowsy helm
#

whats line 31

#

Particle Manager

vast quest
#

ProtocolLibCheck protocolCheck = new ProtocolLibCheck();

maiden thicket
#

send that class

drowsy helm
#

are you creating it before checking if its enabled

vast quest
#

im creatin g the var before checking

#

yes

maiden thicket
#

send the class

#

pls

#

it's prolly an error in ur constructor if that's whats happening

vast quest
#

uh so

#

want me to send the classes

#

oir

maiden thicket
#

just

#

protocollibcheck class

vast quest
drowsy helm
#

the error is on PArticleMangaer

#

not protocollibcheck

maiden thicket
#

but that's the line

#

send particlemanager too

#

ig

drowsy helm
#

it would be throwing an error for protocollibcheck then

#

not particlemanager

vast quest
drowsy helm
#

have your check if it exists in the onEnable

maiden thicket
#

for this

drowsy helm
#

then create after

maiden thicket
#

yeah

#

u can do that

#

or

#

i believe

#

it's because ur registering the variable

#

first

#

check if it's enabled then try creating the variable

drowsy helm
#
ProtocolLibCheck protocolCheck;
if (pl != null && pl.isEnabled()) 
       protocolCheck = new ProtocolLibCheck();
vast quest
#

so protocolcheck method will jsut be registering

#

?

drowsy helm
#

yep

#

then the if statement is in your onEnable

maiden thicket
#

it's dumb for it to show the error on that line though

#

when it should be in

#

particle manager line

#

35

drowsy helm
#

well its on instantiation of the class

maiden thicket
#

because the protocollibcheck has nothing in the constructor

drowsy helm
#

not a line within the class

maiden thicket
#

but it shouldn't be trying to do anything protocollib related

#

actually

#

i get what u mean

dire marsh
#

public void protocolLibCheck() { your protocollib registering stuff won't even get called

maiden thicket
#

because its imported and being used

#

the api itself

#

okay i getcha

drowsy helm
#

^ and yeah not calling the method lol

maiden thicket
#

i believe

#

u dont have to check

#

if these exist

dire marsh
#

you should also put the entire thing in the plugin enable check if you're not using the protocollibcheck class elsewhere

maiden thicket
#

since the 2nd argument is a boolean to replace or not

#

but im not sure

vast quest
dusty herald
#

why not just use the bukkit method for config.yml?

dire marsh
#

you don't, but the console does send an annoying warning if it already exists

maiden thicket
#

ah thats dumb

maiden thicket
#

getConfig().options().copyDefaults(true);
saveConfig();

dusty herald
#

saveDefaultConfig()* during initialization Wink

maiden thicket
#

ez

drowsy helm
#

wtf

#

thats the fucken

#

skype emoji

#

where you get that from

vast quest
#

ok at this point im just confused

maiden thicket
#

ok

#

in ur main class

#

onEnable

vast quest
#

Yes

maiden thicket
#

don't initialize

#

ProtocolLibCheck

#

you're going to first check if protocollib is on the server

#

then initialize it

vast quest
#

Ok

maiden thicket
#

also just bc it looks cleaner for ur logger.info i'd recommend String.format

#

๐Ÿคท๐Ÿพโ€โ™‚๏ธ

vast quest
#

so

#
if(getServer().getPluginManager().isPluginEnabled("ProtocolLib")) {
            protocolCheck.protocolLibCheck(); 
        }```
maiden thicket
#

no

vast quest
#

?

maiden thicket
#
    @Override
    public void onEnable() {
        ProtocolLibCheck protocolCheck;
        if (getServer().getPluginManager().isPluginEnabled("ProtocolLib"))
        {
                protocolCheck = new ProtocolLibCheck();
        }
        long start = System.currentTimeMillis();
        instance = this;
        updateCheck();
        if (protocolCheck != null) protocolCheck.protocolLibCheck();
        createCustomConfig();
        Objects.requireNonNull(getCommand("particlemanager")).setExecutor(new Commands());
        long fin = System.currentTimeMillis() - start;
        logger.info("ParticleManager v" + getDescription().getVersion() + " has been successfully enabled in " + df.format(fin / 1000.0) + " seconds (" + fin + "ms)");
    }```
outer sorrel
#

Im trying to make a groundspoof check but every time i jump normally and hit the ground it flags

Player player = e.getPlayer();

        boolean client = player.isOnGround(), server = player.getLocation().getY() % groundY < 0.0001;

        if (client && !server) {
            boolean boat = false;
            boolean shulker = false;

            List<Entity> nearby = player.getNearbyEntities(1.5, 10, 1.5);

            for (Entity entity : nearby) {
                if (entity.getType() == EntityType.BOAT && player.getLocation().getY() > entity.getLocation().getY()) {
                    boat = true;
                    break;
                }

                if (entity.getType() == EntityType.SHULKER && player.getLocation().getY() > entity.getBoundingBox().getMinY()) {
                    shulker = true;
                    break;
                }
            }

            if (!boat && !shulker) {
                fail("mod=" + player.getLocation().getY() % groundY);
            }
        }
sand vector
#

any reason why it is doing this? it works if i manually type it but there are no quick snippets

outer sorrel
maiden thicket
#

if MPlayer has any static methods then it'll show u options

vast quest
sand vector
maiden thicket
sand vector
#

i can type MPlayer.sendMessage(""); and it works but no quick options

maiden thicket
wraith rapids
#

this is because MPlayer looks like a class name

#

so it's searching for a class by the name of MPlayer

drowsy helm
maiden thicket
#

camelcase pls

wraith rapids
#

variable/field names are supposed to start with a lowercase alphabetic character

#

lowerCamelCase for fields/variables/methods

#

UpperCamelCase for class names

maiden thicket
#

then u go to C# and u have variable names starting with _

drowsy helm
#

your ide assumes MPlayer is a class

maiden thicket
#

๐Ÿ˜”

drowsy helm
#

not a variable

wraith rapids
#

ALL_CAPS for constants

vast quest
maiden thicket
#

yeh if u dont use correct casing you'll get yelled at by every java dev

rotund pond
maiden thicket
#
    @Override
    public void onEnable() {
        ProtocolLibCheck protocolCheck = null;
        if (getServer().getPluginManager().isPluginEnabled("ProtocolLib"))
        {
                protocolCheck = new ProtocolLibCheck();
        }
        long start = System.currentTimeMillis();
        instance = this;
        updateCheck();
        if (protocolCheck != null) protocolCheck.protocolLibCheck();
        createCustomConfig();
        Objects.requireNonNull(getCommand("particlemanager")).setExecutor(new Commands());
        long fin = System.currentTimeMillis() - start;
        logger.info("ParticleManager v" + getDescription().getVersion() + " has been successfully enabled in " + df.format(fin / 1000.0) + " seconds (" + fin + "ms)");
    }```
vast quest
#

now it says Operator '!=' cannot be applied to 'void', 'null'

cold field
#

I've just found the issue, if I send the player info packet (Add_Player) , the spawn packet and another player info packet (Remove_player, for removing the npc from the tablist) sequentially, the npc spawns without skin. This not always happen. I think that I'm not giving the client the time to properly load the skin that he receives a player info that tells him to remove that player... Any tips?

vast quest
#

oh nvm

maiden thicket
#

TaahPlayer being a class name

vast quest
#

nvm

maiden thicket
#

show ur onenable atm

vast quest
#

ignroe that

maiden thicket
#

o ok

vast quest
#

WAIT

#

could it be

rotund pond
lilac dagger
#

upper case snake

#

and for anything else than class camelcase

sand vector
#

ok, changed it to mPlayer. m meaning message (player receiving message). mPlayer is a variable with the specified player who will be receiving the message. I want to do mPlayer.sendMessage(""); .But this isn't working, and I've tried other variables and it doesn't have the option to auto Fill. is this a library issue?

#

Hopefully that makes sense

drowsy helm
#

sounds like an ide issue

vast quest
#

nooooooooooooooo

drowsy helm
#

have you restarted your ide

vast quest
#

aaaaaa

#

this is annoying

sand vector
vast quest
#

try File > Invalidate Caches > Restart

#

if ur using intellij

#

I should have asked that

sand vector
#

im using Eclipse

vast quest
#

oh idk then

#

never used

rotund pond
#

?paste

queen dragonBOT
drowsy helm
#

It's not a code issue

#

.

rotund pond
drowsy helm
#

I doubt anyones that dumb

dusty herald
#

they are

sleek pond
rotund pond
vast quest
#

it now gives error whenever protocollib is on the server

drowsy helm
#

I was never being rude lol

#

I'm saying no one is dumb enough to do that

#

not meant in a rude way

rotund pond
#

It is

#

You mean "If you do that, so you're dumb"

dusty herald
#

no? if he says he didn't mean it that way, it means he didn't

vast quest
#

Can you guys please go to general

dusty herald
#

no

vast quest
#

ok...

sand vector
drowsy helm
#

when this is refering to ProtocolLibCheck

dusty herald
drowsy helm
#

should pass a reference to plugin

dusty herald
#

but other than that, it should auto complete ๐Ÿคท

outer sorrel
#

Im trying to make a groundspoof check but every time i jump normally and hit the ground on a full block it flags
This code should check if the client says its on the ground but it isnt on the server

Player player = e.getPlayer();

        boolean client = player.isOnGround(), server = player.getLocation().getY() % groundY < 0.0001;

        if (client && !server) {
            boolean boat = false;
            boolean shulker = false;

            List<Entity> nearby = player.getNearbyEntities(1.5, 10, 1.5);

            for (Entity entity : nearby) {
                if (entity.getType() == EntityType.BOAT && player.getLocation().getY() > entity.getLocation().getY()) {
                    boat = true;
                    break;
                }

                if (entity.getType() == EntityType.SHULKER && player.getLocation().getY() > entity.getBoundingBox().getMinY()) {
                    shulker = true;
                    break;
                }
            }

            if (!boat && !shulker) {
                fail("mod=" + player.getLocation().getY() % groundY);
            }
        }
rotund pond
vast quest
sand vector
#

Meant for the other message soz

drowsy helm
dusty herald
#

I haven't used eclipse in many year

vast quest
rotund pond
dusty herald
#

netbeans /s

drowsy helm
#
public class ProtocolLibCheck {
  private final Plugin plugin;    
  
  public ProtocolLibCheck(Plugin plugin){
    this.plugin = pluign;
  }
       
}```

On enable:
```java
ProtocolLibCheck pCheck = new ProtocolLibCheck(this);
#

then instead of using this use plugin

drowsy helm
#

lmao

#

no

dusty herald
#

oh my god.

#

i am so sorry

vast quest
dusty herald
#

You have to modify your code, you can't just copy and paste it

vast quest
#

???

drowsy helm
#

have you changed the second class yet

#

it's gonna throw that if you haven't changed the constructor

vast quest
#

I did

drowsy helm
#

show the class

vast quest
#
public class ProtocolLibCheck {
    private final Plugin plugin;

    public void protocolLibCheck() {
        this.plugin = plugin;
        ProtocolLibrary.getProtocolManager().addPacketListener(new PacketAdapter((Plugin) ParticleManager, ListenerPriority.HIGHEST, PacketType.Play.Server.WORLD_PARTICLES) {
            @Override
            public void onPacketSending(PacketEvent event) {
                PacketContainer packet = event.getPacket();
                if (packet.getNewParticles().read(0).getParticle() != Particle.DAMAGE_INDICATOR) return;
                if (ParticleManager.getInstance().getCustomConfig().getBoolean("status") && ParticleManager.getInstance().getCustomConfig().getBoolean("disable-damage-indicator"))
                    event.setCancelled(true);
            }
        });
        ParticleManager.getInstance().logger.info("ProtocolLib was found and its features are enabled!");
    }
}```
dusty herald
#

you didn't change the constructor

drowsy helm
#

you didn't make a constructor

#

yopu just added it to the method

dusty herald
#

oh yeah you didn't even make one Kek

drowsy helm
#
public class ProtocolLibCheck {
  private final Plugin plugin;    
  
  public ProtocolLibCheck(Plugin plugin){
    this.plugin = pluign;
  }
       
 public void protocolLibCheck() {
        ProtocolLibrary.getProtocolManager().addPacketListener(new PacketAdapter((Plugin) ParticleManager, ListenerPriority.HIGHEST, PacketType.Play.Server.WORLD_PARTICLES) {
            @Override
            public void onPacketSending(PacketEvent event) {
                PacketContainer packet = event.getPacket();
                if (packet.getNewParticles().read(0).getParticle() != Particle.DAMAGE_INDICATOR) return;
                if (ParticleManager.getInstance().getCustomConfig().getBoolean("status") && ParticleManager.getInstance().getCustomConfig().getBoolean("disable-damage-indicator"))
                    event.setCancelled(true);
            }
        });
        ParticleManager.getInstance().logger.info("ProtocolLib was found and its features are enabled!");
    }
}```
#

your constructor is basically saying "When i create this class, I NEED these parameters"

vast quest
#

pluign; r u sure it should be that

sand vector
#

deleting the .metadata has resolved the issue. bit odd

drowsy helm
#

oh thats strange

#

probably chached something wrong

sand vector
#

yeah

vast quest
#

is this rigth

#

public class ProtocolLibCheck {
    private final Plugin plugin;

    public ProtocolLibCheck(Plugin plugin){
        this.plugin = plugin;
    }

    public void ProtocolLibCheck() {
        ProtocolLibrary.getProtocolManager().addPacketListener(new PacketAdapter((Plugin) ParticleManager, ListenerPriority.HIGHEST, PacketType.Play.Server.WORLD_PARTICLES) {
            @Override
            public void onPacketSending(PacketEvent event) {
                PacketContainer packet = event.getPacket();
                if (packet.getNewParticles().read(0).getParticle() != Particle.DAMAGE_INDICATOR) return;
                if (ParticleManager.getInstance().getCustomConfig().getBoolean("status") && ParticleManager.getInstance().getCustomConfig().getBoolean("disable-damage-indicator"))
                    event.setCancelled(true);
            }
        });
        ParticleManager.getInstance().logger.info("ProtocolLib was found and its features are enabled!");
    }
}```
drowsy helm
#

no

#

rename that void method

dusty herald
#

this too

wraith rapids
#

like i just fucking said

dusty herald
#

heyo NNYa

#

how's life

wraith rapids
#

variables, methods, and field names should be in lowerCamelCase

vast quest
#

change it to twhat thgo

drowsy helm
#

checkProtocolLib or something

#

something that isn't the class name

wraith rapids
#

something that follows the convention

#

fuckMyAss

vast quest
#

Ok

#

fuckMyAss it is

plain quest
drowsy helm
#

Do you want a reflection method

#

i have a reflection method

plain quest
#

sure

wraith rapids
#

you can bypass most access modifiers via reflection

plain quest
#

both the enum and the class are public

wraith rapids
#

dunno then

#

splรถgget's cloudflare shit bricks my browser for 5 minutes so i'm not going to open ze thread

quaint mantle
drowsy helm
quaint mantle
#

im copying an world and then loading it for player

plain quest
vast quest
#

what do I do for there

#

if (getServer().getPluginManager().isPluginEnabled("ProtocolLib")) { protocolCheck = new ProtocolLibCheck(); }

#

9in the main clas

wraith rapids
#

you should probably include the isPluginEnabled check in your ProtocolLibCheck class

drowsy helm
#
if (getServer().getPluginManager().isPluginEnabled("ProtocolLib")) { protocolCheck = new ProtocolLibCheck(this); }
wraith rapids
#

after all, that is the purpose of that class

vast quest
#

Yes but

#

that didnt work

drowsy helm
#

it wigs out if you instantiate the class without the dependency

#

doesn't like the imports

#

so he has to check before instantiating

vast quest
#

that

wraith rapids
#

oh yeah that's right, forgot about that

#

noclassdeffound and whatnot

vast quest
#

I spent way too much time on this instead of making the plugin

drowsy helm
#

could always just do a good ol' try catch

wraith rapids
#

or an inner class in the checker class

vast quest
#

yyes

#

But was I smart enough to realise that I could use that

#

if ur answer was yes

#

you are so wrong

wraith rapids
#

your mom

quaint mantle
vast quest
#

I agree

#

SON OF A

#

aaaaaaaaaaa

drowsy helm
#

lmao wot

vast quest
#

one gets fixed

#

the other one pops out

#

wtfd

drowsy helm
#

just means the if statement is saying it's enabled

vast quest
#

thats when the plugin isnt there

drowsy helm
#

even tho it's not

vast quest
#

Yes.

drowsy helm
#

that is strange

vast quest
#

I hate this

drowsy helm
#

honestly I would just wrap it in a try catch and call it a day

vast quest
#

wrap what on try and catch

#

the if statememnt?

drowsy helm
#

creating the class

vast quest
#

so

#

like tyhis

#
        try {
            if (getServer().getPluginManager().isPluginEnabled("ProtocolLib")) {
                protocolCheck = new ProtocolLibCheck(this);
            } else logger.warning("ProtocolLib was not found! Some features may not work as expected!");
            if (protocolCheck != null) protocolCheck.protocolLibEnable();
            else {
                logger.warning("ProtocolLib was not found! Some features may not work as expected!");
            }
        }```
drowsy helm
#
        try {
            protocolCheck = new ProtocolLibCheck(this);
            protocolCheck.protocolLibEnable();
        }catch(NoClassDefFoundError ex){
                logger.warning("ProtocolLib was not found! Some features may not work as expected!");
}```
vast quest
#

Imma just hope

#

at this point

drowsy helm
#

that will 100% work

#

it's just not good practice to rely on try catch blocks

vast quest
#

it....

#

doesnt

#

:d

drowsy helm
#

how so

vast quest
#

IDK

drowsy helm
#

what does it say

drowsy helm
#

ProtocolLibCheck pCheck = new ProtocolLibCheck(this);

vast quest
#

I really want to give up but I spent too much on this to just give up

drowsy helm
#

you are still creating it outside of the check

primal ledge
#

Hello, anyone experienced with publishing Maven projects to Sonatype central repository?

vast quest
#

so the try and catch would be

#
            ProtocolLibCheck pCheck = new ProtocolLibCheck(this);
            ProtocolLibCheck protocolCheck = null;
            
            protocolCheck = new ProtocolLibCheck(this);
            protocolCheck.protocolLibEnable();
        }catch(NoClassDefFoundError ex){
            logger.warning("ProtocolLib was not found! Some features may not work as expected!");
        }```
drowsy helm
#
 public void onEnable() {
        long start = System.currentTimeMillis();

        instance = this;
        updateCheck();

        try {
             ProtocolLibCheck protocolCheck = new ProtocolLibCheck(this);
            protocolCheck.protocolLibEnable();
        }catch(NoClassDefFoundError ex){
            logger.warning("ProtocolLib was not found! Some features may not work as expected!");
        }
        createCustomConfig();
        Objects.requireNonNull(getCommand("particlemanager")).setExecutor(new Commands());
        long fin = System.currentTimeMillis() - start;
        logger.info("ParticleManager v" + getDescription().getVersion() + " has been successfully enabled in " + df.format(fin / 1000.0) + " seconds (" + fin + "ms)");
    }```
#

i dont know why you're creating two protocollib checks

vast quest
#

am I?

drowsy helm
#
            ProtocolLibCheck pCheck = new ProtocolLibCheck(this);
            ProtocolLibCheck protocolCheck = null;```
vast quest
#

oh

#

I guuess I was

#

OK

#

seems to work

#

omg please

drowsy helm
#

๐Ÿ˜Ž

vast quest
#

YES

#

IT Workd\s}

#

GOD BLESS YOU

drowsy helm
#

epic

vast quest
#

I may have spent the last 15 hours on this and not making the plugin

#

but ITS FINE#

drowsy helm
#

ey atleast you learnt something maybe?\

vast quest
#

Yes I finally learned how to see the which error is what

#

.d

#

and the fact that I hate protocolib

#

:d

drowsy helm
#

protocollib can be amazing

#

sometimes

vast quest
drowsy helm
#

I use it in my own plugin it works fine

plain quest
#

wait..

vast quest
#

idk it was just so much of a pain for me

vast quest
drowsy helm
#

Yeah thing with protocolLib is theres not many tutorials or documentation for it

#

surprising for how big and widely used it is

vast quest
#

yep

drowsy helm
#

but onc eyou get the hang of packets it becomes second nature

vast quest
#

and the things that are there like

#

yeah you do this

#

and this

#

and now we made minecraft

plain quest
drowsy helm
#

can you patsebin pls

vast quest
#

no on e is oging to download that

plain quest
vast quest
drowsy helm
#

sounds counter intuitive lmao

quaint mantle
vast quest
#

its

#

nulls

quaint mantle
#

?

drowsy helm
#

whats on line 47

#

in WorldHandler

quaint mantle
#

instance.getServer().createWorld(new WorldCreator(worldName));

#

the worldName is P4vlyi so the name isnt null

#

and the world copies itself too

drowsy helm
#

the npe is far past that

#

it's in nms code

#

question is why

quaint mantle
#

yeah idk

vast quest
#

[ParticleManager] ProtocolLib was found and its features are enabled! this message makes me smile

#

anyways imma spend the next hour or so reloading from my console to watch that message

drowsy helm
#

lmao

plain quest
vast quest
#

buboo

#

do u know a good update checker

#

seems like my one doesnt work

#

:d

drowsy helm
drowsy helm
#

i dont work with auto updating stuff so im not familiar

vast quest
#

not autoupdate

#

but more just

drowsy helm
#

update checker

plain quest
#

@drowsy helm it's for listening to PakcetPlayOutPlayerInfo and then overriding the skin data sent to change a player's skin

vast quest
#

sending a notificaiton if there is a update

drowsy helm
#

and add a fake one for them

#

with your desired skin

plain quest
#

i also want the client to see their skin not only the others

drowsy helm
#

yeah?

#

would still do that

minor garnet
#
    @EventHandler
    public void EntityInteract(final PlayerInteractAtEntityEvent event) {
        if (!(event.getRightClicked() instanceof ArmorStand)) return;
        final Player player = event.getPlayer();
        final ArmorStand click = (ArmorStand) event.getRightClicked();
        final String armorname = click.getCustomName();
        if(!armorname.startsWith("loot")) return;
        final String[] name = click.getCustomName().split(":");
        LootManager.loot.stream().filter(e -> e.getName().equals(name[1])).findFirst()
        .ifPresent(e -> LootManager.pickup(player, click, e.getItem()));;
    }```

it has been reported that if you click the support armor several times very quickly, it gives the player a glitch to receive the item several times
vast quest
#

Any clue why this doesnt work

quaint mantle
#

what doesnt work about it

drowsy helm
#

It never occurred to me that you can declare two things in a try with resources

cinder thistle
drowsy helm
minor garnet
minor garnet
cinder thistle
#

streams are slow, try not to use them for events and such

#

their best use is on startup and shutdown, etc.

minor garnet
#

aaah then i ned user for ?

cinder thistle
#

?

minor garnet
#

''streams are slow''

#

then i need use a for each for it ?

drowsy helm
#

yeah

cinder thistle
#

use a for loop instead, yes

quaint mantle
vast quest
#

it just doesnt work

#

nvm tho I think I just messed up the sendinmg apart

#

in the main class

#

oh ye

#

I jujst emssed upo sebnding

#

Question: How can I check if the name of the plugin has -beta at the end

#

and how can I send centered message

drowsy helm
#

why name

#

you can check version

vast quest
#

oh

drowsy helm
#

and pad each side of the message with spacing, have to make a method for it

ebon peak
#

jo guys I'm a newcomer to java I need help with the Config.yml

vast quest
#

im not on the update rn im just checking if there is -beta so I can say that it might be unstable and stuff

drowsy helm
vast quest
ebon peak
#

I have a small plugin program what it is about with Antibuild and I have added a / build command, but I want to change & 7LobbySystem to & 6LobbySystem in the Config.yml file for example

quaint mantle
#

wdym

ebon peak
#

i need a Config.yml to change the Prefix for LobbySystem i didnt want to change it in my program i want to change it in the Config.yml

quaint mantle
#

could use this

vast quest
#

so uh

#

how can I detect if at the end of the plugins version there is a -beta text

#

??

eternal oxide
sullen dome
#

two ways:

if(version.endsWith("-beta"))
if(version.substring(10).equals("-beta"))```

first one is obv easier
#

and second one is hardcoded shit

vast quest
#

yeah realised that

#

:d

solemn shoal
#

how can i invert this?

#

guess i could expand it to a full lambda

lilac dagger
#

Files.isDirectory(the lambda function params);

#

wait expand?

eternal oxide
#

!

solemn shoal
#

yeah

#

path1 -> !Files.isSymbolicLink(path1)

quiet ice
#

You could use ::isFile iirc

cinder thistle
#

^

vast quest
#

how can I loop thru a config section

maiden briar
#

FileConfiguration#getConfigurationSection().getKeys(false) in a for

solemn shoal
#

how can i return an array in a collector?

#

im trying to run stuff in parallel

rotund pond
#

Hey, is there any difference between HumanEntity and Player ?

young knoll
#

Generally no

solemn shoal
#

i mean

#

HumanEntity represents the entity

young knoll
#

I always unsafe cast to player, Iโ€™ve never had an issue so far

rotund pond
#

I'm wondering if I have to do

if(e.getWhoClicked() instanceof Player)  {

}

before :/

solemn shoal
#

not really

young knoll
#

Itโ€™s not a bad idea

solemn shoal
#

its not like entities can click in their inventory lol

young knoll
#

I mean player is an entity too

solemn shoal
#

no i mean

#

non-player entities

young knoll
#

Iโ€™m not sure why this event returns HumanEntity

#

Probably to keep it inline with vanilla

rotund pond
#

Mh m'okay

#

Well I think i'm gonna check if it's a player to be safe

#

Thank you guys

thorny bridge
#

is it possible to get a completely random material from an itemStack

eternal oxide
#

an ItemStack has ONE material

#

if you want a random Material create an array/List of the ones you want an pick a random one

thorny bridge
#

ok thx

rotund pond
#

or a random int and use Material.getId() ?

eternal oxide
#

Not good as you can get Materials that should never be used

rotund pond
young knoll
#

No itโ€™s because numeric IDs are dead

rotund pond
#

wdym ?

young knoll
#

Minecraft switched entirely to namespaced keys

carmine laurel
#

Hi everyone i am looking for a plugin that allows me to teleport using an item. best would be to save a location by clicking the item ( like when you use an empty map) and by klicking the item a second time you are beeing teleported and the item is consumed. does anything like that exist ?

rotund pond
#

aaah okay ty

wraith rapids
#

well

#

everything does still have an id

#

it's used in the protocol

#

but now it's like dynamically generated from the registry or some shit

opal juniper
#

Can i intercept the chunk generation?

#

like as in, only gen blocks that are x = 100

#

for example

eternal oxide
#

there is a populator event you can intercet

opal juniper
#

Ok

#

thankls

lone sandal
#

Whats the best way to load a plugin after vault and also all types of economy plugin that run on vault?

cinder thistle
#

Add load before to plugin.yml

lone sandal
#

i was thinking of doing load before but it would mean i need to list all types of economy plugins out there

cinder thistle
#

loadbefore: [Vault]

lone sandal
#

will depend: work?

opal juniper
#

no

lone sandal
#

i see thx man

wraith rapids
#

if you want to load your plugin after vault, you need to add vault as a depend

#

if you want your plugin to load before vault, you need to add vault as a loadbefore

#

listing plugins as depend or softdepend ensures that those plugins are loaded before yours

livid tundra
#

if I refer to an item in a list, can I change it?
ItemStack[] list_of_equipment = {someentity.getEquipment().getItem(EquipmentSlot.HEAD)};
itemstack[0].setType(material.LEATHER_HELMENT)
so, does the code above change the armor the someentity is wearing or not.

wraith rapids
#

it changes the armor that is in the list

#

but it does not change the armor that is on the player

livid tundra
#

ok

wraith rapids
#

unless explicitly documented, everything that gets you an itemstack is always a clone

#

meaning that changes to it won't be reflected on the thing you got it from

livid tundra
#

does this Gets the ItemStack at the given equipment slot in the inventory. mean it gets the actual itemstack?

wraith rapids
#

like i just said

#

it gets a clone of that itemstack

#

a copy

livid tundra
#

is there a way to change the armor using a list?

sullen dome
#

there should be #setHelmet() and stuff

wraith rapids
#

PlayerInventory::setArmorContents

#

takes an ItemStack[]

sullen dome
#

true, thats existing too

wraith rapids
#

he asked this question yesterday and choco or someone gave him the same answer

#

i'm pretty sure he's illiterate though so not like that helps

livid tundra
#

no, I asked for help using the list in an if methood

wraith rapids
#

someone asked these very same questions yesterday

#

in very similar broken engrish

sullen dome
#

so 80% of that discord? lol

wraith rapids
#

i don't remember if it was you, but it was probably you

livid tundra
#

it was me

sullen dome
#

interesting

livid tundra
#

but the questions weren't exactly the same

wraith rapids
#

yes, you improved your machine translation a bit

sullen dome
livid tundra
#

they were both relating to the list, but one was about using it in an if condition, while this one is about actually changing it(i asked that yesterday, but this time it's using a different method to change it)

quaint mantle
#

would a lot of player skulls cause a relatively small map to lag?

wraith rapids
#

does
list_of_equipment[x] = new Itemstack(armor)
just change the list pointer, or the actuall armor

#

define lag

quaint mantle
#

client lag

wraith rapids
#

yes

#

the client is shit tier spaghetti

sullen dome
#

player skulls should be handled like entities

wraith rapids
#

having to fetch the skull skins from mojang freezes the client momentarily

quaint mantle
#

yeah but like consistent lag?

wraith rapids
#

every time your client loads a chunk with skulls in it, there's some jitter

quaint mantle
#

when you are in those chunks

wraith rapids
#

well, skulls are super heavy on fps

#

similar to chests

quaint mantle
#

true

wraith rapids
#

a little worse

quaint mantle
#

it's mostly that I cannot notice it so I took so long to figure out what would be causing it

#

for other players

sullen dome
#

i remember having about 1k entities on the enderdragon-island

wraith rapids
#

affects low end machines with poor gpu's like shit

sullen dome
#

wasn't that funny for my pc

#

thats probably the reason why cyberpunk has such a bad performance

wraith rapids
#

cyberpunk has such bad performance because modern developers don't know how to optimize anything

sullen dome
#

thats true as well

wraith rapids
#

cyberpunk probably runs on fucking electron in javascript because that made it multi platform

sullen dome
#

idk

#

it runs on my rx580 with ryzen5 3600 with about 30fps.

on lowest settings

quaint mantle
#

something like this many skulls just clicked for me

sullen dome
#

thats not how it should be

quaint mantle
#

been having this problem for the testers like since we had the map made months ago

wraith rapids
#

i'm not seeing that many skulls

quaint mantle
#

each floor has pretty much skulls so yeah now it all makes sense

sullen dome
#

yeah, if you make a big public server, you have to make sure, that players with bad pc's can play as well

#

or with low-to-middle-class systems

quaint mantle
#

it's a mcc like event not really public

#

but still better reducing lag causing things for the client side too

wraith rapids
#

i run a slimefun server, and slimefun is a shitty plugin impl of a stripped down ftb modpack

#

almost all of the machines are skulls

sullen dome
#

isn't there a client yet that really improves performance?

wraith rapids
#

so people have enermous fucking arrays of thousands of skulls

sullen dome
#

not like badlion, that just SAYS it does

wraith rapids
#

literally every base tanks my fps to like 3 now

#

shit like this

sullen dome
#

GOD

#

why would you do that

wraith rapids
#

that's an auto crafter array

#

it makes most of the items in ze game automagically

sullen dome
#

if you really have to use so fucking many skulls, use a server resourcepacks, and use ingame-skulls like creeperhead, etc

wraith rapids
#

there aren't enough vanilla skulls

#

there are like 200 different machines and each of them has a different texture

sullen dome
#

tf

#

how to crash minecraft-clients be like

wraith rapids
#

the plants are also skulls

sullen dome
#

can't spigot optimize that, so it's loaded only one time? or is that a fully clientside problem?

wraith rapids
#

clientside

sullen dome
#

saaad

wraith rapids
#

the client has to fetch the skins for the skulls

#

and the client's rendering engine can't handle them very well

sullen dome
#

MOJANG, FIX THAT

quaint mantle
#

imagine using skulls instead of custom textures

#

I mean yeah the client can still prefer to not use them but the performance is on a different scale

sullen dome
#

god

#

thats a hell amount

wraith rapids
#

yeah one of the core principles of the server is that you can build shit as big as you want

#

which is pretty rare among slimefun servers

#

since the plugin author is a fucking tard and couldn't make shit run properly if his life depended on it

#

i basically rewrote half of the internals because otherwise the server would die

sullen dome
#

how can i optimize that? if i can

wraith rapids
#

what are you even doing

sullen dome
#

i am putting the player's permissions into a map, because people are hating, because i read them from config every time

#

and i thought reading them from a map is better

wraith rapids
#

are you trying to write a permission plugin

sullen dome
#

a small api for my own server, yeah

wraith rapids
#

why though

sullen dome
#

because i dont like the existing permissions plugins

eternal oxide
sullen dome
#

dont ask why

wraith rapids
#

i guarantee you it will be several orders of magnitude more shit than the existing plugins

#

no matter how much effort you put into it

sullen dome
#

so what?

#

we all should stop coding, because there's better stuff? lmao

wraith rapids
#

are you writing it as an excercise

sullen dome
#

i am writing it to use it.

wraith rapids
#

you should use good stuff

sullen dome
#

why tho

wraith rapids
#

because using bad stuff is worse than using good stuff

sullen dome
#

all the perms plugins have stuff that i will never need

#

80% of that is not needed

wraith rapids
#

sounds like not invented here syndrome

sullen dome
#

tf

#

i asked a question

worldly ingot
sullen dome
#

so maybe you could answer my question, instead of just saying use other stuff

wraith rapids
#

no

sullen dome
#

if you don't have to say something about my question, dont say anything

worldly ingot
#

no he's right though in this case. you have no reason whatsoever to reinvent the wheel ;p

#

don't waste your time

sullen dome
#

so i should use a plugin instead that laggs my server to hell with functions i dont need?

wraith rapids
#

here comes elgar telling you to use groupmanager

eternal oxide
#

GroupManager, Luckperms, or if you want really basic, BukkitPerms.

worldly ingot
#

are you experiencing lag at all?

wraith rapids
#

lmao

sullen dome
#

because thats what the permissions plugins are doing at my server

worldly ingot
#

lol what a call out haha

sullen dome
#

and idk why

#

but they are

eternal oxide
#

He knows me too well ๐Ÿ˜‰

wraith rapids
#

i use pex

#

and i've never seen it lag

sullen dome
#

pex is not availabe

worldly ingot
#

that's still around?

wraith rapids
#

i don't know, the jar is from like

sullen dome
#

for like years now

wraith rapids
#

2015

eternal oxide
#

Spigot has permissions.yml

worldly ingot
#

was gonna say, i haven't used it since i ran a server back in 1.8

wraith rapids
#

it's just been lying around for over half a decade and I haven't bothered to change it

sullen dome
#

yeah, but without a proper permissions plugin you cannot add permissions iirc

wraith rapids
#

cause it works fine

sullen dome
#

you can give a player OP, that's all

wraith rapids
#

it only occasionally loses data about random players and corrputs the entire permissions.yml file

worldly ingot
#

minor inconveniences

opal juniper
#

So, i wanna make a terraria style world gen plugin (ie 1 block wide). I have found some info on making a custom Terrain generator, however i wondered if the generator could inherit all the normal data like caves and villages and stuff but then just select, lets say x = 0

wraith rapids
#

bukkit's world generator api is kinda trash

#

the underlying system has been changed by mojang several times and little to nothing remains of the system the API was originally written to reflect

opal juniper
#

Right....

wraith rapids
#

which results in something bulky and cancerous and aneurysm inducing to work with

#

you're almost better off just skipping the api and hooking directly into whatever's happening underneath, if you can find a guide or someone to help you with it

#

or god forbid write a datapack

quaint mantle
#

yeah I had over 1200 skulls in those chunks

opal juniper
#

ok, i mean i have been looking around and i haven't really found much

wraith rapids
#

if I ever have to work with world generation i'll probably just throw the notion of procedural generation into the trash bin and pregenerate an entire world with just the regular bukkit api, without touching generation itself

#

it's going to be super slow and inefficient but at least I won't die from fucking anal cancer while writing it

#

plus procedural generation has its share of conceptual issues

#

you often don't have enough information at hand to make things like large structures look good, because nearby areas aren't generated yet

opal juniper
#

I mean, all i want to do is take the default chunk and wipe out 93% of the blocks

wraith rapids
#

there is a way to delegate chunk generation to the vanilla generator, but I don't think you can actually do stuff with the result

#

maybe if it's as simple as just deleting most of the blocks it could be done

#

then again you could just write a chunk load listener that does the same if the chunk is fresh

opal juniper
#

Actually a shout

#

what is the best way of destroying most blocks?

wraith rapids
#

you could look into what worldedit does, but there are a couple of resources for faster setting of blocks out there

opal juniper
#

i saw 7smile7's guide a while back

wraith rapids
#

though most of the time you don't really get much benefit unless you skip light updates, which make stuff not look very good

opal juniper
#

i mean, you could just skip them and then send it at the end?

wraith rapids
#

sending it involves calculating it

opal juniper
#

oh

#

nvm then

wraith rapids
#

which means you'd have to basically reimplement the lighting engine

#

which is what worldedit and co. do i think

#

light is server side because of plant growth and mob spawns and shit

cold field
#

Guys, quick question. What is adventure API?

wraith rapids
#

chat components

#

but better

cold field
#

Mh, ok so. BossBar, Titles, Json Message etc..

#

right?

wraith rapids
#

those are all applications of chat components, yes

#

all text elements the client shows are chat components

#

adventure is an api for building them

cold field
#

ok, thanks.

cinder thistle
#

Adventure takes a mess and makes it manageable

wraith rapids
#

a mess is a very apt description for what chat components have degenerated into in bukkit

cold field
#

When I often read or write on a file should I have a special class that uses the singleton pattern that make the job or should I use some sort of lock on the file?

wraith rapids
#

depends on what you're doing

cold field
#

the file is created at run-time, read several times and it can be deleted at runtime

wraith rapids
#

what is this file for

cold field
wraith rapids
#

what sort of objects

cold field
#

An object that contains some serialized packets

wraith rapids
#

for what purpose

cold field
#

I need to re-send the same packets even after a reload

wraith rapids
#

to whom

cold field
#

to a player

wraith rapids
#

only a single player

cold field
#

not really ;D

wraith rapids
#

dunno

cold field
#

๐Ÿ˜‚ . Thanks anyway, it was funny

opal juniper
#

If i do Chunk#getBlock()

#

does it have to be absolute coords

wraith rapids
#

no

#

it must not be absolute coords

#

it must be in-chunk coordinates

#

that is, from 0,0,0 to 15,255,15

opal juniper
#

ok

#

thanks

#

What is the best way to set a block to air

#

Cause if i do this

#
chunk.getBlock(x,y,z).setType(MATERIAL.AIR)

I get some physics problems

#

I assume there is some block data to reset or something?

#

And to clarify, when i say physics problems, i mean server crashing physics problems

wraith rapids
#

link crash report

#

or at least the stack trace

opal juniper
#
[18:31:09] [Server thread/WARN]: Tried to load a DUMMY block entity @ BlockPosition{x=391, y=35, z=352} but found not block entity block Block{minecraft:air} at location
[18:31:09] [Server thread/WARN]: Tried to load a block entity for block Block{minecraft:air} but failed at location BlockPosition{x=391, y=35, z=352}
[18:31:34] [Worker-Main-8/WARN]: Worker-Main-8 died
java.util.concurrent.CompletionException: java.lang.StackOverflowError

Then about 223,000 lines of errors

lilac dagger
#

just add the false flag

opal juniper
#

ok

tacit drift
#

How do i get block break particle for a block?

wraith rapids
#

stack overflow ๐Ÿ‘€

opal juniper
#

yeah

lilac dagger
#

are you doing it recuringly?

wraith rapids
#

uuuh i think the uh

opal juniper
#

I tHoUgHt THaT WaS a WeBSItE ThoUgh

#

what

wraith rapids
#

setblock on a chunk border loads the neighboring chunks

#

which fires your event

#

which sets blocks

opal juniper
#

ohhhhhhh

wraith rapids
#

which loads a chunk

lilac dagger
#

lol

opal juniper
#

huhuhuhuhh

wraith rapids
#

remember what I said about procedural generation before

opal juniper
#

๐Ÿ˜ซ

wraith rapids
#

it has its own share of conceptual issues

opal juniper
#

does disabling physics prevent the loading of adjacent chunks?

#

i dont need physics anyways

#

its just air

lilac dagger
#

i think so

#

i mean

wraith rapids
#

mmmmaybe but i think it's more for checking tile entities like doublechests crossing chunk borders

lilac dagger
#

it won't care about those anymore

opal juniper
#

hmm.

wraith rapids
#

and it needs to do a light update, but idk if that loads chunks

#

you can try it ig

opal juniper
#

thanks, i gtg b4 i can test, will test later

#

thanks

#

Is there some nms way that is better?

lilac dagger
#

there is a way

#

without light and such

#

d'you want it?

opal juniper
#

I canโ€™t test, but sure

lilac dagger
#

@Override
public void setBlockFast(Block block, Material type) {
CraftBlock cb = (CraftBlock) block;
Chunk chunk = ((CraftChunk) block.getChunk()).getHandle();
IBlockData data = CraftMagicNumbers.getBlock(type).getBlockData();
chunk.getWorld().notify(cb.getPosition(), cb.getNMS(), data, 0);
chunk.setType(cb.getPosition(), data, false);
}

#

it can load a staggering number of blocks

#

you can optimize it too for better utilizations

opal juniper
#

I think I have seen this b4 actually

#

Thanks

lilac dagger
#

๐Ÿ‘

cold field
#

Calling a Collections.singleton method inside a loop is a bad practice?

lilac dagger
#

it can get pretty bad

#

so i say yes

cold field
#

mh, thanks

sharp bough
#

!varname gets the opposite of a true false variable right? cuz when i do this if (getSpawned(loc) && (getUnlocked(loc) == false) {
it tries to change it to if (getSpawned(loc) && (!getUnlocked(loc))) { but i want to run this when getunlocked == false, not the opposite of it

#

or returns true only when that var is false

young knoll
#

That is correct

wraith rapids
#

! is an unary operator that inverts a boolean

young knoll
#

!boolean is preferable over boolean == false

sharp bough
#

yea it inverts a boolean

#

it doesnt return true when its false

young knoll
#

It does

#

That is what inverting does?

wraith rapids
#

it returns true when it's false

#

it returns false when it's true

sharp bough
#

yea but it returns false when its true

#

and i dont want to run it when its true

#

only when getunlocked == false

wraith rapids
#

what

young knoll
#

if (!getUnlocked) will only succeed if it returns false

sharp bough
#

should i just ignore the suggestion?

lilac dagger
young knoll
lilac dagger
#

everything can be an unary

sharp bough
young knoll
#

Correct

lilac dagger
#

A thingy(A a);

#

interface

#

is unary too

#

isn't it?

sharp bough
wraith rapids
#

if it were static, yes

sharp bough
#

oh

wraith rapids
#

if it's an instance method, it'd be a binary operator

young knoll
#
if (!false) {
  // this will run
}

if (!true) {
  // this will not run
}
wraith rapids
#

since the object it's called on is technically an operand if you look at it that way

#

a zero-parameter instance method would probably be the closest to an unary operator

vague mason
#

why no one uses if(!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!true)

wraith rapids
#

real men use (true ^ var) to invert

lilac dagger
#

but is there a real advantage to it??

wraith rapids
#

looks more 1337

#

probably compiles to the same bytecode as !var, dunno

lilac dagger
#

in java i don't think you can do that

wraith rapids
#

^ is the xor operator

#

you can use it on booleans just fine

lilac dagger
#

it's not treated as a 1 bit

#

it is?

wraith rapids
#

it is

lilac dagger
#

so i can

#

int + boolean?

#

i doubt

wraith rapids
#

no

lilac dagger
#

but still

wraith rapids
#

for not-booleans, it's a bitwise xor, for booleans it's a logical xor

lilac dagger
#

it works for that

wraith rapids
#

booleans get special treatment in a lot of places

lilac dagger
#

it prob makes sense that they let that in java

#

hashes maybe?

wraith rapids
#

wut

lilac dagger
#

i might've got you wrong

#

ohh

wraith rapids
#
boolean bool = false;

boolean boolAfter = bool ^ true;

assert (bool != boolAfter);
lilac dagger
#

you mean for when they both the same

#

yea

#

got it

#

that's why i was confused

#

cause of type safety

wraith rapids
#

booleans get special treatment

#

it's the only primitive that isn't upcasted to int/long automatically

devout estuary
#

How can i get the user total playtime?

String executorPlayTime = String.valueOf(executor.getStatistic(Statistic.PLAY_ONE_MINUTE));
devout estuary
#

Yes, but that's not working

#

07.05 21:50:32 [Server] ERROR Could not pass event PlayerJoinEvent to HttpPoster v4.3
07.05 21:50:32 [Server] INFO java.lang.NoSuchFieldError: PLAY_ONE_MINUTE

lost matrix
#

What version are you on?

devout estuary
#

java is 1.8

lost matrix
#

spigot version

devout estuary
#

1.16.5

#

using maven

wraith rapids
#

uh

lost matrix
devout estuary
#

owo

lost matrix
#

Is your server also running on 1.16?

#

Not just the project

devout estuary
#

no, my server is 1.12.2

wraith rapids
#

๐Ÿ‘€

#

gee

lost matrix
#

Big brain moves ๐Ÿ˜„

devout estuary
#

tought it was back compatible

#

opsi

wraith rapids
#

nothing truly is

#

always build for the version you're writing for

lost matrix
#

You can assume forward compatability in most cases. Backwards not so much.

wraith rapids
#

there is zero reason to build for and run in a different environment, anyway

devout estuary
#

So... is there another way without storing manually user time?

wraith rapids
#

dunno, yes, probably

#

build against 1.12 and see what the IDE autocompletes for you

quiet ice
#

There is metadata, but idk if that fits

#

Metadata is purged on reload however

wraith rapids
#

the statistic was stored by the player for sure in 1.12

#

but idk if there was api to retrieve it

lost matrix
devout estuary
#

Yup