#help-development

1 messages · Page 427 of 1

kindred valley
#

Decrease the usage of static keyword and anything will be fine.

young knoll
#

Di isn’t that bad

#

But it gets annoying when you need to like

#

Run something 1 tick later deep in the bowels of your code

quiet ice
#

Well it isn't hard if you design a system from scratch

remote swallow
quiet ice
#

But once you inherit something from a codebase that wasn't designed that way it gets complicated

young knoll
#

At least you don’t need it for fricken

#

NamespacedKeys anymore

remote swallow
#

you dont?

tardy delta
#

chatgpt explaining me how git works, in some weeks ill be an expert

#

🥹

young knoll
#

Oh god it has an uppercase

remote swallow
#

how do you make it without a pluginn

young knoll
#

Wait that isn’t even valid anymore

quiet ice
#

what? That namespaced key is not valid?

#

Shit.

tardy delta
#

💀

young knoll
#

Gotta run fast

quiet ice
#

(to be honest I haven't tested that code for like a year now)

remote swallow
#

no one is answering me

#

is it because im not pink anymore

#

i bet it is

young knoll
#

Huh

remote swallow
quiet ice
young knoll
#

I guess it’s Mojang that throws an exception if it’s not all lowercase

quiet ice
#

Or just use a parse method

remote swallow
#

is namespace stringed now

quiet ice
#

Been for a while now

remote swallow
#

huh

quiet ice
#

Due to the minecraft and bukkit namespace

tender shard
#

IJ is so weird sometimes.
How is the "additional parameter" in this constructor related to the enum declaration lol

quiet ice
remote swallow
#

how have i not known

tardy delta
#

bruh is this thing just saying the same thing twice?

tender shard
#

didnt know TPS can go higher than 20 o0

tardy delta
#

its about 20tps

tender shard
#

yeah but it's slightly higher than 20

tardy delta
#

im wondering how to server actually waits for the next tick

tender shard
#

I thought it would never be above 20, only <=

tardy delta
#

no clue, id love to look at the impl but thats probably in the vanilla server

terse ore
quiet ice
#

Doesn't change it

#

It only changes block ticking intervals iirc

remote swallow
#

randomTickSpeed isnt tps

terse ore
#

could you uncap the 20 TPS?

quiet ice
quiet ice
terse ore
#

what would happen if you set it to 40 TPS?

quiet ice
#

What do you think?

terse ore
#

like what does it change

#

what differences would you have being a player?

tender shard
#

nothing very interesting

subtle folio
tardy delta
#

i believe ive already seen that

#

what does waitfor does

subtle folio
#

all mobs wpuld move faster, crops would grow faster, red stone, day time cycles

tender shard
#

this is the wait loop

subtle folio
#

players would feel slower in comparison to the rest of the world

tardy delta
#

ive seen minestom using LockSupport.parkNanos

tender shard
#

same

#
    protected void waitForTasks() {
        Thread.yield();
        LockSupport.parkNanos("waiting for tasks", 100000L);
    }
tardy delta
#

ah

#

i have a feeling yielding the thread can fuck up

quiet ice
#

Though they used to use a special thread so it doesn't wait wrongly

#

But I believe ever since LWJGL 3 it is built-in into LWJGL

tardy delta
#

ive probably been reading about deadlocks for too much

trim lake
#

How can I check if BukkitRunnable is done and rerunit?

tender shard
#

wdym with "done"?

#

do you mean whether it's scheduled? or whether it's currently running it's "run" method?

trim lake
#

I can paste here my Runnable

#

But its kinda complicated mby to understand 😄

#

?paste

undone axleBOT
trim lake
tender shard
#
public class MyRunnable extends BukkitRunnable {
    
    private boolean isRunning;
    
    public boolean isCurrentlyRunning() {
        return isRunning;
    }
    
    @Override
    public void run() {
        isRunning = true;
        
        // Do your stuff
        
        isRunning = false;
    }
}

Do you mean sth like this?

trim lake
#

If player has specific item in main hand I want to rerun runnable. So mby that will help

tardy delta
#

bruh copilot still believes branches are called main but its master now

#

i didnt know either

#

bruh all i had to do was git checkout -b recipes-constructor-change upstream/main why is git that difficult

trim lake
sterile token
#

UnsupporteOperationException: Use BukkitRunnable#runTask(Plugin), but i cant find in the docs which methods run the task delayed

tender shard
#

BukkitRunnable#runTaskLater(plugin, long)

tardy delta
#

uuse the scheduler??

tender shard
#

the Scheduler methods for BukkitRUnnable are deprecated

sterile token
tardy delta
#

no need for bukkitrunnables, use a runnable

sterile token
tardy delta
#

if you need one, use a consumer with bukkitrunnabme

#

that

#

scheduler.runtask(task -> {logic; task.cancel()})

tender shard
#

that's a Consumer<BukkitTask>

tardy delta
#

exactly

#

ive never understood how people like the bukkitrunnable#runX syntax

sterile token
#

🤔

#

runX() is not a method from Bukkit Runnable

tardy delta
#

lambdas look better than anomymous classes

tender shard
#

where X could be "Later" or "Timer" or nothing

sterile token
#

no need to be rude

#

ohh ok

tardy delta
#

too tired to write smth usful

silent topaz
#

Hey, hey! I need help with my entity data sending packet. I'm trying to change a TextDisplay entity's text

#

Here's what I've got so far.. ```java
public void spawnEntity(Player player, int entityId, UUID uuid, Location location) {
ClientboundAddEntityPacket packet = new ClientboundAddEntityPacket(
entityId,
uuid,
location.x(),
location.y(),
location.z(),
0,
0,
EntityType.TEXT_DISPLAY,
0,
new Vec3(0, 0, 0),
0
);
((CraftPlayer) player).getHandle().connection.send(packet);
sendEntityMetadata(player, entityId, List.of(
getMetaEntityText("test")
));
}

public SynchedEntityData.DataValue<Component> getMetaEntityText(String text) {
    return new SynchedEntityData.DataValue<>(5, EntityDataSerializers.COMPONENT, Component.translatable(text));
}

public void sendEntityMetadata(Player player, int entityId, List<SynchedEntityData.DataValue<?>> dataValue) {
    ClientboundSetEntityDataPacket packet = new ClientboundSetEntityDataPacket(
            entityId,
            dataValue
    );
    ((CraftPlayer) player).getHandle().connection.send(packet);
}
#

Spawns it in but the text isn't there

trim lake
#

Can I schedule next runnable after previous one? 🤔
I just made like this:

double ticksDuration = 1.5*20;
             new BukkitRunnable() {            
                int ticks = 0;
                boolean done = false;
                public void run() {
                    if (done) cancel();                    
                    ticks++;
                    // just for waiting xD
                    if (ticks > ticksDuration) {
                        done = true;
                        //Is done, run again or cancel
                    }
                }
            }.runTaskTimer(RoleJob.getPlugin(), 0, 1);
#

mby is not best solutuion 😄

sterile token
#

1000L = 1 ms?

tender shard
#

1000L = 1000

sterile token
#

right

#

I always confuse them

tender shard
#

L just means long, could be milliseconds or ticks or whatever, depends on what you need it / use it for

sterile token
#

right, i need to run it every 1 second = 1000ms

tender shard
#

the scheduler uses ticks, so it'd be 20

sterile token
#

right

tardy delta
#

kinda fun how people believe 1000L has any difference with 1000

trim lake
#

Why Im doing thinks too complicated? Why I didnt do just this instead of running that ever tick...

double ticksDuration = 1.5*20;
             new BukkitRunnable() {            
                int ticks = 0;
                boolean done = false;
                public void run() {
                  //do think evry ticksDuration 
                }
            }.runTaskTimer(RoleJob.getPlugin(), 0, (int) ticksDuration);
tardy delta
#

use the scheduler :)

tender shard
#

e.g.

public class Test {

    static void doSth(long l) {
        System.out.println("Long is " + l);
    }
    
    static void doSth(int i) {
        System.out.println("Integer is " + i);
    }

    public static void main(String[] args) {
        doSth(1000);
        doSth(1000L);
    }
tardy delta
#

well ye

#

i was talking about cases where a long was expected actually, in comparison where a cast happens at runtime

quaint mantle
#

would this work

#
    public void onBrew(BrewEvent e) {
        e.getResults().toArray(new ItemStack[0]);
    }```
trim lake
tender shard
quaint mantle
#

the potion that the player

#

brewed

hazy parrot
#

Doesn't toArray takes supplier

#

?

tender shard
hazy parrot
#

I remember doing toArray(Array[]::new) lol

#

Might be dreaming

tender shard
#

do you maybe mean Stream#toArray(IntFunction<T[]>)?

hazy parrot
#

Oh probably

tender shard
#

the normal List#toArray just takes in any array

#

or nothing, but then it returns Object[]

#

and those can't be casted

#

oh well, in java 11+ List#toArray(IntFunction) also exists

#

kinda weird that the IntFunction exists for streams in java 8 but not for normal collections lol

hazy parrot
#

Probably toArray for collections is inherited from older java's and when added stream api they just didn't care enought

#

Lol

tender shard
#

IJ stores the profiles in the .idea folder

#

might wanna remove that and see if that helps

tardy delta
#

compiler casts it anyways

#

not that it needs an extra i2l instruction

atomic swift
#

how can i create a custom config object like how you can save a ItemStack to the config

halcyon hemlock
#

hi guys

tardy delta
#

oh you are one of those

halcyon hemlock
silent topaz
atomic swift
#

thx

tender shard
silent topaz
# tender shard show the method on how you set the text
        sendEntityMetadata(player, entityId, List.of(
                getMetaEntityText("test")
        ));

    public SynchedEntityData.DataValue<Component> getMetaEntityText(String text) {
        return new SynchedEntityData.DataValue<>(5, EntityDataSerializers.COMPONENT, Component.literal(text));
    }

    public void sendEntityMetadata(Player player, int entityId, List<SynchedEntityData.DataValue<?>> dataValue) {
        ClientboundSetEntityDataPacket packet = new ClientboundSetEntityDataPacket(
                entityId,
                dataValue
        );
        ((CraftPlayer) player).getHandle().connection.send(packet);
    }
tender shard
#

hm I also tried it using new Display.TextDisplay(...), then send a packet, but it also doesn't show anything

quaint mantle
#

how do i pass an instance of my main class

#

Jobs jobs = new Jobs();

#

doesnt work

#

because java.lang.IllegalArgumentException: Plugin already initialized!

young knoll
#

?di

undone axleBOT
tender shard
#

about what?

quaint mantle
#

nvm got it

#

thanks

#

@tender shard

#

do u know what -shaded is

tender shard
#

your artifact with all the dependencies shaded. It should be the same as the .jar that does not end with -shaded

quaint mantle
#

alright got it#

tender shard
#

unless you messed up your maven-shade-plugin's configuration

quaint mantle
#

im still getting this error

#

java.lang.IllegalArgumentException: Plugin already initialized!

#

even though im using


    public BreweryJob(Jobs jobs) {
        this.jobs = jobs;
  }
tender shard
#

that's because you keep doing new MyPlugin(); somewhere

#

show the full stacktrace

quaint mantle
#

oh wait

#

is this causing the issue

#

JobInterface breweryJob = new BreweryJob(new Jobs());

tender shard
#

yes, you must NEVER do new MyPlugin()

#

first, because it's not allowed, and second because it wouldn't be what you want anyway - you want to always use the same instance instead of creating new ones, even if it'd be possible

quaint mantle
#

yeah my bad

#

    public JobManager(Jobs jobs) {
        this.jobs = jobs;
    }
    JobInterface breweryJob = new BreweryJob(jobs);```
#

why doesnt this work

#

Variable 'jobs' might not have been initialized

#

in JobInterface breweryJob = new BreweryJob(jobs);

tender shard
#

because the fields get initialized before the constructor gets called

tardy delta
#

do it in constructor

quaint mantle
#

oh ye

tender shard
#

you gotta do it like this:

private final Jobs jobs;
private final JobInterface breweryJob;

public JobManager(Jobs jobs) {
  this.jobs = jobs;
  this.breweryJob = new BreweryJob(jobs);
}
quaint mantle
#

yep i got it

#

i have this here

#

double breweryPay = config.getDouble("payments." + potionType.name());

#

this is the config

        config = YamlConfiguration.loadConfiguration(configFile);```
#

and this is what the config looks like

#
  MUNDANE: 0.0
  THICK: 0.0
  AWKWARD: 1.0
  NIGHT_VISION: 2.0
  INVISIBILITY: 2.0
  JUMP: 2.5```
tender shard
#

don't use jobs.getDataFolder() + filename

quaint mantle
#

but it always give 0

quaint mantle
tender shard
#

use ```java
File file = new File(getDataFolder(), "filename.yml");

quaint mantle
#

alright

#

is that gonna fix my problem

tender shard
#

depends whether that was the issue lol

quaint mantle
#

i think it was tbhj

#

let me check

tender shard
#

does the actual yaml file inside your server's plugin folder actually has that content you sent, or is that just your config included in the .jar file?

terse ore
#

why do we use Main#getInstance() instead of just accessing Main#instance ?

quaint mantle
#

it works now lol

tardy delta
#

cuz thats the naming convention for getters?

eternal oxide
#

always getter unless its a constant

terse ore
#

is there any reason that isn't standards?

tender shard
#

you could also do that ofc

#

doesn't matter

terse ore
#

okok

tender shard
#

I wouldn't use a public field because otherwise people could change the instance to sth else

#

with a getter you can be sure that people can get the instance, but not set it to sth else

terse ore
#

oohhh

#

that makes sense

tender shard
#

since you obviously can't make it final in this case

quaint mantle
tardy delta
#

💀

#

you can also crash the jvm if you want

tender shard
#

Sure, but then you know you‘re doing sth „illegal“

#

If a field is public is not final, one could assume its allowed to change it

#

If you need reflection, its obvious that you are not supposed to do this

#

It wouldnt be possible to change it to sth else anyway, except for null

#

Unless you create a subclass without calling the constructor but that is even nastier

tardy delta
#

you can always allocate an uninitialized object with Unsafe::allocateInstance

tender shard
#

Yeah

tardy delta
#

but it gets really dirty there

young knoll
#

Nah make it final

#

And set it with unsafe in onEnable

tender shard
#

Great idea

#

Much useful

#

Me like

#

But why in onEnable? Init block!

tardy delta
#

man this world is fucked up

#

💀

regal scaffold
#

A problem occurred evaluating root project 'PrivateMines'.
> Could not get unknown property 'pluginVersion' for root project 'PrivateMines' of type org.gradle.api.Project.

hazy parrot
#

Me when my every class is record

regal scaffold
#

Any gradle gamers

tender shard
#

i like descriptive names for methods.
getSomething() obviously just returns "something".
But "something()"? It could simply return "something", it could also do "something" and return the result

tender shard
quaint mantle
# tender shard Great idea

Bad, the best solution is to create a virtual kernel in where only your application has access, with a virtual ram and that stuff.

regal scaffold
#

Well, I cloned a project on gh and it works for the author

#

Never used gradle, what can I do

tender shard
#

obviously, "something" was an example

sterile token
#

Doing some debug, runTaskLater() isnt scheduling

tender shard
#

it could e.g. be a boolean "invulnerable". calling invulnerable() could e.g. make the mob invulnerable isntead of just returning the existing invulnerability status

#

that's why I think calling it getInvulnareble or isInvulnerable makes more sense

quaint mantle
tardy delta
#

man im outta here

#

gn

hazy parrot
quaint mantle
tender shard
hazy parrot
#

Dude mixed kotlin and java

quaint mantle
tender shard
#

yeah sth like that

sterile token
tender shard
#

wdym

regal scaffold
sterile token
#

yes, the delayed task, is executed every x time

regal scaffold
#

Which one do I click for gralde

#

Just build?

tender shard
#

./gradlew build usually. but not always

#

sometimes you need shadowJar or similar

quaint mantle
tender shard
#

every dev uses different gradle tasks

regal scaffold
#
import me.clip.autosell.events.AutoSellEvent;
#

I assume just like maven I need to install that to gradle?

quaint mantle
quaint mantle
regal scaffold
#

I cloned his project

#

And it works for him...

#

But this is the least descriptive resource in the world

quaint mantle
#

Rule #1 of developer
You can't go to the client and tell your application worked for you (joke)

tender shard
#

he probably has the AUtoSell jar in their local maven repo

quaint mantle
#

oh god, I hate gradle

regal scaffold
#

tf

tender shard
#

me too, but this is not a gradle issue

#

you'd have the same problem with maven

regal scaffold
#

That plugin has like no information

#

I can't even get an API jar

ivory sleet
quaint mantle
#

Anyway, I still don't like gradle

tender shard
#

yeah the AutoSell plugin looks dead

quaint mantle
tender shard
#

I'd message the author and ask if they give you the plugin for free for dev purposes

#

always worked for me

ivory sleet
#

Whyyy u hatin on my gradle :(

tender shard
#

but it looks dead, last update almost a year ago

quaint mantle
regal scaffold
#

It looks dead and so bad

quaint mantle
#

Be maven, be happy

ivory sleet
#

No

quaint mantle
#

Yes

young knoll
#

XML 😨

sterile token
quaint mantle
#

You use gradle and you instantly get problems and head caches. Meanwhile maven users: "I want this dependency sir, install it on my local repo" 🧐 🍷

tender shard
#

gradle is worse than maven in many things, e.g. because the docs are so shitty (and usually outdated), it breaks compatibility on many new updates, and it lacks basic features such as properly shading dependencies without third party plugins

sterile token
#

Graven will be all life better 😂

quaint mantle
ivory sleet
#

Docs arent outdated waat

sterile token
young knoll
#

You technically can shade without an external plugin

ivory sleet
#

And u dont always need to update the wrapper

#

And no it doesn’t lack shading

tender shard
#

can you link the docs pls

ivory sleet
tender shard
#

depends. if you also count the initial setup time... you need to compile 300 times before it's still faster in total

#

also people always compare maven with 1 thread and without build-cache-plugin to gradle, ignoring the startup time and having build cache enabled on gradle

young knoll
#

It takes me basically no time to set up

ivory sleet
#

I mean u can run maven on multiple threads ye

sterile token
#

no shit, Graven is better

ivory sleet
#

U also have incrementa builds on gradle

winged anvil
#

Graven

ivory sleet
#

Graven hmm

quaint mantle
#

Gaben

winged anvil
#

Marven

tender shard
winged anvil
#

where do yall find people that pay for plugins

tender shard
#

on spigotmc

winged anvil
#

ive just been making them for myself now i wanna cash

ivory sleet
#

Ye well I just prefer gradle since its a bit easier to append some functionality on top of the build pipeline

eternal oxide
#

I like a no frills clean pipeline

ivory sleet
#

Everything u can do with maven can be done with gradle and the converse

young knoll
#

Fuck it

#

Ant

tender shard
ivory sleet
#

But for maven u need to sometimes write plugin

#

^

ivory sleet
young knoll
#

I mean they wrote a gradle plugin

ivory sleet
#

Ye

quaint mantle
#

ChatGPT did confirmed our theory

#

Maven is just better

ivory sleet
#

That can be rigged in so many ways 🤨

#

ChatGPT set u up for failure alternatively

quaint mantle
#

My image is fully real

#

I can confirm

regal scaffold
#
Execution failed for task ':shadowJar'.
> Unsupported class file major version 63
#

What shall this mean

#

Like I know what it means, how to fix for gradle, instead

young knoll
quaint mantle
regal scaffold
#

It's there

ivory sleet
#

Its not entirely untrue

winged anvil
regal scaffold
ivory sleet
#

But my point is, its not like gradle nor maven has any features that cannot be implemented within reasonable time

#

Then ofc maven is less usable when it comes to individual configurability

young knoll
ivory sleet
#

Well i mean actually not really

#

Python cant do memory management and low level stuff

tender shard
#

the maven-build-cache extension sped up my build from 1:30 min to 4 seconds

young knoll
#

I mean

ivory sleet
#

Then u’d have to write a py module through some low level code at least

young knoll
#

Gradle needs a plugin for shadow, maven needs one for cache

#

¯_(ツ)_/¯

sterile token
#

What happen when a ConfigurationSeriliazable object, has a null property? Is it saved the object

ivory sleet
#

Almost

#

Gradle can shade on its own

#

Depending on which std plugin u use

sterile token
quaint mantle
#

Everything you do in any programming language can be done in assembly 💀

tender shard
ivory sleet
#

How do u do that with only using Py?

quaint mantle
#

It kinda is

ivory sleet
#

Ofc u can use sth like RMI

#

But that’s implemented natively

#

Which uses low level code directly

#

like java native

winged anvil
ivory sleet
#

So no py can’t operate on the low level the same as CPP

livid dove
tender shard
#

it's your job to write that method

versed canyon
#

Is there any way to detect a player igniting something with a fire charge in BlockIgniteEvent?

#

There's IgniteCause.FLINT_AND_STEEL, but that doesn't trigger for a fire charge

ivory sleet
#

Not in the same way cpp does it

#

If you really want to you’d have to, again, use functions implemented natively

#

Cpp has built in semantics that support these type of low level operations

versed canyon
tender shard
#

np

livid dove
tender shard
#

just use #general

ivory sleet
#

Not a bad idea

#

Ik other servers that have it

livid dove
winged anvil
#

true yall do be chatting

tender shard
#

everything's calling AsyncPlayerChatEvents here

#

that god discord doesn't use Components

livid dove
ivory sleet
#

Raziel, I can bring it up with the others and we’ll see what they think about it

#

Yeah in addition

#

A forums channel would be nice

#

But doubt that’s gonna be added

#

It was brought up some time ago

tender shard
ivory sleet
#

Easier tracking questions

livid dove
tender shard
#

oh you mean this discord forums feature?

ivory sleet
#

yes

tender shard
#

ah I see

torn shuttle
#

yoo alienware is about to drop a 500hz monitor, finally I can get an edge in competitive minecraft pvp

winged anvil
#

wtf

ivory sleet
#

But then again, that’d render spigot forums more useless arguably

tender shard
#

meanwhile MSFS2020 running at 29 fps using RTX 4080

livid dove
silent topaz
#

@tender shard I pulled it off

livid dove
#

The future is now old man lmao

silent topaz
#

TextDisplay with packets

tender shard
silent topaz
tender shard
#

oh ok

torn shuttle
#

btw mfn I did manage to get the modules working, thanks for the help

#

I'm just wrangling how the adapter is meant to work rn

#

also ironically my biggest issue was that I had lingering code I didn't even notice that was completely messing up the maven repos

torn shuttle
#

any recs on how to do the adapter part of it, I heard some back and forth between reflections and not reflections

tender shard
#

wdym with adapter? the thing that creates the proper NMS instance thing?

livid dove
#

Btw ... me and a friend got the bit manipulation for reading raw chunk data (the long arrays in chunk fkles) to work so we can read a every block in a chunk + coords in under a second....

And then we realised this file... that has 4000+ blocks with 20ish unique blocks in it... takes up 3kb of space...

Why the hell do plugin devs not use this for data storage?

young knoll
#

They do

#

Chunks have PDC

tender shard
#
    public static void enableNMS() throws NMSNotSupportedException {
        final String packageName = JeffLib.class.getPackage().getName();
        final String internalsName;
        if (McVersion.current().isAtLeast(1, 19)) {
            internalsName = "v" + McVersion.current().getMajor() + "_" + McVersion.current().getMinor() + ((McVersion.current().getPatch() > 0) ? ("_" + McVersion.current().getPatch()) : "") + "_R1";
        } else {
            internalsName = Bukkit.getServer().getClass().getPackage().getName().split("\\.")[3];
        }
        try {
            nmsHandler = (AbstractNMSHandler) Class.forName(packageName + ".internal.nms." + internalsName + ".NMSHandler").getDeclaredConstructor().newInstance();
        } catch (final ReflectiveOperationException exception) {
          // Ignore this part
        }
        if (nmsHandler == null) {
            throw new NMSNotSupportedException("JeffLib " + version + " does not support NMS for " + McVersion.current().getName() + "(" + internalsName + ")");
        }
    }

this is my weird way of doing it

torn shuttle
#

I did read it

ivory sleet
winged anvil
#

so if I've got some method ```java

public Object getSomeObject() {

try {
  //Some stuff that throws an exception
  //return something
} catch (Exception e) {
  e.printStackTrace();
}

return null
}

Instead of printing the stack trace I should throw anew RuntimeException(e);``` and not return null? And why?

#

gift me knowledge

livid dove
# young knoll Chunks have PDC

I didn't quite mean the chunk itself. I meant the method.

Building jt from scratch using the same storage method. E.g core protect ends up being GBs in size. I did some napkin math.

A 10gb CP file could probs be squeezed into 500mb ish using that storage method

ivory sleet
#

this is a good design question @winged anvil

torn shuttle
versed canyon
tender shard
ivory sleet
#

The general idea is this

tender shard
torn shuttle
ivory sleet
#

If a method cannot fulfill its contract, it should then throw an exception @winged anvil

torn shuttle
#

how do you then store references to the various classes and methods that might use?

hybrid spoke
#

and explain way more

torn shuttle
#

or am I thinking about this incorrectly

versed canyon
tender shard
young knoll
#

I'm confused where you found a 3kb chunk

winged anvil
#

also when do you guys make custom exceptions

tender shard
versed canyon
tender shard
torn shuttle
winged anvil
quaint mantle
#

wtf

ivory sleet
#

Anyway zlaio, iirc effective java also proposes to avoid returning null if possible

#

Because you have to javadoc why null to make it clear

versed canyon
ivory sleet
#

Cause it can be returned cause of different causes

#

for instance Map#get

#

null can mean absence or just null element

winged anvil
versed canyon
tender shard
# winged anvil ok that makes sense thank you

the AbstractNMSHandler is just an interface.

E.g. in the core module:

public interface NMSHandler {
  void doSomethingThatRequiresNMS();
}

Now the 1.19.4 module, depends on core:

public class v1_19_4_NMSHandler implements NMSHandler {
  ...
}

Then in your core module, you Class.forName the correct NMSHandler implementation (with reflection because core cannot depend on the other modules) and save that instance in a field

ivory sleet
#

Optional is nice, a bit handicapped since u dont have present and absent subtypes

winged anvil
#

i dont think that was for me

tender shard
#

yeah it was for @torn shuttle

#

mb

torn shuttle
tender shard
#

yeah, but it only has stuff inside that actually requires NMS, nothing else

torn shuttle
#

yeah that's the not so pog bit I was trying to think my way around

#

I guess for what I'm doing it would be silly to try to avoid anyway, it's an extremely restricted scope

versed canyon
ivory sleet
#

Yea

#

I mean Optional compromises usability for design

versed canyon
#

Agreed, but some lambda functions make it easier to deal with

ivory sleet
#

True

versed canyon
#

Still a pain though lol

tender shard
# torn shuttle yeah that's the not so pog bit I was trying to think my way around

I don't think there's a better way. Well, check out my 1.19.4 and 1.19.3 nms handler. the 1.19.3 e.g. also implements TranslationKeyProvider, while in 1.19.4 I can just use bukkit methods. So instead of having one large NMSHandler interface, you could also create one interface per feature for versions where it requires NMS, then fall back to bukkit on versions that can do it with api

ivory sleet
#

A java semantic that asserts non nullability would be noce

#

Like kotlin

torn shuttle
versed canyon
#

I've been using @urban grotto and @ Nullabe too

winged anvil
#

poor minecraft noob

ivory sleet
#

Oh yeah

#

The annots

torn shuttle
#

alright thanks for the help, if I ever find more than 20 ways of doing pathfinding I'll maybe reconsider what I'm doing

versed canyon
#

Lol wasn't thinking about using @ in chat lol

winged anvil
#

yes i was actually about to ask about those

tender shard
winged anvil
#

do you only use those to signify to others?

ivory sleet
#

Yeah dw they’re used to it craig

#

People do it just every so often

versed canyon
#

lol

torn shuttle
eternal oxide
#

notnull gets pinged a LOT 😄

versed canyon
#

The annotations are good for public funcitons, so others know how to use them

tender shard
winged anvil
#

im not aware on practices used in public repos since i make plugins privately

ivory sleet
#

I have misusage of nullable annots put on error inspection level as to not miss them

versed canyon
#

Well not even a public API, can even be useful in your own code

ivory sleet
#

Indeed

tender shard
#

and contracts ❤️

versed canyon
#

Yeah it's nice because your compiler will warn you if you're passing null to something annoted NotNull

ivory sleet
#

Yuh, the least we can do when java doesnt give us any better tools

winged anvil
#

i will start to implement them

versed canyon
#

It really does help. It was so nice when the Spigot API implemented them

ivory sleet
#

Yeah very nice, i remember once the annot lied, but apart from that, epic stuff

young knoll
#

You can't even make a PR without proper nullability anymore :p

versed canyon
#

Never have to worry if that itemstack is null or Material.AIR

ivory sleet
#

🥲

tender shard
#

contracts are nice, with contract IJ knows this is not null, but without it'll complain it being nullable

versed canyon
#

I need to start using contracts more. Doesn't that let you show range of values in returns and stuff?

ivory sleet
#

Sorta yeah

quaint mantle
ivory sleet
#

Well, it defines assertions of given null inputs, what the method will do then

#

Like throw/return/null

versed canyon
#

I'll check that out, thank you!

sterile token
#

kt 💀

ivory sleet
#

Its good because it also forces api methods to be contracted, that is altering them becomes a bit harder since u want to keep the api compatible, thus it makes u more precautious of how u write ur api

tender shard
#
    @Contract(value = "null, _ -> fail", pure = true)
    public static void notNull(final Object object, final String message) {
        if (object == null) {
            throw new IllegalArgumentException(message);
        }
    }`

this e.g. means that it will throw an exception ("fail") if the first parameter is null ("null") and the second parameter is <whatever> ("_")

#

"pure" means it doesn't change any of the objects that were passed as args

winged anvil
#

isn't that like rust

#

the _

tender shard
#

idk I never used rust

versed canyon
#

Ah I had saw pure before, that makes a lot of sense

quaint mantle
#

yes it is similar in like match clauses

#

_ meaning default

versed canyon
#

"I won't dirty up your referenced objects"

ivory sleet
quaint mantle
#
match int {
    1 => (),
    2 => (),
    _ => panic!()
}
ivory sleet
#

Not only the args, but like also other mutable variables

winged anvil
#

panic!()

#

rust seems so cool

#

i just dont have a reason to use it

tender shard
ivory sleet
#

Yeah, by definition a void method cannot be pure also

tender shard
#

hm well it could be if it only prints out sth

ivory sleet
#

Nope it does alter the state of the system

#

Maybe not within the scope of the method, but an underlying method call def has some side effect

versed canyon
#

So a pure method doesn't alter ANYTHING, it only does calculations on the parameters without modifying them and returns a brand new object

tender shard
#

the jetbrains docs sure pure is intended for methods "that do not change the state of their objects". arguable whether System.out.println changes any state

versed canyon
#

or primitive

ivory sleet
#

PrintStream

tender shard
#

well but returning a new object would also alter the state, since it would allocate memory for a new object, so the whole definition is a bit unprecise

ivory sleet
#

Statelessness, side-effect”less”, purity means in general, you should be able to write down ur function inputs to outputs in terms of a table, aka be able to memorize the output for an input

#

Then in programming this definition is a bit different from the mathematical side

#

Since many methods are shallow pure

#

But deeply speaking, impure

sterile token
#

What cause to a serialible object, not being saved?

versed canyon
#

A pure method for example would be

public int add(int a, int b) { return a + b; }
ivory sleet
#

Yep

ivory sleet
#

My CPU is impure 😔

versed canyon
#

Yeah you're changing the heap, even though that isn't technically addressing a particular object

#

Seems like there wouldn't be too many truly pure methods

ivory sleet
#

yea, but if you only talk as far as the langauge goes then more methods become pure

#

Such as urs

versed canyon
#

Right

young knoll
#

Chaotic evil is to label every method as pure

#

And make sure every method does something to the parameters

ivory sleet
#

👀👀

sterile token
#

That doesnt let them to be saved

ivory sleet
#

plugin.saveConfig()

torn shuttle
ivory sleet
#

no?

sterile token
#

Its a class for config, but the config class works perfect

ivory sleet
ivory sleet
versed canyon
#

plugin.getConfig() uses the default config

ivory sleet
#

How does the save method look verano

young knoll
#

Premium plugins = broke
Free plugins with crypto miners = woke

sterile token
#

My custom file class, extends YamlConfiguraiton

versed canyon
#

Ah

ivory sleet
#

Pretty sure its not supposed to be derived

#

Rather FileConfiguration

sterile token
#

But the point is that my obects are not being saved

ivory sleet
#

getConfig().save(myFile)

#

no?

sterile token
#

hmnn

#

Wait

#

what can cause serialable ojects not saved?

ivory sleet
#

Ur static analyzer didn’t detect that tho

#

Well if u dont save then it wont be saved

#

Idk if there’s anything else

sterile token
#

Im saving it

#

😂

versed canyon
#

It really depends on what and how you are overriding YamlConfiguration

sterile token
young knoll
#

Shouldn’t you be overriding saveConfig

ivory sleet
#

Verano show the FileConfiguraiton class

livid dove
versed canyon
#

You aren't calling super in constructor

sterile token
#

The point is not that, because im using the file on ther plugin and data is saved

#

So must be something else causing the problem

#

As an example, which uses the same file handler, and everything works perfect

ivory sleet
#

How do u use the config serializable objects

ivory sleet
#

Do u register it also?

sterile token
#

yes

ivory sleet
#

or do u use getSerializable?

sterile token
#

Is the first thing on my onEnable()

ivory sleet
#

Ah alr

sterile token
#

I registered it as ConfigurationSerialization

torn shuttle
#

btw once this is done, anyone want a 1.18+ pathfinding api?

sterile token
#

And then im initializing the file

young knoll
#

Doesn’t it also need a deserialize?

ivory sleet
sterile token
#

Yes, needs to be serialize and deserialized

ivory sleet
#

But mojangs framework is good also

#

a bit tightly coupled to entities tho

young knoll
torn shuttle
#

I just want it so I don't have to add the same nms logic to a bunch of my projects, especially since I want to use mappings and I'm also using gradle

#

I'll put it out there when it's ready if I remember I guess

regal scaffold
#
[00:28:22] [Craft Async Scheduler Management Thread/ERROR]: Caught previously unhandled exception :
[00:28:22] [Craft Async Scheduler Management Thread/ERROR]: Craft Async Scheduler Management Thread
java.lang.OutOfMemoryError: unable to create native thread: possibly out of memory or process/resource limits reached
#
    if (percentageTask == null) {
      //Create a new Bukkit task async
      percentageTask = Task.asyncRepeating(() -> {
        double percentage = getPercentage();
        double resetPercentage = mineType.getResetPercentage();
        redempt.redlib.region.CuboidRegion cuboidRegion = new redempt.redlib.region.CuboidRegion(
            mineData.getMinimumMining(), mineData.getMaximumMining());
        if (percentage > resetPercentage) {
          handleReset();
          airBlocks = 0;
        }
      }, 0, 20);
    }

Is this such a bad idea?

ivory sleet
#

Memory leak lol

winged anvil
#

gg

regal scaffold
#

Lovely memory leak indeed but why

#

Wait why is that even async... Shouldn't it just be sync

sterile token
torn shuttle
#

my new keyboard is getting here in like 30h hopefully

#

really looking forward to that

sterile token
#

what can cause serializeble objects not being saved???

#

🤔

eternal oxide
#

an error or not calling save

versed canyon
# sterile token 🤔

When you say you are overriding the configuration, are you overriding plugin.getConfig()?

sterile token
#

no error, and im calling the save method

sterile token
versed canyon
#

Because plugin.getConfig() will NOT return your custom class

eternal oxide
#

then you are calling save on a different instance

sterile token
#

No no i mean i created another class

sterile token
#

Im not doing that

#

I can send code

versed canyon
#

Right, I see that, but that in your class

sterile token
#

warps return the WarpsHandler DI to clarify

eternal oxide
#

your getData() is probably returning a new instance each time

sterile token
#

Its initialized on onEnable()

#

So, i dont understand the reason of it

versed canyon
#

The original code you posted uses plugin.getConfig(), and then saves on that config

#

So you must also be doing something else

sterile token
versed canyon
#

gotcha

#

Ah that's better

eternal oxide
#

Collections.emptyList() returns a immutable list

sterile token
versed canyon
#

Indeed it does

sterile token
#

I didnt thought that was the issue

#

I didnt notice that code

versed canyon
#

Didn't even see that, nice catch

sterile token
#

neither me

#

And i read the code around 5 times

versed canyon
#

I'm surprised that didn't throw a bunch of UnsupportedOperationExceptions though

sterile token
#

Yeah that why

#

It didnt throw any exception

rare rover
#

got another problem 😦
i have this:

dependencies {
    implementation project(':CropMC-API')
}```
 in my CropMC-Core module
but it says the class doesn't exist?
young knoll
#

Are you shadowJaring

rare rover
#

how do that

#

sorry i haven't used gradle that much

#

mostly maven

sterile token
#

Wy?

#

Why didnt you stick with Maven, in terms of dependency maganament its better

rare rover
#

because maven kinda slow. and i wanna learn gradle

#

i mean

#

it ain't that slow

#

but meh

sterile token
#

right

#

in maven you have something called shade

rare rover
#

ye

sterile token
#

Its apply to gradle buts called shadowJar

#

or something like that, i dont use Gradlen sorry

#

Atleast you can have an idea where to start

rare rover
#

so like dependency then apply?

#
dependencies {
    apply {
        project(':CropMC-API')
    }
}```?
sterile token
#

hmn im not sure

#

Tho

#

Sorry man

rare rover
#

no errors

#

no worries

sterile token
#

Nicee

rare rover
#

erm nope

#

the build worked

#

but

#

run didn't

sterile token
#

right, the problem is the next

#

Your src from module a, is not getting included on b, so JVm doesnt find that code

rare rover
#

like it recognizes it but wont add it to the compiled code

sterile token
#

The code is not being added while compiling

rare rover
#

ye

sterile token
#

That why youhave to do a shade to dependencies

rare rover
#

ah

sterile token
#

yeah that

#

I shadowJar

#

Its called

rare rover
#

man

#

o nvm

#

had to add this: id("com.github.johnrengelman.shadow") version "8.1.1"

#

nvm

#

it broke

sterile token
#

also maven in term of dependency its better because Gradlen doesnt allow to install local sources like does maven

#

Meaning that gradlen doesnt have the mvn install <project>

rare rover
#

i think.

#
plugins {
    id 'java'
    id 'com.github.johnrengelman.shadow' version '7.1.0'
}```
#

yeah now it works

sterile token
rare rover
#

now the real question

#

how do i use it for projects

#

since projects are different

sterile token
#

perfect

#

I explain

#

Let say you have this structure

#

.

Project = com.josh.<project>
--> Plugin-API = com.josh.<project>.api
--> Plugin-Core = com.josh.<project>.core
--> Plugin-1.16 = com.josh.<project>

#

right?

wet breach
sterile token
#

Can you help him

sterile token
#

I dont really have much experience to explain him

rare rover
#

sorry again, i've barely used gradle before

sterile token
#

Nai ts okay were are here to learn

wet breach
#

I think you have to manually install into local repo using gradle unlike maven where it is just a simple goal

#

An example you could look at is buildtools

#

Buildtools manually installs the api and server to local repo

sterile token
pliant flame
wet breach
rare rover
#

i could just put it all in 1 module ig

#

or switch to maven

sterile token
wet breach
#

Or maybe magmaguy might know

torn shuttle
#

hm nope still have one last issue with this pom

#

what's up?

wet breach
#

You use gradle?

torn shuttle
#

yeah

#

shading with gradle?

#

it's a pain

sterile token
rare rover
#

okay so

#

it's saying there's no class

#

i got this

#

in my core module

wet breach
#

Yeah someone needs help with it and i dont use gradle so i cant really help with specifics

rare rover
#

this is the error

torn shuttle
#

you def didn't shade anything there

rare rover
#

yes how do i shade?

#

again, never really used gradle before

#

with shadowJar

#

ik that

torn shuttle
rare rover
#

one question how would i relocate a project?

torn shuttle
#

the way it is on there

rare rover
#

right?

torn shuttle
#

that and the bit before the sonatype implementation

#

and it requires some other minor tweaks as listed in the shadow plugin for gradle

#

which you need to use

rare rover
torn shuttle
#

🤷

ivory sleet
#

Yea

rare rover
#

nope isn't showing up in the decompiled version

ivory sleet
#

Looks right

torn shuttle
#

do the archiveclassivier and filename

ivory sleet
#

How do u build the jar?

torn shuttle
#

also

#

you need to shade it

#

not the normal compuilation method

rare rover
#

o

torn shuttle
#

mfn left?

ivory sleet
#

Wrong

rare rover
#

wat do then

torn shuttle
#

shadowJar

ivory sleet
torn shuttle
#

should be a configuration

ivory sleet
#

There’s a screenshot there

#

It shows u how to pull up the gradle tasks

#

There should be a new tab under the gradle window called shadow

#

Expand that tab

#

And run shadowJar

torn shuttle
#

?paste

undone axleBOT
ivory sleet
#

That will give you a jar with the suffix -all iirc

torn shuttle
rare rover
torn shuttle
#

trying to figure this one out, something's wrong I can feel it

ivory sleet
torn shuttle
# rare rover ?

if you set gradle up correctly and refresh it it should give you the shadowJar configuration

rare rover
#

o

ivory sleet
#

And its under shadow, not build

sterile token
#

Progress must be between 0.0 and 1.0 (5.0) any recomendation?

rare rover
torn shuttle
ivory sleet
#

Wym?

#

Yes josh

sterile token
ivory sleet
#

Also josh

rare rover
#

okay

ivory sleet
#

The dependency of urs

torn shuttle
rare rover
#

YEP

ivory sleet
#

It should be compileOnly in case u dont have it at that

rare rover
#

there's the wonderful JDA 13MB plugin

#

let me try to load it rrq

ivory sleet
#

Or no

#

implementation

sterile token
ivory sleet
#

Im dkn dumb

torn shuttle
#

ah

#

it's a %

sterile token
#

oh right

rare rover
#

awesome, can't thank you enough 😘

#

it loaded

ivory sleet
#

Epic

sterile token
torn shuttle
#

I can't figure this one out

sterile token
#

buw how?

eternal oxide
#

0.99 = 99%

torn shuttle
#

.5 is 50%

sterile token
#

The timer goes from 5 to 1*

#

Im really dumb with maths

torn shuttle
#

verano I understand that your work pipeline is you get a commission and then immediately hop on spigot to ask for help on how to do it but this is really basic math

sterile token
#

Im cero math bro

torn shuttle
#

then don't take a project on that requires you to do divisions

eternal oxide
#

its 1/5

sterile token
#

currentTime / 5 right?

eternal oxide
#

no

#

1/current time

sterile token
#

didnt you say that?

#

why 1?

torn shuttle
#

christ

eternal oxide
#

and to run backwards as you want it's 1-(1/current_time)

sterile token
#

ok, but why 1?

eternal oxide
#

because a full bar = 1

sterile token
#

ohh right

torn shuttle
#

verano have they taught you fractions at school yet

sterile token
#

i mean i dont even remember how to calculate % percentaje

torn shuttle
#

yeah no we know that

sterile token
#

I wont lie, im 0 math literally

versed canyon
#

Anyone having an issue where IntelliJ just decides "I'm going to use 100% of your CPU, then crash"?

#

It's getting really, really annoying

torn shuttle
#

saw that one coming a mile away

ivory sleet
#

Not experienced it recently tho

#

But it definitely happens plenty or so over time

versed canyon
#

I'm not sure what triggers it. I'm pretty sure it's indexing, but I'm not sure why it would be indexing when it happens

torn shuttle
#

I don't get it, is there a trick to adding a dependency from a multi module project?

versed canyon
#

Lots of issues posted about it online, but IntelliJ devs don't seem too interested in fixing it

ivory sleet
#

I try to use shared indexing as much as possible, dk if itd help tho

versed canyon
#

I'll look into that, thanks!

torn shuttle
#

and it ain't working out

ivory sleet
#

Ah u depend on other modules?

torn shuttle
#

yeah

ivory sleet
#

Ugh, I know that there is a way to make it work

#

But i havent touched maven for long time

torn shuttle
#

it didn't work for the parents either, but I could bruteforce those with relativePath

ivory sleet
#

Doesnt maven docs go over this

torn shuttle
ivory sleet
sterile token
#

What the issue magna?

ivory sleet
#

I’d rather trust SOF than myself here lol

torn shuttle
#

I need to install it to local?

graceful oak
#

Im disabling changing note block notes by canceling a PlayerInteractEvent when it is a right click on a note block but I still want players to be able to place blocks on and interact with items in their hand with the blocks with right clicks just not change the note any ideas?

torn shuttle
#

oh no lol

sterile token
#

Why long parsing issue?

torn shuttle
#

I'll be damned

#

I think it worked

#

and not in the ways I was expecting either

sterile token
#

Why?

#

If im telling that long 0L

#

Why would cause deserialzing issue?

rare rover
#

why ain't this working?

public static Collection<CommandData> registerAllCommands(@NotNull JDA jda, @NotNull String packageName) {
        Collection<CommandData> data = new ArrayList<>();
        Reflections reflections = new Reflections(packageName);
        for (Class<? extends CropMCSCMD> clazz : reflections.getSubTypesOf(CropMCSCMD.class)) {
            try {
                CropMCSCMD cmd = clazz.newInstance();
                data.add(registerCommand(cmd, cmd.getName()));
            } catch (InstantiationException | IllegalAccessException e) {
                e.printStackTrace();
            }
        }
        jda.updateCommands().addCommands(data).queue();
        return data;
    }```
```java
BotManager.registerAllCommands(jda, "me.outspending.cmds");```
#

shouldn't that get all classes that have implemented the interface?

#

send me a ping when someone replys

#

thanks

graceful oak
#

Is there any way to change the note block in the opposite direction so instead of increasing the note decrease it? I know you can set it but when I try to get the note I cant seem to get an int type at all to be able to set it to the one before even though you can input an int kind of weird?

young knoll
#

getNote has a deprecated getId method

torn shuttle
#

brah

#

how does this default pathfinding work

#

you'd think if I told it to start going to a point it would start going towards that point

young knoll
#

Did you say please

torn shuttle
#

I told it that if it doesn't work I'm going to bed

#

yeah I don't get it

#

I created a goal, it is set to always be true, I made sure the mob doesn't have any other goals, I tell the move to start and I make sure the goal and target of the mob match the goal

#

oh hold up I sense fuckery afoot

graceful oak
#

Are there any events that check for when players change the note of a note block im trying to allow players placing blocks on note blocks but not change the block right now im canceling a playerinteractevent and its stopping the placement

torn shuttle
#

I don't even want to think about how many hours I've spent working on this in the last two days

regal carbon
#

hey, im having a bit of trouble loading a custom yaml file, because it contains Locations which its worlds has not been created yet, but in order to create these worlds i would need the custom yaml file to have been loaded, is there a workaround to this?

wet breach
#

I would probably create a class to create custom location objects that these strings can be fed into which contains a method to create the world upon object creation and then another method to obtain location object so that you dont need to really do any looping except maybe one

torn shuttle
#

alright my new multimodule nms library works and covers everything starting from 1.17.1 which is probably plenty

wet breach
#

It needs more

#

Or at least that is what they will say

torn shuttle
#

meh

#

I make content for 1.18.2 or later anyway

wet breach
#

Yeah at some point it just has to be someone elses problem uwu

torn shuttle
#

anyone know off the top of their heads if entity targets are only applied in a hostile context?

torn shuttle
#

and now the feature fully works

#

what a day

#

I think that took me 20h today

wet breach
torn shuttle
#

that's what I thought thanks

night bronze
#

Where are the tutorial videos?

gaunt relic
#

Hello, is there a method for knowing if an item is placeable? Like, a water bucket is placeable, but it's not considered a block, so Material#isBlock returns false.

ivory sleet
glossy venture
#

nah gradle better

ocean hollow
#

how can i create a bossbar and change its name instead of creating a new one?

quaint mantle
ocean hollow
#

I have paper

maiden thicket
ocean hollow
#

Yes, I know this, but I don’t understand how to change the name, there is no such method. I thought about deleting bossbars and creating them right away, but for some reason it doesn't work for me. Stored bossbars in Hashmap<Player, BossBar>

#

If the player has a bossbar, then I delete it, and create a new one, which is deleted after 3 seconds

#

In fact, it is on the server, it sometimes updates the bossbar, and sometimes not

#

Probably stops working after Schudeler, but why?

kind hatch
# ocean hollow

It's because of how you create your objects.
You are creating a local bossbar instance and storing that in a global map.
The map value is getting overwritten the second time, so when it tries to remove a bossbar, it's actually failing since it's trying to remove one that no longer exists in the map.

vocal cloud
#

Use UUID not Player for your HashMap. Also bossbar has a setTitle according to the docs

ocean hollow
#

lol

#

thanks, guys

tardy delta
#

good morning, would it be a good practice to do smth like this instead of delegating it to the proper class:

class Something extends Reloadable {
  [...]
}
abstract class Reloadable {
  static final List<Reloadable> components = new ArrayList<>();
  
  Reloadable() { components.add(this); }
  
  static void reloadAll() { components.forEach(Reloadable::reload); }

  abstract void reload();
}```
ivory sleet
#

static void reloadAll()?

tardy delta
#

well ye its currently in my main class but i was just thinking

#

its for the dynamic reload impl of my plugin

ivory sleet
#

I’d say the way you do it now is a bit too much of a design compromise

hazy parrot
#

Oh, right, edited

tardy delta
#

i just got out of my bed

#

so id have to register that reloadable impl every time

#

why are we talking about inner classes

#

oh ye

#

if the player is online, it will get the players name

glossy venture
#

you can query the mojang api

tardy delta
#

probably ye

glossy venture
#

i got some code for it somewhere i think

tardy delta
#

why are you working with names and not uuids tho?

glossy venture
#

id def cache the result though

#

if you dont have a util yourself

#

theres some code i had

icy beacon
#

how do i make an entity continuously avoid a player? with what i'm currently doing, it seems as it doesn't care enough after like 5 seconds

public static void addRunAwayPathfinder(final EntityCreature entity) {
  entity.goalSelector.a(0, new PathfinderGoalAvoidTarget<>(entity, EntityPlayer.class, 10, 1.2D, 1.5D));
  entity.goalSelector.a(1, new PathfinderGoalPanic(entity, 1.55D));
}
quaint mantle
#

Who development ?