#help-development

1 messages · Page 1608 of 1

quaint mantle
#

it's normally retrieved from the itemmeta, which I assume ItemStack::getPersistentDataContainer is just a shorthand for

#

but itemmeta is null for air stacks

#

or is this for entities? I guess this is for entities

grim ice
#

this is for

#

players

#

so

#

yes

quaint mantle
#

Yo, any ideas?

grim ice
#

entities

quaint mantle
#

a player is an entity yes

grim ice
#

but

torn shuttle
#

jesus nnya how have you already been banned and already come back in this short amount of time

grim ice
#

but

#

how am i supposed to fix it

torn shuttle
#

how many accounts have you even burnt through at this point

lusty cipher
quaint mantle
#

less than 50%

grim ice
#

if(e.getRightClicked().getPersistentDataContainer() != null

quaint mantle
#

no.

grim ice
#

ok

quaint mantle
#

get is nullable

lusty cipher
#

no, the get call is nullable

quaint mantle
#

not getPdc

grim ice
#

e.getRightClicked().getPersistentDataContainer().get(key, PersistentDataType.STRING) != null

quaint mantle
#

use Objects.equals

grim ice
#

ok

quaint mantle
#

or call equals on the hardcoded string

tacit drift
#

Can I store an inventory to a string somehow?

lusty cipher
tacit drift
#

so that i can store kits easier in configs

grim ice
#

ok that will fix it right

#

if(e.getRightClicked().getPersistentDataContainer().get(key, PersistentDataType.STRING) != null && !e.getRightClicked().getPersistentDataContainer().get(key, PersistentDataType.STRING).equals("handcuffed")) {

quaint mantle
#

use Objects.equals

grim ice
#

o

#

ok

quaint mantle
#

or call equals on the "handcuffed" string

#

that way it doesn't matter if the get method returns null

summer scroll
#

oh, that is so long in one line

lusty cipher
#

could also just create a variable before the if that could be null

#

much easier and quicker conditional then

quaint mantle
#

"handcuffed".equals(e.getRightClicked().getPersistentDataContainer().get(key, PersistentDataType.STRING))

#

Objects.equals("handcuffed", e.getRightClicked().getPersistentDataContainer().get(key, PersistentDataType.STRING))

grim ice
#

thanks ig

quaint mantle
#

Quick question, when compiling a plugin, what's the difference between the jar and the master jar?

grim ice
#

uh

#

bruh

quaint mantle
#

depends on the context

#

do you mean uber jar

grim ice
#

why is NamespacedKey key = new NamespacedKey(Handcuffs.INSTANCE, "handcuff"); throwing an npe

#

tf

lusty cipher
#

Handcuffs.INSTANCE is probably null then

#

for some reason

quaint mantle
#

use dependency injection

grim ice
#

how in the world can it be null

quaint mantle
#

static getter bullshit like what you're doing there runs into these issues

#

Like build.jar vs build-master.jar

#

because you haven't set it to a value yet

grim ice
#

I did

quaint mantle
#

you did, but not yet

lusty cipher
#

instance = this or something probably runs after this new NamespacedKey

quaint mantle
#

execution order is key

#

which is why you should use dependency injection to guarantee it

grim ice
#

o

#

so

#

easiest solution?

quaint mantle
#

pass the handcuffs instance in the constructor

#

and use the passed object instead of the static field

lusty cipher
#

which is called dependency injection

#

or make sure that that initialization happens only after the instance has been created

quaint mantle
#

which you could have googled but were too lazy to

lusty cipher
#

but still stupid questions

grim ice
#

ok ill just google it

quaint mantle
#

Wait so borat, what would the difference be?

#

depends on the context

#

what are you compiling with

#

where are these files

#

in the libs folder

#

showed you a screenshot

#

i'm not seeing a screenshot

#

I dmed you it

#

that screenshot doesn't tell me anything

#

again, what are you compiling with

#

I'm compiling with gradle

lusty cipher
#

are you using any gradle plugins

quaint mantle
#

No, I just built from Intellij

lusty cipher
#

That doesn't make a difference

#

Question still stands

quaint mantle
#

But it's more of a general question, since when I compile plugins I always receive the plugin's name and the plugin's name + master . jar and I wondered what the difference was.

#

No I'm not using any plugins.

#

just gradle build

lusty cipher
#

When using ./gradlew build

#

it will execute build.gradle

#

and in that file

#

there might be plugins declared

#

So it doesn't matter from where you run it

#

It matters what you configured in your gradle buildscript

#

It'd probably be best if you pasted that

undone axleBOT
maiden briar
#

If somebody places a bed down, how can I get both locations for that bed?

grim ice
#

`public final class Handcuffs extends JavaPlugin {
private Handcuffs INSTANCE;

public Handcuffs(Handcuffs handcuffs) {
}

public JavaPlugin Handcuffs(Handcuffs getHandcuffs) {
    return INSTANCE;
}


final RecipesManager recipes = new RecipesManager(this);



@Override
public void onEnable() {
    INSTANCE = new Handcuffs(this);`
quaint mantle
#

i think you might have to ghetto it by looking at the player's facing direction

grim ice
#

is this dependency injection

lusty cipher
#

wtf are you even doing

quaint mantle
#

learnjava

lusty cipher
#

just learn java already my guy

lusty cipher
quaint mantle
#

yeah but the block isn't placed in that event yet

torn shuttle
#

this is a bit janky but would hashMap.keySet().stream().iterator().forEachRemaining((key)-> key.remove()); work? (pseudo-logic here obviously)

quaint mantle
#

you can't get the state or the blockdata yet iirc

lusty cipher
#

Ah yeah, if its the BlockPlaceEvent, you'd have to do it 1 tick later

#

Just like Double chests n shit

torn shuttle
#

does it actually modify the hashmap keys or would this somehow do a deep copy

quaint mantle
#

i'd be placing my bets on a CME

torn shuttle
#

but muh iterator

lusty cipher
#

yeah, it'd be a cme

lusty cipher
#

just use removeIf

quaint mantle
#

what do you need an iterator for

lusty cipher
#

and even if

maiden briar
#

I just try the locations directly next to the bed

#

And get the part

torn shuttle
#

iterator usually bypasses cmes

lusty cipher
#

@maiden briar Remember, do it 1 tick later.

lusty cipher
#

it's safer

maiden briar
#

Why 1 tick later?

quaint mantle
#

removeIf also "bypasses cme's"

lusty cipher
torn shuttle
#

player object

lusty cipher
#

Double chests also only connect 1 tick after

quaint mantle
#

the keySet returned by a map is also a live view of the map's contents

#

removing elements from it causes them to be removed from the map itself

#

so getting the keyset and calling removeif on it should be fine

ivory sleet
#

Why not just keySet().forEach(Type::remove) magma

quaint mantle
#

also a thing but won't remove them from the map

torn shuttle
#

mostly because i wasn't aware that would work tbh

quaint mantle
#

which, I'm not sure if that's what he wants

torn shuttle
#

I've never really played too much with the hashmap methods

quaint mantle
#

noob

torn shuttle
#

🤷 gotta start somewhere

quaint mantle
#

your variables don't make too much sense though

#

nor does anything else

torn shuttle
#

man this class now has some thicc logic

#

I hate it

quaint mantle
#

yeah I'm sure that foreach call tipped the scales

torn shuttle
#

actually damn it I do need to do more than just remove

maiden briar
quaint mantle
#

then use an expression lambda and do the things in it

#

or just use a for loop instead of foreach, that is less gay

#

What's wrong with being gay? 🤔

torn shuttle
#

thiccness thiccifies

quaint mantle
#

who said there's anything wrong with being gay

#

seems like you're homophobic if you're automatically defaulting to a negative connotation

#

perhaps you should check your priviledge

#

Haha yeah, just kidding, it's 2021, so anything has to be equal.

lusty cipher
#

oh no

proper notch
#

If you're using == it might not be equal

#

Smh == users 🤷

quaint mantle
#

java 2020 pride update: change the implementation of Object::equals to final and always return true

#

finally, true equality among all

#

Should have said among us 👀

torn shuttle
#

brah code

//Remove players that have stopped
                bossBars.keySet().removeIf((iteratedPlayer) -> {
                    if (!trackingPlayers.contains(iteratedPlayer)) {
                        bossBars.get(iteratedPlayer).removeAll();
                        return true;
                    }
                    return false;
                });

this is what maintenance nightmares are made of

quaint mantle
#

use an entryset

torn shuttle
#

is entryset an instrument

quaint mantle
#

brah code

//Remove players that have stopped
                bossBars.entrySet().removeIf((entry) -> {
                    if (!trackingPlayers.contains(entry.getKey())) {
                        entry.getValue().removeAll();
                        return true;
                    }
                    return false;
                });
#

entryset is kind of like the keyset, but contains both keys and values

#

so you don't need to do a redundant .get call with the key

torn shuttle
#

that doesn't sound right

quaint mantle
#

you are iterating over bossBar keys

#

then, if a condition is met, you want the value that corresponds to the currently iterated key

#

is this not the case?

grim ice
#

public OnUse(JavaPlugin plugin) {
this.plugin = plugin;
}
private final JavaPlugin plugin;

#

this isnt DI either right]

lusty cipher
#

it is

quaint mantle
#

that's closer to DI

lusty cipher
#

but cant you just google shit

grim ice
#

o

#

poggers

quaint mantle
#

though you should change JavaPlugin to the actual plugin type

grim ice
#

okay

quaint mantle
#

you don't want it to be any javaplugin, you want it to be your plugin

torn shuttle
quaint mantle
#

TheSourceCode YT Tutorials 101

#

yes

#

this is why you call entry.getValue()

#

this gets the value corresponding to the given key

#

you can then call removeAll on the returned value

torn shuttle
#

oh i see what you mean now

quaint mantle
#

entry.getValue() is the same as map.get(key), except that it doesn't have to do a full map query

#

because the entry already stores both the key and a value

hardy swan
#

Guys

grim ice
#

like this?>

quaint mantle
#

no

grim ice
#

o

quaint mantle
#

like I said, change JavaPlugin to your plugin type

#

what is your main class called

grim ice
#

public OnUse(Handcuffs plugin) {
this.plugin = plugin;
}
private final Handcuffs plugin;

torn shuttle
#

huh entryset is a cool way of doing it

#

thanks

grim ice
#

Handcuffs

quaint mantle
#

change JavaPlugin to Handcuffs

lusty cipher
#

well they just sent that

grim ice
#

o so as i did rn

quaint mantle
#

no

#

or yes?

grim ice
#

o

quaint mantle
#

i don't know I might be going blind

torn shuttle
#

must be all the red

lusty cipher
#

so id guess its fine

quaint mantle
#

yeah the last one they sent is fine

grim ice
#

public Handcuffs getHandcuffs() {
return plugin;
} is pointless right

lusty cipher
#

yes

quaint mantle
#

yes; you are only using the field inside the class

hardy swan
#

i think mojang just solved a millennium prize problem

grim ice
#

okay

quaint mantle
#

so you don't need a public getter for it

grim ice
#

poggers

torn shuttle
hardy swan
#

oh is it that old

torn shuttle
#

it's literally one of the first ones

#

I think it was there even in infdev

hardy swan
#

oh indev

#

...

quaint mantle
#

what are you nerds talking about

torn shuttle
#

splash messages

#

and me remembering old mc versions

#

ah, yes, if statements

bossBars.entrySet().removeIf((entry -> {
            entry.getValue().removeAll();
            return true;
        }));
#

I feel like I've really been leveling up my laziness lately

grim ice
#

?paste

undone axleBOT
grim ice
quaint mantle
#

google "java how to read stack traces"

grim ice
#

ik how

torn shuttle
#

sorry I'm in write-only mode

grim ice
#

ok im just lazi il read it my self

hardy swan
#

maybe they don't even know what are stack traces

grim ice
#

i know

hardy swan
#

what is it? 😄

grim ice
#

its a backtrace

hardy swan
#

which part of the document you just sent is the stack trace

grim ice
#

1s

#

OnUse.java:78

#

oooooo nvm

quaint mantle
#

that took awfully long for someone who knows how to read a stack trace

grim ice
#

wdym long

#

my ide w

#

was

#

opening

#

lol'

hardy swan
grim ice
#

he was talking about fixing it

#

thing is

torn shuttle
grim ice
#

ik java but not everything in it, im missing on some stuff

opal juniper
#

Ok so anyone know how tf A* works

quaint mantle
#

you're still programming against the implementation, not the interface

#

private final HashMap<Player, BossBar> bossBars = new HashMap<>();
should be
private final Map<Player, BossBar> bossBars = new HashMap<>();

#

same for the HashSet, the field should be Set

hardy swan
opal juniper
torn shuttle
#

yes

quaint mantle
#

the wikipedia article for A* is good enough iirc

hardy swan
#

don't know lol

opal juniper
torn shuttle
#

bad habits die hard

quaint mantle
#

the removeTrackingPlayer impl can be improved

#

you are doing 3 map queries where you could do one

#

Map::remove returns the value that was removed

torn shuttle
#

get and null check?

quaint mantle
#

if there was no value, it returns null

#

remove the value, nullcheck, and then call removeAll on the value

maiden briar
#
Location bottom = null;
Location top = null;
List<Location> toTry = Arrays.asList(block.getLocation(),
    block.getLocation().clone().add(-1, 0, 0),
    block.getLocation().clone().add(1, 0, 0),
    block.getLocation().clone().add(0, 0, 1),
    block.getLocation().clone().add(0, 0, -1)
        );

for(Location location : toTry)
{
    if(location.getBlock().getBlockData() instanceof Bed bed)
    {
    if(bed.getPart() == Bed.Part.FOOT)
               bottom = location;
    else if(bed.getPart() == Bed.Part.HEAD)
       top = location;
    }
}

Why does this not work? I run this 2 ticks later

quaint mantle
#

the BukkitRunnable in start can be a Runnable or a lambda which would be more readable

#

instead of casting the location components to int in createBossBar, call getBlockX and so on

torn shuttle
#

there's no method shortcut for a remove that has a not null check built into it right

quaint mantle
#

super technically computeifpresent does that but that is probably overengineering things

#

and not any cleaner

hardy swan
#

if (bossBars.remove(player) != null) if you wanna reduce that one line

torn shuttle
#

code golfing my way to a half line plugin

maiden briar
quaint mantle
#

he needs to perform an action on the returned value so he needs an intermediate variable for it

hardy swan
#

ah ok

#

optional

#

but a waste

#

the current is the best

dense goblet
#

is it fine to use assert e.g. for null checks where the variable being null means I really fucked up

quaint mantle
#

asserts don't do anything

#

unless the runtime has a specific startup flag set

dense goblet
#

since it reads nicer than e.g. if(meta == null) return;

quaint mantle
#

which is basically never set

#

in addition asserts blow up with an exception

dense goblet
#

it removes my intellij warnings

#

and I do need the exception

hardy swan
#

intellij != intelligent

dense goblet
#

yea it is overly protective at times

quaint mantle
#

you should always avoid a NPE instead of catching it

honest iron
#

bump

quaint mantle
#

wrap it in Objects.requireNonNull()

hardy swan
#

Optional

quaint mantle
#

optionals aren't the solution to everything

dense goblet
#

nah it is logically impossible for my var to be null in the calling context of the function

quaint mantle
#

or are you responding to that bump that I can't see the original of because ripcord doesn't show replies

#

yes then just wrap it in Objects.requireNonNull()

hardy swan
#

haha

#

kind of slow but yea

quaint mantle
#

or just use your eyeballs to ignore the warning

#

or be hardcore and disable npe warnings

dense goblet
#

I don't like having my code full of yellow

#

so is it better to use assert or requireNonNull

quaint mantle
#

asserts are generally not used in production

dense goblet
#

I just need it to scream at me if by some gamma ray miracle the var is null

quaint mantle
#

requireNonNull does that

dense goblet
#

okay cool

#

ty

quaint mantle
#

it throws a NPE or something if it does by some chance end up being null

dense goblet
#

so calling it once at the start of the function is fine

quaint mantle
#

on anything nullable that you want to ensure is notnull

#

and if it isn't, blow up

dense goblet
#

yea but only once per var not once per access

quaint mantle
#

assuming the var isn't changed in the interim, yes

dense goblet
#
@Override
    public void onUpdateStack(ItemStack stack) {
        ItemMeta meta = stack.getItemMeta();
        Objects.requireNonNull(meta);

        if(hideAttributes)
            meta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES);
        else
            meta.removeItemFlags(ItemFlag.HIDE_ATTRIBUTES);
        stack.setItemMeta(meta);
    }
quaint mantle
#

meta is effectively final here yes

dense goblet
#

looks good ty

hardy swan
#

then what is wrong with using assert notnull?

granite stirrup
#

Does @NotNull even stop null from happening or is it just to signify that it isn't null

quaint mantle
#

that it's not going to blow up

#

unless the environment has a specific startup flag set

grim ice
#

honestly finding ideas to make is harder than making them

dense goblet
#

that's just an IDE thing that has caused me issues w/ compiling if used manually

quaint mantle
#

asserts are entirely ignored by the runtime by default

hardy swan
#

neither is requirenotnull useful in runtime

quaint mantle
#

it is

#

it causes things to explode sooner, rather than later

granite stirrup
#

Has anybody actually found a use for the Unsafe class

quaint mantle
#

making things easier to debug if something does go wrong

#

in this case it makes zero difference, but generally

dense goblet
quaint mantle
#

for example, if you store some input in a field, and don't call requireNonNull on it or check it otherwise, it will only explode once that value is accessed

#

at which point it's probably impossible to tell where that invalid value originated from

granite stirrup
dense goblet
#

yeah its just there to allow people who know what they're doing to bypass some safeguards

granite stirrup
#

I'm pretty sure variables use the unsafe class lmao

#

But I'm not sure on that

quaint mantle
#

ignore the unsafe class

granite stirrup
#

I heard it from some where idk when

quaint mantle
#

you don't know what static does

#

Unsafe is beyond your paygrade

grim ice
#

how to disable fishing particles

granite stirrup
#

Jk idk lol

grim ice
#

If you don't know

#

just don't respond

granite stirrup
#

Well I mean you could always disable particles in your settings?

grim ice
#

That's not what I want

granite stirrup
#

Aren't particles just entitys?

quaint mantle
#

🙈

hardy swan
grim ice
#

Nevermind i found solution

#

packets

pine knoll
#

anyone know why whenever i hit someone every click is 1 hit in pvp without any delay

hardy swan
#

so what do you want

#

a delay?

#

you want one click to be 100 hits?

maiden briar
#
[14:57:15 INFO]: Location{world=CraftWorld{name=Amazon},x=80.0,y=65.0,z=33.0,pitch=0.0,yaw=0.0}
[14:57:15 INFO]: Location{world=CraftWorld{name=Amazon},x=81.0,y=65.0,z=33.0,pitch=0.0,yaw=0.0}

location.getWorld() returns java.lang.NullPointerException?

pine knoll
maiden briar
#
[14:57:15 INFO]: Location{world=CraftWorld{name=Amazon},x=80.0,y=65.0,z=33.0,pitch=0.0,yaw=0.0}
[14:57:15 INFO]: Location{world=CraftWorld{name=Amazon},x=81.0,y=65.0,z=33.0,pitch=0.0,yaw=0.0}
[14:57:15 WARN]: [BedWars] Task #22583 for BedWars v1.0.0 generated an exception
java.lang.NullPointerException: Cannot invoke "org.bukkit.Location.getWorld()" because "first" is null
        at org.mineacademy.fo.Valid.locationEquals(Valid.java:324) ~[?:?]
        at org.mineacademy.fo.settings.YamlConfig$LocationList.toggle(YamlConfig.java:1858) ~[?:?]
        at org.mineacademy.arena.tool.eggwars.ToolBeds.lambda$handleBlockClick$0(ToolBeds.java:106) ~[?:?]
        at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftTask.run(CraftTask.java:100) ~[patched_1.16.5.jar:git-Paper-783]
        at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:468) ~[patched_1.16.5.jar:git-Paper-783]
        at net.minecraft.server.v1_16_R3.MinecraftServer.b(MinecraftServer.java:1427) ~[patched_1.16.5.jar:git-Paper-783]
        at net.minecraft.server.v1_16_R3.DedicatedServer.b(DedicatedServer.java:436) ~[patched_1.16.5.jar:git-Paper-783]        at net.minecraft.server.v1_16_R3.MinecraftServer.a(MinecraftServer.java:1342) ~[patched_1.16.5.jar:git-Paper-783]
        at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:1130) ~[patched_1.16.5.jar:git-Paper-783]
        at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$a$0(MinecraftServer.java:291) ~[patched_1.16.5.jar:git-Paper-783]
        at java.lang.Thread.run(Thread.java:831) [?:?]
hardy swan
#

?paste

undone axleBOT
grim ice
#

?paste

undone axleBOT
grim ice
#

holy fuck

granite stirrup
hardy swan
#

anyways, there is a variable called first that is null at org.mineacademy.fo.Valid.locationEquals(Valid.java:324)

maiden briar
#

Yes I know, but I have never put a null location in

hardy swan
#

well you did

pine knoll
hardy swan
#

nvr doubt the error

chrome beacon
granite stirrup
chrome beacon
#

Just update

maiden briar
#

This is the method from his foundation:

public boolean toggle(Location location) {
            Iterator var2 = this.points.iterator();

            Location point;
            do {
                if (!var2.hasNext()) {
                    this.points.add(location);
                    this.settings.save();
                    return true;
                }

                point = (Location)var2.next();
            } while(!Valid.locationEquals(point, location));

            this.points.remove(point);
            this.settings.save();
            return false;
        }
granite stirrup
#

Well yeah also you could update

pine knoll
#

do u know any plugins

granite stirrup
#

Nope

#

Because most try to stop the cooldown

#

For newer versions

#

Because people like that better for some reason tbh idrc

pine knoll
#

i use 1.12.2 server

hardy swan
chrome beacon
granite stirrup
maiden briar
#

Linenumbers do not equal, but this is the method:

public static boolean locationEquals(Location first, Location sec) {
        if (!first.getWorld().getName().equals(sec.getWorld().getName())) {
            return false;
        } else {
            return first.getBlockX() == sec.getBlockX() && first.getBlockY() == sec.getBlockY() && first.getBlockZ() == sec.getBlockZ();
        }
pine knoll
maiden briar
#

I can't modify this code

pine knoll
chrome beacon
#

... are you using 1.12.2 or 1.8 decide

granite stirrup
pine knoll
#

1.12.2 for the server but im playing on 1.8

granite stirrup
#

If your using 1.8

pine knoll
#

viaversion

granite stirrup
#

Your confusing

#

Viaversion should make it so you can't do that fast

#

You sure you don't have 1.8 server

pine knoll
#

no

granite stirrup
#

Also where did you get your jar?

hardy swan
pine knoll
#

bukkit

granite stirrup
#

Bukkit?

maiden briar
#

Ok, but I also can't change that method

chrome beacon
granite stirrup
#

Bukkit doesn't sell jars

pine knoll
#

get bukkit*

chrome beacon
#

Yeah illeagal upload

pine knoll
#

where am i supposed to get it from

chrome beacon
maiden briar
#

As I can see it removes, so I will try the remove method

#

And it also adds

hardy swan
maiden briar
#

Yes, have to contact the author

grim ice
#

?paste

undone axleBOT
grim ice
#

wtf happened here

chrome beacon
grim ice
#

lmao

hardy swan
#

you know why we can tell that your server ran out of memory?

grim ice
#

why

hardy swan
#

because we read

grim ice
#

dang dude didnt know

hardy swan
#

yea man

kind grail
#

java.lang.OutOfMemoryError: GC overhead limit exceeded here line 43

hardy swan
#

nah he can't spot that

#

for someone who knows what a stacktrace is

kind grail
#

BTW I'm currently creating a way to create plugins in C++

worn sierra
#

what's the point

kind grail
#

Practice C++

lusty cipher
#

with JNI or what

kind grail
#

yep with JNI

lusty cipher
#

but like... ok

grim ice
#

brooo

#

my plugin keeps crashing the heck out of the server

#

lmao

#

how do i make it less ram heavy

torn shuttle
#

oh lord

lusty cipher
#

you might be having a lot of recursion or sth

grim ice
#

wdym

hardy swan
#

he does

worn sierra
lusty cipher
torn shuttle
#

while (true) 💯

grim ice
#

OH FRICK

#

is that why

hardy swan
#

garbage collection cant even handle his memory leak

kind grail
#

x)

lusty cipher
#

i like how you know of their memory leak

#

👍

grim ice
#

a

#

so what do i do

torn shuttle
#

if my code bad?
no
it must be java that is inefficient

lusty cipher
hardy swan
grim ice
worn sierra
torn shuttle
#

make the bad code not bad

grim ice
worn sierra
lusty cipher
kind grail
grim ice
#

please if ur gonna say that just dont respond

lusty cipher
#

but it true

grim ice
#

its not gonna help even by 0.1%

lusty cipher
kind grail
#

GC = garbage collector = memory leak

worn sierra
kind grail
#

The GC takes too much time to do its work

grim ice
#

either help me fix it or just dont respond

#

this wont help at all

lost matrix
#

Whats the problem? 😄

worn sierra
#

you don't even know how to ask for help lmao

hardy swan
#

either send code or dont ask for help

worn sierra
grim ice
#

ok

kind grail
#

There must be somewhere in your code where yo reserved a ton of memory that you did not free

grim ice
#

it prob

#

while(true)

torn shuttle
#

do you guys also get hundreds of chinese users asking for support?

#

there's so many chinese servers

hardy swan
#

did you upload your resource to mcbbs or sth lol

worn sierra
lusty cipher
grim ice
kind grail
#

that's why you avoid using while loops

worn sierra
#

use bukkit schedulers

hardy swan
lusty cipher
lost matrix
grim ice
#

i thought about schedulers

torn shuttle
grim ice
#

ok ill use em

#

i mean my test server is legit 1gb ram

#

so lmo

#

lmao

lusty cipher
#

while (true) will just keep collecting memory

#

you could have a few TB and it will crash at some point

lost matrix
# grim ice ok ill use em

The thing is that minecraft runs on one single thread.
This means that while your code runs everything else has to wait.
So if you run something like
while(true)
The server just stops right there.
If you do something like
Thread.sleep(2000)
The whole server just stops for 2 seconds there

lusty cipher
#

runTaskAsynchronously go brr

worn sierra
#

i mean what about console reader

torn shuttle
#

runTaskAsynchronously go CME

worn sierra
#

isn't it uses another thread

lusty cipher
#

its not just one thread. there's quite a few actually

#

but the thing is that "most" stuff in bukkit runs on the main one

#

which is what they're referring to

torn shuttle
#

did worlds ever get relegated to their own threads?

worn sierra
#

bukkit is 1 threaded then

lusty cipher
#

no worlds use 1 thread

torn shuttle
#

1 for all worlds right

lusty cipher
#

yeha

#

(kinda)

#

there are some small parts which are offloaded

#

but for the most part, yes

#

this is the reason for shit like DimensionalThreading existing

torn shuttle
#

you'd think they would've moved each world to a different thread by now

grim ice
#

Location currentLocation = e.getPlayer().getLocation();
Vector Direction = e.getPlayer().getLocation().getDirection();
Location target = currentLocation.add(Direction);
Bukkit.getScheduler().runTaskTimer(plugin, e.getRightClicked().teleport(target), 20L, 20L);

#

is this right

lusty cipher
grim ice
#

Cannot resolve method 'runTaskTimer(me.hex.handcuffs.Handcuffs, boolean, long, long)'

lusty cipher
#

you use some kind of IDE?

#

Well it would show you what methods exist on the scheduler

#

And then you would know what to call

#

Instead of asking here

quaint mantle
grim ice
#

w h a t

#

im using DI

lusty cipher
#

disregard that comment

#

In case you still haven't figured it out

#

the docs

quaint mantle
lusty cipher
#

It's a stupid question because its simple to search up what the methods are that exist

#

And they have asked a bunch of other questions and seem to know very little Java

quaint mantle
#

lmfao

lusty cipher
#

Well no

#

Because your comment was blatantly false

#

They have a instance of their class

grim ice
#

nvm

quaint mantle
# grim ice w h a t

You'll need to do something like this

        Bukkit.getServer().getScheduler().runTaskTimer(plugin, () -> {
            player.giveExp(100);
        }, 100L, 100L);
        return false;
    }```
lusty cipher
#

Their issue is them calling a function instead of referencing it in a Runnable lambda

grim ice
#

i figured it out

#

Bukkit.getScheduler().runTaskTimer(plugin,() -> e.getRightClicked().teleport(target), 20L, 20L);

lusty cipher
#

don't spoonfeed @quaint mantle

grim ice
lusty cipher
#

still

grim ice
#

i figured it out

#

thanks tho

lusty cipher
#

yeah good

quaint mantle
#

something like this

torn shuttle
#

aw hell yeah only 100 more compile time errors to go

#

which I suspect is the limit before it gives up lol

forest edge
#

I’ve never understood people who try to help but are impatient and get angry at the people they are helping…

grim ice
#

if u dont like helping

#

just dont help

lusty cipher
#

It's a fact

grim ice
#

like im not forcing u to help me

quaint mantle
#

He's asking a question in a public discord asking for help lmfao

quaint mantle
#

😉

grim ice
#

paste

#

?paste

undone axleBOT
grim ice
#

why does it send both the messages

hardy swan
kind grail
lusty cipher
ivory sleet
#

Some stuff isn’t thread safe but not all

quaint mantle
lusty cipher
#

But a lot of stuff is actually totally fine to use async

ivory sleet
#

Yeah toby in a car rn 😐

kind grail
#

Okay ^^

quaint mantle
#

ow okay

grim ice
#

e.getPlayer().sendMessage(ChatColor.GREEN.toString() + ChatColor.UNDERLINE + "Successfully Removed Handcuffs " + ChatColor.LIGHT_PURPLE + ((Player) e.getRightClicked()).getDisplayName());

and
e.getPlayer().sendMessage(ChatColor.GREEN.toString() + ChatColor.UNDERLINE + "Successfully Handcuffed " + ChatColor.LIGHT_PURPLE + ((Player) e.getRightClicked()).getDisplayName());

#

it executes them both

lusty cipher
#

I'd simply assume the event this function is in is being called multiple times

#

Maybe clicking the item 2 times by accident?

grim ice
#

okay ill retry

kind grail
#

add a cooldown

#

to prevent things like that

#

like you have to maintain click to be able to hancuff or remove handcuffs

ivory sleet
#

Also make sure you haven’t registered the listener twice

grim ice
#

how am i even supposed to register it twice though

lusty cipher
#

It's possibly to do pluginManager.registerListener(new OnUse()) twice, by accident

grim ice
#

o

#

i dont think i did that twice

ivory sleet
#

Yea but some people just tend to do that sometimes, just making sure

last harbor
#
try {
    RandomObject object = new RandomObject(); <- this constructor may throw an exception
    map.put(i, object);
} catch (Exception e) {
    e.printStackTrace();
}```
Is there something wrong with putting `map.put(i, object)` in try {}? (it can't throw any exception in this situation)

Should I do it right this?
```JAVA
RandomObject object = null;
try {
    object = new RandomObject();
} catch (Exception e) {
    e.printStackTrace();
    return;
}
map.put(i, object);```
ivory sleet
#

Yes latter

#

But ftr some map implementations can throw unchecked exceptions when passing unwanted arguments. Although you seem to return if any exception happens so allg.

grim ice
#

Okay this prob isnt related to spigot

#

but what are maps and hashmaps (ik its simple java)

ivory sleet
#

Map is an interface

#

HashMap is a Map implementation

grim ice
#

yes it is but what do we do with it

lusty cipher
#

its like a List but instead of an index you use a String or a UUID or something

grim ice
#

o

ivory sleet
#

Well to put it simply, we use HashMaps for its efficient contains, put and remove time complexity

#

But it’s a data structure that maps key to value which are called entries

grim ice
#

o

lusty cipher
#

If you know JSON, this is a Map:

{
  "key": "entry",
  "key2": "entry"
}

The values are keyed so you can easily access them

#

You would use map.get("key") to get the value "entry"

ivory sleet
#

Map is considerably higher level than HashMap which means we can use it to decouple and increase reusability in our code architecture.

#

Plus it’s an interface 😌

hardy swan
#

more like

#

that's why it is an interface

#

XD

last harbor
#

So, does a method which can never throw an exception, in try {}, hurt the performance?

hardy swan
#

exception and performance are not related

#

you can do watever you want in try (don't), and that's ok

kind grail
#

Interface is good

ivory sleet
#

throwing and creating exceptions are mostly performance taking

hardy swan
#

as in doing sth, which will not cause exceptions, in try

lusty cipher
#

Because you have another call inside of the try block, it already exists. Adding another function makes no difference at all, (or so little, nobody really cares).

ivory sleet
#

Yeah tho not really that much of a difference solar, moreover you just don’t want to catch something which you haven’t intended to catch

kind grail
#

I think that correctly handling exception is one of the hardest things to do

hardy swan
#

yea, hence the (don't) XD

ivory sleet
#

(:

kind grail
#

when you are dealing with files and IO exceptions etc.

ivory sleet
#

Razvan just don’t use them as control flow

#

They’re after all exceptions

last harbor
#

all r

hardy swan
#

try not to try

ivory sleet
#

Sometimes try is good

#

Like ridiculously handy

lunar python
#

hey if anyones familliar with the "bedwars rel" plugin can someone give me the modern hypixel shop.yml code

opal juniper
#

What is the best way to compare two Locations

ivory sleet
#

isn’t equals good enough?

opal juniper
#

.equals() ?

lusty cipher
#

ye

opal juniper
#

or ==

lusty cipher
#

.equals

opal juniper
#

okee

#

ill give it a look

#

?

hardy swan
#

?

ivory sleet
#

lol

opal juniper
#

xD

lusty cipher
#

lol

#

but yeah, Location overrides equals

#

even compares pitch and yaw

hardy swan
#

i mean, even if they don't, I'm still on the side of using .equals

#

ABSTRACTION

ivory sleet
#

Yeah

#

== is pretty low level

opal juniper
#

java.lang.NullPointerException: Cannot invoke "com.jeff.spigotsandbox.astar.Node.getLocation()" because "currentNode" is null
bruh

hardy swan
#

ok that's one drawback of .equals() too

#

but still a fan of .equals() ❤️

lusty cipher
#

well then youd just use Objects.equals

ivory sleet
#

Objects.equals

hardy swan
#

ah right

opal juniper
#

lets give it a go

hardy swan
#

forget Objects exists at times

opal juniper
#

did that same shit

#

while (!Objects.equals(currentNode.getLocation(), startNode.getLocation()))

ivory sleet
#

I smell lagspike

opal juniper
#

Bukkit.getScheduler().runTaskAsynchronously()

😎

ivory sleet
#

😌

hardy swan
#

i think that cant save you from GC overload, ok maybe not gc but yea

lusty cipher
#

Consequently, if both arguments are null, true is returned and if exactly one argument is null, false is returned

#

so it shouldn't really throw a NPE

opal juniper
#

i think it is the fact that i do

ivory sleet
#

null == null smiling_face_with_3_tears

opal juniper
#

#getLocation()

young knoll
#

Correct

opal juniper
#

but idk how teh location is null cause that is literally all that is in the constructor

#

so

#

it should be defined no matter wat

lusty cipher
#

but it do be null

opal juniper
#

but WHYYYYYYYY java

#

tell me why

lusty cipher
#

tell me why

hardy swan
#

every time I doubt java, java proves that I'm the shithole

opal juniper
#

?paste

undone axleBOT
opal juniper
#

oh wait

#

i k why

hardy swan
#

wrong

#

you don't

opal juniper
#

at some point the node doesn't have a parent

#

so it gets set to null

hardy swan
#

what is node, an inner class that you implemented?

opal juniper
#

mhm

#

im following a C pathfinding tutorial

hardy swan
#

ohhh

#

graph

opal juniper
#

yeah you think i could implement A* by muhself???

hardy swan
#

I dun think you have to

opal juniper
#

i couldnt find shit

ivory sleet
#

jeff I expected more from you 🤨

#

jk

opal juniper
#

lmaooooo

hardy swan
#

he said jk, he didn't expect anything from you

ivory sleet
#

But yeah I’d have went for the first stack overflow page myself so shouldn’t be the one talking

opal juniper
#

i used the second page of google and didn't find anything

#

i think the problem is that the first Node has no Parent

#

cause it is obviously the source

#

so a quick null check should do the trick

lunar python
#

hey if anyones familliar with the "bedwars rel" plugin can someone give me the modern hypixel shop.yml code

ivory sleet
#

I believe no hypixel code has yet been disclosed

#

Even their configs if they use any

opal juniper
#

people have immitated them

lunar python
#

ik but i need some help with the item shop

opal juniper
#

i know the plugin

#

i have used it before

lunar python
opal juniper
#

i think there was a vid tutorial somewhere that had the code

#

oh i dont remember

#

sorry

lunar python
#

kk wait

#

but

#

@opal juniper uh do u know what vid

#

was it

opal juniper
#

this is like 3 yrs ago

lunar python
#

uh do u remember what u searched

opal juniper
#

i have no clue

lunar python
#

well

#

kk

opal juniper
#

probs just a tutorial installation

lunar python
#

kk

opal juniper
#

WTF now it dont error but it just doesn't do shit

lunar python
#

wait I THINK i got it

#

this ?

opal juniper
#

maybe

#

do sysouts work with a async task 🤔

#

i forget

lunar python
opal juniper
#

system.out.println

shadow eagle
#

ok i really need help, im making a plugin and it says something about an error on line 14 in the console in the server when it is trying to start but i cant find the error.

ERROR Error occurred while enabling HelpfulAdditions v0.2 (Is it up to date?) 30.07 14:11:32 [Server] INFO java.lang.NullPointerException: Cannot invoke "org.bukkit.command.PluginCommand.setExecutor(org.bukkit.command.CommandExecutor)" because the return value of "me.ej.HelpfulAdditions.EJessentials.getCommand(String)" is null 30.07 14:11:32 [Server] INFO at me.ej.HelpfulAdditions.EJessentials.onEnable(EJessentials.java:14) ~[?:?] 30.07 14:11:32 [Server] INFO at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:263) ~[patched_1.17.1.jar:git-Paper-138] 30.07 14:11:32 [Server] INFO at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370) ~[patched_1.17.1.jar:git-Paper-138] 30.07 14:11:32 [Server] INFO at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:500) ~[patched_1.17.1.jar:git-Paper-138] 30.07 14:11:32 [Server] INFO at org.bukkit.craftbukkit.v1_17_R1.CraftServer.enablePlugin(CraftServer.java:527) ~[patched_1.17.1.jar:git-Paper-138] 30.07 14:11:32 [Server] INFO at org.bukkit.craftbukkit.v1_17_R1.CraftServer.enablePlugins(CraftServer.java:441) ~[patched_1.17.1.jar:git-Paper-138] 30.07 14:11:32 [Server] INFO at net.minecraft.server.MinecraftServer.loadWorld(MinecraftServer.java:639) ~[patched_1.17.1.jar:git-Paper-138] 30.07 14:11:32 [Server] INFO at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:306) ~[patched_1.17.1.jar:git-Paper-138] 30.07 14:11:32 [Server] INFO at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1126) ~[patched_1.17.1.jar:git-Paper-138] 30.07 14:11:32 [Server] INFO at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:316) ~[patched_1.17.1.jar:git-Paper-138] 30.07 14:11:32 [Server] INFO at java.lang.Thread.run(Thread.java:831) [?:?] 30.07 14:11:32 [Server] INFO Disabling HelpfulAdditions v0.2 30.07 14:11:32 [Server] INFO HelpfulAdditions is shutting down. Have a good day!

opal juniper
#

does it work when it is async

#

woahhhh

#

?paste

undone axleBOT
shadow eagle
#

oop sry

opal juniper
#

did you put the command in the plugin.yml

ivory sleet
#

Yea jeff I believe it does

#

Idk if it’s actually thread safe

#

Should probably use loggers btw but ye

shadow eagle
lusty cipher
#

it probably works

opal juniper
#

its just nothing is getting printed

lusty cipher
#

though yeah, im quite sure log4j's Logger is thread safe

opal juniper
#

the sysout doesn't do nada

shadow eagle
lusty cipher
#

try Logger.getLogger().info("wirdifs");

ivory sleet
#

Believe paper supports async logging, spigot is still stuck with java logger framework right?

opal juniper
#

will do

lusty cipher
#

just use paper already

opal juniper
#

wait

#

it may be not finding a path

#

and just running still

#

that is very much the case

dense goblet
#

Is there a way of adding an attribute modifier to an item without clearing the default ones?

#

e.g. adding an attack speed modifier to the iron sword without clearing its damage

opal juniper
#

wait thats cause it adds duplicate location nodes back to the List

#

hmm

cold pawn
#

Is it possible to use scoreboard to add a prefix or a suffix to a players name-tag above there head but they cant see it and only certain people can?

quaint mantle
#

are you trying to reimplement an A* algorithm yourself

#

you 100% want your list to be a LinkedList

#

arraylist needs to be resized each time it goes past a certain size and that is very expensive

#

plus removals in the middle of the list involve shifting all of the subsequent elements

torn shuttle
#

if I want to go from

@Override
public void test(){super.test();}

to

@Override
public void test(){
new BukkitRunnable(){super.test();}...
}

but am limited by the fact it's inside of BukkitRunnable, how can I bypass this issue?

#

will this actually work?

@Override
public void test(){
ParentClass parentClass = this;
new BukkitRunnable(){parentClass.test();}...
}
quaint mantle
#

why wouldnt it

torn shuttle
#

because it's really dumb

quaint mantle
#

the only thing you need is for it to be effectively final, so yes any variable final and outside of a interface declaration would work

torn shuttle
#

I mean technically the test method of this is the method it is getitng declared on

quaint mantle
#

why are you inside a bukkitrunnable

torn shuttle
#

has to run later

quaint mantle
#

that doesn't require a bukkitrunnable

#

hey nnyak

torn shuttle
#

nah

quaint mantle
#

why the new account

#

i keep telling you to use lambdas

#

i have a bunch in stock

#

might as well use them

#

ok

summer scroll
#

is that nny? xd

torn shuttle
#

yep

#

and batman earlier

quaint mantle
#

use a lambda; if you for some reason can't, use OtherClass.super.method()

#

but just really, use a lambda

#

it's more readable and less gay than anonymous runnables or bukkitrunnables

summer scroll
#

haha, definitely nny

#

welcome back bro

quaint mantle
#

i've been around for a few days

hybrid spoke
#

with several accounts

quaint mantle
#

despite peoples best efforts

#

discord ban evasion is poopoo

#

yeah, on discord, mods are pretty much powerless to do anything about ban evasion

#

having the servers hosted by a third party is a double edged sword

#

aight

#

lists are mutable in map correct

#

depends on the list

#

arraylist

#

some lists are mutable, some aren't

#

arraylists are very mutable yes

#

mutability is a property of the object; it doesn't matter where it is

torn shuttle
#
Bukkit.getScheduler().scheduleSyncDelayedTask(MetadataHandler.PLUGIN, () -> {
            customBossEntity.spawn(silent);
        }, ticksBeforeRespawn);

you know this is way more of a pain in the ass to declare

quaint mantle
#

in a field, in a map, in a variable

#

mutable is always mutable

#

that is significantly less boilerplate to write and far more readable

torn shuttle
#

yeah but I don't write the boilerplate

#

intellij does

quaint mantle
#

you still have to read it

torn shuttle
#

alt-enter go brrr

quaint mantle
#

i know you like to disagree with me as a habit but for this once just believe me

#

nobody who has worked with the scheduler for longer than 5 days uses anonymous runnables

torn shuttle
#

hey now that's unfair, the only thing I've not budged on is class names

#

I've been working with the scheduler since 2016

quaint mantle
#

and by extension with java

torn shuttle
#

yep

quaint mantle
#

and yet you aren't familiar with maps

torn shuttle
#

yep

quaint mantle
#

you're modifying the map in the iterator

#

don't do that

minor garnet
#

,```[12:12:05] [Thread-7/WARN]: Exception in thread "Thread-7" java.util.ConcurrentModificationException
[12:12:05] [Thread-7/WARN]: at java.util.HashMap$Values.forEach(Unknown Source)
[12:12:05] [Thread-7/WARN]: at vinnydgf.deanloader.bukkit.scheduler.async.TPS_60.update(TPS_60.java:43)
[12:12:05] [Thread-7/WARN]: at vinnydgf.deanloader.bukkit.scheduler.async.TPS_60.run(TPS_60.java:28)

https://paste.md-5.net/yehukeliya.cs

why i get this exception and how i can solve this
quaint mantle
#

read what I said

minor garnet
quaint mantle
#

i don't know

#

you deleted the fucking code

minor garnet
grim ice
#

?paste

undone axleBOT
minor garnet
quaint mantle
#

pretty sure its gotta be synchronized to update asynchronously

#

GunManagement.recoil.remove(player);

#

remove modifies the map

#

GunManagement.recoil.values().forEach

#

values().forEach iterates over it

minor garnet
#

what would be the best option to remove this

quaint mantle
#

use the remove method of the iterator

#

or use values.removeIf() and make value::update return a boolean

minor garnet
#

hmm

#

ok

quaint mantle
#

or clone the values into a different collection and iterate over that collection instead

final monolith
#

someone can give me a example of how to use packets?

quaint mantle
#

unless you're using protocolAPI its gonna be self taught most likely

final monolith
#

i dont want to use any api

minor garnet
#

tá bom danielzinho

final monolith
#

kkkkkkkkkkkk sai daqui br

torn shuttle
#

🇵🇹

quaint mantle
#

long lost friends

final monolith
#

🇧🇷

torn shuttle
#

já não te devolvo o teu ouro

final monolith
#

😡

torn shuttle
#

gastei tudo em fortnite skins

final monolith
#

devolva nosso ouro português

quaint mantle
#

english plz pleadingsheesh

final monolith
#

sorry bro

#

they stolen my golds --_-

torn shuttle
#

we took it fair and square

final monolith
#

-_-

proud basin
#

o

shadow pulsar
#

How?

quaint mantle
#

block is broken, if the block on top is the same type then include that in your event

#

and recursively go though each block on top

shadow pulsar
#

The problem with that is that it does not work with pistons

#

Or if water or lava was to break it

quaint mantle
#

what are you trying to achieve

#

water breaks sugarcane?

shadow pulsar
#

I don't know but I am talking about anything that breaks indirectly from something else

#

I really feel like there should be a proper event for it

quaint mantle
#

there should be proper events for a lot of things, but there aren't

#

i feel like i could pr one 🤔

#

what are we talking about though

#

but i dont feel like doing that stash stuff

shadow pulsar
quaint mantle
#

@shadow pulsar basically you want someone to make the whole thing for you

#

ripcord doesn't support message links

shadow pulsar
#

No

quaint mantle
final monolith
#

trying to change player's name

#

how fix that?

quaint mantle
#

read the error

#

and fix the error

final monolith
#

i saw

quaint mantle
#

there are things like block destroy event or something like that but I don't think they catch all of the reasons why a block might be broken

lusty cipher
#

That error usually came up for me when using an offline account or cracked account

shadow pulsar
#

I'm not really sure how you would make an event like that

final monolith
#

i want to set player's display name to player's prefix - player's nickname

quaint mantle
#

listen for block break, if blocks are above it add them to the list until they are no longer the same type

#

you'll also want to check for piston events

#

block explode events

shadow pulsar
#

That only includes if a player breaks a block

quaint mantle
#

maybe the entity block pickup event

final monolith
quaint mantle
#

and maybe some block decay events as well

#

and probably the block disappear event for good measure

#

maybe physics event too

#

glhf basically

#

on piston, get the block and see if the block relative to the direction is a sugarcane or whatever, then call the method to go though and get every block and add them to the event broken list

shadow pulsar
#

BlockPhysicsEvent was the closest thing I could find but in order to see if a block was broken, you need to use a runnable and if you do that, you can't cancel it

quaint mantle
#

myes

#

the whole thing about causality with block breaks is a pain in the ass

#

and the api doesn't really have any good way of getting around it

still dove
#

Hey, sorry for interrupting. I'm going to develop a custom plugin for my costumer. It's my first time developing a custom plugin. Can someone help me about pricing?

quaint mantle
#

the only way to listen for this is to make it yourself

#

you basically just end up listening to all of the block related events and trying to cobble together some sort of logic for what's actually happening

shadow pulsar
#

Alright. I will try that

final monolith
quaint mantle
#

I had to do something similar once for my rewrite of the slimefun blockstorage

#

the listener class turned out at 500 lines and with 11 event handlers

torn shuttle
#

man I wish I could go to bed just about now instead of working on this

quaint mantle
#

what are you even doing

#

boss bars?

torn shuttle
#

nah that's well done and dealt with at this stage

quaint mantle
#

refactoring your horrible class names?

torn shuttle
#

I'm writing a spawn method that either spawns an entity or pretends it does

#

automatically

quaint mantle
#

is it safe to await a consumer but never receive it?

#

if you intend to await forever, sure

#

ok

torn shuttle
#

specifically it pretends it does so for unloaded chunks so it doesn't rely on loading them, and instead queues a spawn for when the chunks actually loads

#

it's a bit of a pain

quaint mantle
#

so at the end of my function, i have to accept null or it will freeze the main thread

torn shuttle
#

especially since I woke up at 10 pm, yesterday

quaint mantle
#

how are you going to handle them later

#

i mean, I'd assume your code makes the assumption that if the spawn method call doesn't fail, the entity exists and is spawned and its data can be accessed

#

or do you doublecheck the entity's validity everytime you're accessing it

torn shuttle
#

entity validity gets sanitized early on as much as possible and tries to gracefully prevent any further operations from being done

#

this system will primarily be used by entities in a very specific setting in the first place, where failing to spawn is a misconfiguration issue

#

and the locations come preconfigured correctly to prevent these issues from popping up in the first place

#

one annoying thing is that this actually allows worlds to be unloaded / loaded during runtime so I also have to take that into account

cold tusk
#

Hello, I have a problem with my plugin. When I try to connect My database with Class.forName("org.mariadb.jdbc.Driver");,
That happends:

#

If that helps, here is my pom.yml:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>org.example</groupId>
    <artifactId>Coinsystem</artifactId>
    <version>1.0-SNAPSHOT</version>

    <dependencies>
        <dependency>
            <groupId>org.mariadb.jdbc</groupId>
            <artifactId>mariadb-java-client</artifactId>
            <version>2.7.2</version>
        </dependency>
    </dependencies>


</project>
opal juniper
#

hey borat dude

#

u there

quaint mantle
#

w0t

#

hes always here

opal juniper
#

yayyyy

#

so

torn shuttle
#

discord staff is offering a bounty on finding a way to make him not be here

opal juniper
#

GodCipher told me to use a for loop and a linked list

#

instead of a while loop

#

but

#

idk how i can add to the for loop while it is iterating

quaint mantle
#

i'd use a while loop and a queue

torn shuttle
#

four more hours and I can go to bed

opal juniper
#

while queue.hasNext() type shit?

quaint mantle
#

or i guess if you want heuristics a depth first solution is better

torn shuttle
#

this is going to be a 24h day

#

fml

grim ice
#

?paste

undone axleBOT
quaint mantle
#

is this for chunk sections or physical blocks or what do the nodes represent

opal juniper
#

tryna do some A* shite

grim ice
opal juniper
#

but the tutorial was also shite

opal juniper
cold tusk
opal juniper
opal juniper
#

it says it is not found

cold tusk
#

I took it as a dependency

opal juniper
#

so have you included it

#

spigot 1.8.8 🤮

cold tusk