#help-development

1 messages ยท Page 2201 of 1

radiant cedar
#

not when i run anything

tall dragon
tender shard
#

sure, np

#

but as said you should rather compare the squared distance

#

because getting the square root is a bit expensive

warm galleon
#

o

#

i c

humble tulip
#

how does java sqrt numbers? using newton raphson?

tender shard
#

idk, it's a natice functino

warm galleon
#

also for the living entity checking, how would i go about that? also idk if the original entity is living, as this is entity damage by entity and the entity might die

tall dragon
#

entity instanceof LivingEntity

warm galleon
#

o

tardy delta
#

what entities are not living? zombies and stuff?

tall dragon
#

arrows

humble tulip
#

items

tall dragon
#

items

#

falling blocks

#

etc

torn vale
#
    public static HashMap<Location, Material> map = new HashMap<>();

    @EventHandler
    public void onBlockPlace(BlockPlaceEvent e) {
        Block oBlock = e.getBlockReplacedState().getBlock();
        ItemStack blocks = new ItemStack(Material.SANDSTONE, 64);
        e.getPlayer().getInventory().setItem(4, blocks);
        map.put(e.getBlock().getLocation(), e.getBlock().getType());
        BukkitTask runnable = new BukkitRunnable() {
            @Override
            public void run() {
                e.getPlayer().sendMessage(oBlock.getType().name());
                Block blockPos = e.getBlock();
                blockPos.setType(oBlock.getType());
                map.remove(e.getBlock().getLocation(), e.getBlock().getType());
            }
        }.runTaskLater(LobbySystem.getInstance(), 40);
    }```
Is there a way to get the block which was replaced with the block I place in my event? Atm oBlock ist the block I place, not the old one :/
tender shard
tardy delta
#

ah i get it

torn vale
tardy delta
#

mhm comparing locations goes brr

tender shard
#

although wait no

torn vale
tender shard
#

that's also wrong

fossil lily
#

Anyone know why I get an error at line 51 when putting in an ItemStack that isn't an item in an inventory?

tender shard
#

hm then no idea

tender shard
fossil lily
torn vale
tall dragon
#

uhh obviously not

tender shard
tender shard
fossil lily
tender shard
#

the playerjoinevent also doesnt get called when a player quits ๐Ÿ˜›

torn vale
humble tulip
tender shard
humble tulip
#

seems like getBlockReplacedState is supp to work

tender shard
tall dragon
torn vale
# humble tulip

yea ik, but in my case its just the blockstate of the placed block

tender shard
fossil lily
#

also here are the line numbers

slate mortar
#

let us call every event on EVERYTHING that happens

tender shard
#

they want to get the blockdata of the block that is about to be placed

tall dragon
slate mortar
#

right?

#

make me president

tall dragon
#

BlockPhysicsEvent calls everything

#

that should be fun

slate mortar
#

gosh

torn vale
#

so uhm, any solutions?

slate mortar
#

what do you want to do

#

i mean

torn vale
#

I want to get the block that was there before I placed the block

iron glade
#

Anyone knows if a setting for maximum paricle render distance exists?

humble tulip
torn vale
#

for example if I place a block in a grass the block is grass yk?

slate mortar
#

save it somewhere on blockBreakEvent, and then get it on BlockPlaceEvent

torn vale
humble tulip
#

dont get the block from the blockstate

slate mortar
#

yea, the blockstate afaik is the one that was there before

tender shard
# slate mortar imo it should lmfao

let's just call it all the time

new Thread(() -> {
            while (true) {
                Bukkit.getPluginManager().callEvent(new PlayerJoinEvent(Bukkit.getOnlinePlayers().stream().findAny().get(),"lol u joind lol"));
            }
        }).start();
humble tulip
#

the block is always up to data, blockstate is a snapshot of what was there

tardy delta
#

uhm lol

slate mortar
#

that doesnt even work

noble spire
#

I think it might actually

slate mortar
#

you can't use such "default" events

torn vale
humble tulip
#

yep, that's exactly what u need

slate mortar
#

they error out instantly when you enable the server

tall dragon
torn vale
tender shard
noble spire
#

sad fair enough

slate mortar
#

thats what i meant

#

didnt know the name tho

tender shard
#

if you want to listen to all events, you have to do some tiny reflection magic

slate mortar
#

i tried to use BucketEvent before, imo kinda sad it doesnt work

noble spire
#

I was a bit surprised that I got the little eventhandler icon from my ide

slate mortar
#

it requires the use of 20 event handlers in some places

tardy delta
#

lol

slate mortar
#

or maybe just 2... who knows

tender shard
#

EventHandler icon?

#

what icon?

noble spire
torn vale
noble spire
#

that icon

tall dragon
tender shard
#

oh

#

I never saw that icon

noble spire
#

I think it's some kind of custom annotation thing

slate mortar
#

*annotation

torn vale
slate mortar
#

oh nvm

#

whats that icon saying

noble spire
#

I thought it was saying that it's implemented in eventhandler

#

"Go to event declaration"

torn vale
crisp steeple
#

dont talk to me if you dont run on the spigot virtual machine

torn vale
#

I think there is smth wrong with the bytes

humble tulip
#

what mc version?

tall dragon
torn vale
torn vale
slate mortar
tender shard
torn vale
slate mortar
humble tulip
#

cant u just cancel the event?

noble spire
#

(wrong version but still applies)

slate mortar
#

god, time flies so fast

torn vale
tall dragon
#

someone should totally make that for 1.8

#

so we can link it here

slate mortar
#

please

noble spire
torn vale
slate mortar
#

i'm just too broke and lazy to buy that domain tbh

#

lol

torn vale
humble tulip
tender shard
#

IIRC 1.8.0 is about 1 year old older than 1.8.8

#

so it's almost 8 years ago now

noble spire
#

dang there's probably an official list somewhere

slate mortar
#

feels more like 12 years or smt

tender shard
#

I hate having to type this all the time ```xml
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.3.0</version>
<executions>
<execution>
<goals>
<goal>shade</goal>
</goals>
<phase>package</phase>
</execution>
</executions>
</plugin>

#

can't intellij add the executions part automatically?

crisp steeple
torn vale
tender shard
#

noone ever adds the shade plugin without declaring a goal and a phase

noble spire
#

true

humble tulip
torn vale
#

okay, so how can I set the MaterialData again? lol

#

I only can find the method to set the bytes

humble tulip
#

@torn vale u can also just save the state

#

and call state.update 40 ticks later

steel swan
#

would this work?

public class PactCommand implements CommandExecutor, Listener {

like can i implement 2 things like this

humble tulip
slate mortar
#

when registering, just make sure do not initialize it 2 times

torn vale
humble tulip
#

call this one actaully

#

dont set the type

#

just call state.update(true)

torn vale
#

uhm

#

im confused

#

idk what you mean

#

if I dont set the type the block wont get replaced?

humble tulip
#

send ur code

#

?paste

undone axleBOT
torn vale
humble tulip
torn vale
#

ill try, 1sec

#

it works, thank you

humble tulip
#

np

torn vale
#

do I have to understand this? xd

humble tulip
#

so state is a snapshot of the block at one point in time

#

you got that?

torn vale
#

yea

tender shard
dry forum
#

why am i getting this error java.lang.NullPointerException: Cannot invoke "org.bukkit.configuration.ConfigurationSection.getInt(String)" because "sec" is null from String title = e.getView().getTitle(); String[] words = title.split("-"); String name = words[1].replace(" ", ""); Bukkit.broadcastMessage(name); ConfigurationSection sec = fc.getConfigurationSection(name); im trying to get all the text after "-" and get a config section with that text but its saying sec is null, yes 100% the configuration section exists

humble tulip
#

e.getBlockReplacedState() gives you what the block was before it was placed

tender shard
dry forum
#

that doesnt help me though

humble tulip
#

when u use BlockState#update, it basically sets the block back to the blockstate

tender shard
torn vale
#

ohh, that makes sense

humble tulip
#

so since the blockstate is from before the block was plasced, it basically rolls it back

torn vale
#

thank you soooo much!

dry forum
#

yes and im asking WHY i get this error read what i said i dont think i should be getting this error

tender shard
humble tulip
#

there is no section with the name of whatever name variable is

tender shard
#

like three times already now

red sedge
#
ArmorStand armorStand = loc.getWorld().spawn(loc, ArmorStand.class);
        armorStand.setCustomName(Utils.formatString(colour + damage + suffix));

        armorStand.setCustomNameVisible(true);
        armorStand.setGravity(false);
        armorStand.setVisible(false);
        armorStand.setSmall(true);
        armorStand.setBasePlate(false);
        armorStand.setInvulnerable(true);
        armorStand.setSilent(true);
        armorStand.setMarker(true);
        armorStand.setRemoveWhenFarAway(true);````

i have this code to spawn a damage indicaotr, but for a split second the armor stand is visibke how can i fix that
dry forum
dry forum
tender shard
humble tulip
#

well, for some reason the configsection is null, most likely cuz it doent exist

slate mortar
red sedge
dry forum
humble tulip
#

try do debug

dry forum
humble tulip
#

see if the section exsits or something

red sedge
#

fwe things

  1. are you loading the config?
  2. is it updated on runtime? if so are you reloading it?
  3. are you sure it exists and ur accessing it the right way
dry forum
#
  1. yes
  2. what
  3. yes
tender shard
slate mortar
#

2: are you updating your config while the server is running, without restarting/reloading the server

warm galleon
#

is there a way to make arrows not disappear after hitting a target? Also for removing the imunity frames for arrows but not for melee

dry forum
#

yeah? im using fc.save(f); if thats what you mean

red sedge
tender shard
# dry forum ```test: dem: 1``` "test"

is that the content of the config.yml included in your plugin, or did you also actually save that file in the plugino's datafolder? because IIRC you cannot get configurationsections from the default config but maybe I'm also confusing things

dry forum
#

i create the config section after the plugin is loaded there is nothing in the file when the server loads

noble spire
red sedge
#

you're not loading it properly

dry forum
#
                YamlConfiguration fc = new YamlConfiguration();
                try {
                    fc.load(f);
                } catch (IOException | InvalidConfigurationException ex) {
                    throw new RuntimeException(ex);
                }```
red sedge
tender shard
#

instead of doing "getConfigurationSection()", do this for debugging

Object result = myConfig().get("test");
if(result == null) {
  System.out.println("result is null");
} else {
  System.out.println("Class: " + result.getClass().getName());
  System.out.println("toString: " + result);
}
red sedge
#

it has nothing in it

dry forum
#

? im trying to get the configuration for it so i can use fc.getString(etc);

red sedge
#

just for DEBUGGING

#

omigosh

dry forum
#

im talking to u

red sedge
#

oh

#

in that case

#

you're loading the empty file

#

its literally empty

#

and ur not updating it with the new contents

dry forum
#

wdym.? theres test: demo 1

#

im trying to get demo: 1

red sedge
#

Yeah there is test: demo 1 in the file on the hard drive

#

not the memory of your plugin

#

you need to load it again after you change it

dry forum
granite owl
#

am i getting it right that i cant create new particles?

#

with a resource pack

tender shard
misty current
#

can you clear an NbtTagCompound?

tender shard
#

if you do stuff like
getInt("my-int") and the config doesn't include "my-int" then it'll fail because of auto unboxing

vast raven
#

Who could help me?

dry forum
humble tulip
#

well if it isnt there.... its null

tender shard
dry forum
#
  • just tried it with sec.set("test", "d") and im getting the same error
#

so im not getting anything

#

sec is test config section

brittle lily
#

hey Guys I'm setting player Inventory's content to config. but Its setting empty slots too. Ant Its making ItemStack null. How can I set just ItemStacks

red sedge
#

inventory#getContents()

humble tulip
#

if u set a path to a string, it's no longer a config section

tender shard
brittle lily
dry forum
#

its not the path its a thing in the config section

#

test:
test: "d"

red sedge
#

getContents should only return the not null values if im not mistaken

red sedge
tender shard
brittle lily
#

let me send ss

tender shard
#

it's always fixed length no matter if the inv is full or not

#

so you basically want to remove null elements from an array?

#

if so just use Arrays.stream().filter(Objects::notNull).toArray(new ItemStack[0]);

vocal pine
#

Don't know how to set network ID of my thing so it's not shown as a pig to clients ๐Ÿค” Only example I can find means redoing it entirely in a way I don't get

quaint mantle
#

hey does anyone know if org.bukkit.block.Bed exists in 1.8.8 ? It doesnt work on my end... there's probably smth else i could use

#

i dont want the material bed i want the block bed

tall dragon
#

isnt there BED_BLOCK ?

quaint mantle
#

yeah

tall dragon
#

why not store the slot

#

and not store any non existent items

brittle lily
#

I used this

red sedge
#

like when iterating over it

#

just continue if the item is null

tardy delta
#

i'd rather save the slot number too but i forgot how to do so

brittle lily
red sedge
#

no?

#

there are non null items-

iron glade
#

I guess I spawned a bit too many particles xd

brittle lily
#

Okay Let me try something different Thanks Guys

tender shard
tardy delta
#

how many ram do you give it lol

red sedge
tender shard
#

is that even enough to start it? ๐Ÿ˜„

red sedge
#

Ye

iron glade
#

32gb but I think I only allocated 1gb

red sedge
#

well

tardy delta
#

default vm memory is 250mb iirc

red sedge
#

you can start minecraft with it

iron glade
#

it was Mob_Appearance particle I guess the game doesn't like it several hundred times every second

tender shard
red sedge
#

i think the default is 1gb

#

at least the default that minecraft gives

crude cobalt
#

Please tell me how to implement deletion from the database, I tried this way, but I got an error?

public boolean exists(UUID uuid, int type_implant){
        try {
            PreparedStatement ps = im.SQL.getConnection().prepareStatement("SELECT * FROM implants WHERE UUID=? AND ID_OF_IMPLANT=?");
            ps.setString(1,uuid.toString());
            ps.setString(2, String.valueOf(type_implant));

            ResultSet result = ps.executeQuery();
            if(result.next()){
                return true;
            }
            return false;
        }catch (SQLException e){
            e.printStackTrace();
        }
        return false;
    }

This is error:

[22:55:47] [Server thread/WARN]: java.sql.SQLException: Can not issue executeUpdate() or executeLargeUpdate() for SELECTs
timid spear
#

What happened to org.apache.commons.lang.Validate? It does not work anymore on 1.19, but did last on 1.18.2?

radiant cedar
#

playerdata has locations of players where they have left right?

tardy delta
#

close your stuff please

tender shard
radiant cedar
humble tulip
#

Why are u setting an int as string

#

Unless ids in ur db are string

noble spire
#

what's the correct way of loading a custom world created via worldcreator?

brittle lily
#

Guys Its Good ItemBuilder ?

noble spire
tall dragon
brittle lily
#

Can't I use it?

tall dragon
#

of course you can

tardy delta
#

it will work ye but maybe you want to overload it with an amount for the itemstack

tall dragon
#

orrr create a builder

#

๐Ÿ™‚

brittle lily
tall dragon
#

i will make you a very small example

#

you can go from there

brittle lily
tender shard
#

a builder class is usually a class that holds all the required information to create the finished thing, so in your case material, name, amount etc. and then you can turn it into the actual result using .build() or .bake() or however you decide to call that method

tardy delta
#

alex is thinking of food ๐Ÿคค

#

bake da cake

tender shard
#

I'm always only thinking in crack cocaine egg_drool

crude cobalt
# tender shard well SELECT != delete

Sorry, I sent the wrong code. Here is the correct code, but it still doesn't work. Now it doesn't even throw an error.

public void removeImplant(UUID uuid, int id_of_implant){
        try {
            PreparedStatement ps2 = this.im.SQL.getConnection().prepareStatement("DELETE * FROM implants WHERE UUID="+uuid+" AND ID_OF_IMPLANT="+id_of_implant);
            return;

        }catch (SQLException e){
            e.printStackTrace();
        }
    }
tender shard
#

ugh

#

I cant type today

tardy delta
#

use a try with resources

try (Connection conn = getConnection(); PreparedStatement ps = 
    conn.prepareStatement(sql)) {
  // your stuff
}```
#

that will basically call #close on it after the code block finished

tender shard
tall dragon
#

?paste

undone axleBOT
tall dragon
tender shard
#

?potato croquet

tall dragon
#

potato croquet huh

tender shard
#

AbstractItemStackBuilderFactory implements AbstractBuilderFactory<Factory<ItemStack>>

tall dragon
#

oh yessss dude

tender shard
#

so fancy

tall dragon
#

im legit so pleased with this new way of player input i now got

#
ip.rightBlockClick().orTimeout(10, TimeUnit.SECONDS).whenComplete((secondary, throwable2) ->
                    {
                        if (throwable2 != null) {
                            Common.tell(player, "Error: " + throwable2.getMessage());
                            return;
                        }
                        displayTo(player);
                        updateMenu(true);
                    });
#

i can now take player interactions as input easilly

timid spear
#

What happened to org.apache.commons.lang.Validate? It does not work anymore on 1.19, but did last on 1.18.2?

timid spear
#

I am using gradle

noble spire
#

ah idk gradle sorry

tender shard
#

it's still part of spigot

#

are you using spigot-api or spigot?

timid spear
#

But I can't import it properly

#

using spigot api

tender shard
#

because IIRC you need spigot instead of spigot-api for those libs

timid spear
timid spear
#

Thank you

#

It works now ๐Ÿ™‚

tender shard
#

perfect! np

warm mica
tender shard
brittle lily
#

Guys When I set ItemStacks of Items on GUI. Its doesnt setting. but When I set it on Command Class Its setting. Can't I set these Items on another class?

tender shard
#

which you can do by simply decoding the base64 string and then throwing into the URL constructor

tall dragon
#

well a base64 texture is an encoded url so

warm mica
#

Oh wait, for real

crude cobalt
#

I try use this code but it doesn't work

public void removeImplant(UUID uuid, int id_of_implant){
        try {
            PreparedStatement ps2 = this.im.SQL.getConnection().prepareStatement("DELETE * FROM implants WHERE UUID="+uuid+" AND ID_OF_IMPLANT="+id_of_implant);
            return;

        }catch (SQLException e){
            e.printStackTrace();
        }
    }
tender shard
#

oh wait no not exactly

warm mica
#

I always thought it contains the texture itself and not only the url

tender shard
#

the base64 look slike this
{"textures":"https://..."} IIRC

#

I wouldn't worry to use the playerprofile class but instead do it like always

acoustic pendant
crude cobalt
# crude cobalt I try use this code but it doesn't work ```java public void removeImplant(UUID ...

But when I try to check whether this object is in the database, then it is. Code to check:

public boolean exists(UUID uuid, int type_implant){
        try {
            PreparedStatement ps = im.SQL.getConnection().prepareStatement("SELECT * FROM implants WHERE UUID=? AND ID_OF_IMPLANT=?");
            ps.setString(1,uuid.toString());
            ps.setString(2, String.valueOf(type_implant));

            ResultSet result = ps.executeQuery();
            if(result.next()){
                return true;
            }
            return false;
        }catch (SQLException e){
            e.printStackTrace();
        }
        return false;
    }
tall dragon
warm mica
#

The reason why skulls would cause lag in the past was because the server would look fetch for the uuid given by the username, and not the texture itself? While the player later has to fetch the texture again? This sounds like a horrible implementation...

tender shard
crude cobalt
tall dragon
#

huh?

#

how

tender shard
#

how the fuck would you get a local var in a another file

brittle lily
tender shard
#

it creates ItemMeta

tall dragon
#

it creates a new ItemMeta

#

he keeps beating me to the answers

tender shard
#

lol sorry

tall dragon
#

its okay haha

#

were all here to help

#

or get helped

tender shard
#

sometimes I'm just here to annoy people

tall dragon
#

yep

#

thats fun right

tender shard
#

yes lol

brittle lily
tall dragon
#

uhhhh

#

im not sure what you mean

crude cobalt
#

this

public void removeImplant(UUID uuid, int id_of_implant){
        try {
            if(exists(uuid, id_of_implant)){
                PreparedStatement ps2 = this.im.SQL.getConnection().prepareStatement("DELETE * FROM implants WHERE UUID="+uuid+" AND ID_OF_IMPLANT="+id_of_implant);
            }
            return;

        }catch (SQLException e){
            e.printStackTrace();
        }
    }
brittle lily
tall dragon
#

oh yea

#

my mistake

#

its not needed

#

but i did forget

crude cobalt
brittle lily
tender shard
crude cobalt
tall dragon
#

though it is odd getting an SqlException without executing anything

tender shard
#

you are just creating an prepared statement, abusing it by not using the features it provides to actually prepare statements, and then never execute it

tall dragon
#

oh he does call exists

tardy delta
#

๐Ÿคก

tender shard
#

but wtf does "exists" do?

tender shard
#

no they are never executing it. they create the PreparedStatement called ps2 and that's all they do

crude cobalt
#

Then how should i do this?

tender shard
#

then they wait for it to get GCed

tall dragon
#

execute it xD

tender shard
#

yeah lol

crude cobalt
#

What is executeUpdate?

tender shard
#

that's the method you should use to execute the deletion

#

and you should also use ? in your preparedstatement instead of "hard pasting" the UUID etc

#

because otherwise using a preparedstatement in the first place makes no sense

crude cobalt
#

Okay, when i use this code, i have an error

public void removeImplant(UUID uuid, int id_of_implant){
        try {
            if(exists(uuid, id_of_implant)){
                PreparedStatement ps2 = this.im.SQL.getConnection().prepareStatement("DELETE * FROM implants WHERE UUID="+uuid+" AND ID_OF_IMPLANT="+id_of_implant);
                ps2.executeUpdate();
            }

            return;

        }catch (SQLException e){
            e.printStackTrace();
        }
    }
tardy delta
#

you are never closing the stuff either

tender shard
#

for weird reasons I don't currently have access to your computer and so I cannot find out what the error says, so it would be very helpful if you could send it here

tall dragon
#

lmfao

crude cobalt
tender shard
#

you should really just properly use the prepared statements instead

tardy delta
#

you need ' '

#

^^

tall dragon
tender shard
#

just use prepared statements and it will automatically escape the UUID

#

WHERE UUID=?

tardy delta
#

ye just using prepared statements and try with resources and everythings fixed

tender shard
#

and then do setString again

#

like you did with select

tardy delta
#

and use a a proper way to get your connection

#

i can recommend hikaricp

tender shard
#

yes hikaricp is nice

vocal pine
#

is there a good tutorial for a custom item with an interact anywhere

tardy delta
#

im wondering if im using it correctly

#

i could show code

tender shard
vocal pine
#

all i find googling is infinite threads of people asking and getting no response

tender shard
#

senc code

#

send code

vocal pine
tardy delta
crude cobalt
#

This code:

public void removeImplant(UUID uuid, int id_of_implant){
        try {
            if(exists(uuid, id_of_implant)){
                PreparedStatement ps2 = this.im.SQL.getConnection().prepareStatement("DELETE * FROM implants WHERE UUID=? AND ID_OF_IMPLANT=?");
                ps2.setString(1,uuid.toString());
                ps2.setString(2, String.valueOf(id_of_implant));
                ps2.executeUpdate();
            }

            return;

        }catch (SQLException e){
            e.printStackTrace();
        }
    }

This error:

com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '* FROM implants WHERE UUID='6d9d3fea-d7d7-34a1-bd62-117d724b982b' AND ID_OF_I...' at line 1
vocal pine
#

literally cannot find a tutorial on anything to do with items just a load of threads of uselessness

tender shard
#

you can simply listen to PlayerInteractEvent, check if the action is RIGHT_CLICK_BLOCK and then booom squirt out your custom cart into the face of the fucking user who decided to use your item lol

quartz basalt
#

if i have a section called "kits" and i want to change the name to "inventory" instead, how would i do that?

tardy delta
#

isnt the syntax "DELETE FROM ... WHERE"?

tender shard
#

you could identify your custom item by a PDC tag

tender shard
#

DELETE * FROm makes no sense

tardy delta
#

thast the problem then, i always make the same mistake lol

tender shard
#

the * in SELECT to tell people about what columns to select

vocal pine
#

is the problem

#

like thats helpful but i dont even know how to make the item to add the listener to yk

#

i dont know why i cant find it

tender shard
crude cobalt
#

I'm fucking do that, thanks to everyone for putting up with me and my stupid questions

#

I guess it wasn't me who did it, but you)

acoustic pendant
#

In the EntityDeathEvent how can i detect if the entity was killed by a specific arrow?

tardy delta
#

how do you define a specific arrow?

#

check if the killer is an arrow

#

the arrow's shooter a player i guess

#

and idk what makes your arrow specific, pdc tag?

thorny dawn
#

this isnt working?

#

i put it inside the onEnable() method

iron glade
acoustic pendant
iron glade
#

?pdc

acoustic pendant
#

Okay, I'll try that thanks!

tardy delta
#

ye you cant get the itemstack from it

thorny dawn
tardy delta
#

why creating a new bar each time

thorny dawn
#

should i put the bar outside of the for loop?

tardy delta
#

ye

#

and whats not working

thorny dawn
#

makes much more sense

#

lol

#

me in 3am be like

tardy delta
#

maybe you have to do bar.setVisible(true)

#

but ye kotlin

vocal pine
#

Any easy way to check if a block is a rail (any type) in Spigot API (not nms thats easy but not applicable)

ancient plank
#

Tags are pog

vocal pine
#

i see Rail exists in api but dont see how to compare/equal it with the block data

#

thats nms isnt it

ancient plank
#

no

tardy delta
#

is there a Tags.RAIL?

ancient plank
#

ye RAILS

vocal pine
#

huh

tardy delta
#

Tag*

tender shard
#

Tag.raiwels

vocal pine
#

welp yeah turns out i was using exactly that in another place but via NMS as BlockTags

#

Lol

ancient plank
#

when in doubt check tag

tardy delta
#

check if Tag.RAILS.isTagged(material)

vocal pine
#

wicked thats super easy thanks

lethal coral
#

would this be an appropriate place to ask about an issue I'm having with making web pull requests to github (in java)

chrome beacon
#

Yeah we can help with that

lethal coral
#

?paste

undone axleBOT
lethal coral
#

https://paste.md-5.net/likutukoze.cs
this successfully creates the new branch, uploads the files and commits, but a pull request is not created (and the rest (deleting old branch and merging pull request) isn't completed)

#
Exception in thread "main" java.lang.NullPointerException: Cannot invoke "com.fasterxml.jackson.databind.JsonNode.asText()" because the return value of "com.fasterxml.jackson.databind.JsonNode.get(String)" is null
    at me.hapily.downloadfromgithub.PullRequest.getPullNumber(GitHubUtil.java:229)
    at me.hapily.downloadfromgithub.PullRequest.execute(GitHubUtil.java:116)
    at me.hapily.downloadfromgithub.DownloadFromGithub.main(DownloadFromGithub.java:29)
#

that's the error

tardy delta
#

the thing is null

chrome beacon
#

^

tardy delta
#

ah its more complicated than that

chrome beacon
#

Line numbers don't match so I guess you're trying to read a string from a json that doesn't exist

lethal coral
#

229 is the asText() method

chrome beacon
#

Yeah that line was my guess

#

What does your sysout say

lethal coral
#

nothing ๐Ÿ’€

chrome beacon
#

Well there you have the issue

#

You're trying to get the value number from nothing

lethal coral
#

yes and I'm wondering how there's nothing when I'm providing the required values

#

and the expected response contains number

chrome beacon
#

Are you reading the response right

lethal coral
#

yes...?

#

and the pull request isn't even being created in the first place

chrome beacon
#

Print pullRequestResponse and see what that value is

winged anvil
#

Is there a way to deny the collection of a slot when a double click occurs? I want to have the double click act as normal but disallow collecting from this one singular slot.

tardy delta
#

check the click type i guess

#

and cancel the event according to that

winged anvil
#

yes but if i cancel the event the double click doesnt happen at all

winged anvil
#

i still want it to work normally, but just not collect from a defined slot

chrome beacon
lethal coral
#

well

#

this api's example was with only one file

#

as you can probably tell

#

Do you think making all those commits could be making it slower?

#

woah that is a massive difference in speed (I tested with only one file provided for the new branch)

#

okay I need to figure out how to commit all of these files at once

dusk flicker
#

git add multiple files?

#

or just like, git add .

vocal pine
tender shard
#

you should never convert strings using ==

vocal pine
#

unfamiliar with java so whats the better way

tender shard
#
if(someString.equals("whatever")) { ...
vocal pine
#

thanks :) ill change it

tender shard
#

and before you get the pdc value, first check if it actually exists

ancient plank
#

never >:(

tender shard
#

so basically do sth like this before getting the string from the pdc

if(pdc.has(plugin.railKey, PersistentDataType.String)) {
#

actually checking if the tag exists should be enough

#

you dont actually need the content

vocal pine
#

is it ok to do that like
if(pdc.has(plugin.railKey, PersistentDataType.String) && pdc.get(plugin.railKey, PersistentDataType.STRING).equals("isRailcart:true")) {

#

in java

#

well i guess thats pointless to ask now but still good to know

tender shard
#

as said, if you use "isRailcart:true" as value all the time anyway, you don't have to check it. just check if the "plugin.railKey" tag exists at all

vocal pine
#

yeah

lethal coral
vocal pine
#

thanks for all ur help ๐Ÿ‘ should be more than enough to do the rest off as a basis

tender shard
#

np ๐Ÿ™‚

winged anvil
#

alex you got a post for nbt tags?

tender shard
#

I only got a post telling you not to ever use NBT but go for PDC right away ๐Ÿ˜›

winged anvil
#

i cant use pdc i dont think

tender shard
#

that's a pity. but no I neither a post about NBT, nor have I ever used it myself lol

winged anvil
#

if i set an nbt tag on an itemstack it wont be stackable with its others right?

#

oh nvm

tender shard
#

you can do the same with PDC

winged anvil
#

mmmm

tender shard
# lethal coral why

because it's useless to use any NMS methods if the API allows the same thing in a better way

winged anvil
#

if i set pdc on an itemstack it wont stack with its others of the same type?

tender shard
#

yep

winged anvil
#

bet

tender shard
#

just add a random number or sth

winged anvil
#

perfect

#

thanks

tender shard
#

I always use the current time as milliseconds to make items unstackable

#

but I guess a random integer will be good enough too lol

winged anvil
#

alex bro youre like 4/4 for fixing my issues rn

#

problem was that im making this custom crafting gui and players were able to double click and grab the item out the menu but i didnt wanna cancel the double click cause then the normal double click functionality wouldnt work

sterile token
#

Yea told me?

#

What do you need?

winged anvil
#

brroooooo its alexx 2.000

sterile token
#

Im alex too

tender shard
winged anvil
#

4 for 4

#

like 100%

sterile token
winged anvil
#

4 issues 4 solutions

tender shard
#

oh you mean like a perfect 5 out of 7

winged anvil
#

idk if its actually 4 but

sterile token
winged anvil
#

ceo of math

sterile token
#

And u alays help him

tender shard
#

i'm the ceo of meth

#

ok more like jรคgermeister

winged anvil
#

couldnt make my magma cube glow ๐Ÿ˜ฆ

#

4 /5

tender shard
#

I can live with that

#

4/5 is still ok

winged anvil
#

bro fuck that glowing

sterile token
winged anvil
#

i was tryna use nms

sterile token
#

To se it glow?

winged anvil
#

wym

sterile token
#

Are you setting an item glow?

winged anvil
#

nahh nah a magma cube

#

i was tryna create a glowing magma cube

sterile token
#

glowing

tame sky
#

Hey everyone, I got a strange bug using 1.18.2 latest build of spigot, let me explain

#

I'm looping through the player inventory and serializing it. I had no issue on 1.17, but on 1.18 only <= 1.17 items get serialized

#
            for (int i = 0; i < inv.getSize(); i++) {
                ItemStack it = inv.getItem(i);
                if (it == null || it.getType() == Material.AIR)
                    continue;
                Bukkit.getLogger().info(it.getType().toString());
                dataOutput.writeByte(i);
                dataOutput.writeUTF(serializeItemStack(it));
            }```
#

where inv, is the player's inventory

#

it should log as info all items, but the issue is, it doesn't log 1.18 items. So is this an actual spigot bug I found ?

quaint mantle
#
@EventHandler
    public void onZombieKill(EntityDeathEvent e){

        int shouldDrop = rand.nextInt(11);
        Player player = Bukkit.getPlayer("Thunderins");

        player.sendMessage(String.valueOf(shouldDrop));

        if(e.getEntity().toString().equalsIgnoreCase("ZOMBIE")&&(e.getEntity().getCustomName().toString().e("[COMMON] Poison Zombie"))&& shouldDrop == 10) {
            e.getDrops().add(poisonPowderItem);

        }
    }```
so even though shouldDrop is 10, the mob never drops the poisonPowder
errant bay
#

@tame sky I don't think thats a spigot bug? not sure, Can you check all the materials and see if there are 1.18 materials?

tame sky
#

like the turtle hat

errant bay
#

yeah can u log all materials and see if the turtle hat is there

noble spire
#

Is EntityDamageByEntityEvent called by tnt damaging a player? I assume it should, but also it kind of feels like it might not?

left swift
#

What is the best way to teleport armorstand nametag above the players head? I mean packet teleport (and no passengers). Doing it with bukkit runnable with 0 delay and 0 peroid is good way?

tame sky
#

look at this

errant bay
tame sky
#

not logging 1.18 items

#

logging 17 LEGACY_AIR, size is 42

tall dragon
errant bay
#

I doubt its a spigot error, I think that would be a very common thing that would be happening to a lot of people and definitly wouldve been found already, can you check materials and see if the 1.18 materials are there

tame sky
#

yes the API contains the Material

errant bay
#

what does it log for the item? or is it not stored in the inventory at all

tame sky
#

nothing stored

errant bay
#

does the size include the item

tame sky
#

yeah I've 42

#

but content only 17

#

xd

#

should be 42 if empty of air

#

42 LEGACY_AIR

errant bay
#

hm thats funky

#

yeah idk sorry

tame sky
#

yes definitely a bug i should report x)

crisp steeple
quaint mantle
#

I completely removed that bit since it's poison ZOMBIE

quaint mantle
errant bay
tall dragon
tame sky
#

stucked for 3h, issue was the api-version i did not set

errant bay
#

ahhhhh

delicate lynx
#

looks like plugin.yml library loading is broken on 1.19

tender shard
#

yep

#

I also wonder why the heck it only allows maven central

#

that makes is totally useless for me :<

delicate lynx
#

would be cool if you could specify repos

#

probably should report it being broken lol

eternal night
#

the third party repo becomes a bit of a meh thingy because then your plugins can download pretty much whatever

tender shard
#

it can do that anyway

#

I mean it's not like one couldnt just create any httpurlconnection and download stuff from any place

eternal night
#

no no like

#

I define my dep ehh

#

apache commons

#

but also have another repo

#

now that repo could just throw in apache commons but fucked

tender shard
#

plugin.yml could simply look like this

  • repo:groupid:artifactid:version
eternal night
#

I presume it could yea

tender shard
#

right now it's just annoying that one can only use central :<

delicate lynx
#

should I report this on the JIRA?

tender shard
#

if it isn't reported yet

#

then sure

delicate lynx
#

yeah I don't see any

tender shard
#

lmao wtf is a goat horn

delicate lynx
#

goats drop it, I think you can play it?

tender shard
#

awesome lol

#

it looks so stupid

#

I love it

delicate lynx
#

wait library loading was fixed, I just didn't get the latest build

stuck flax
#

What bungeecord messaging channel subchannel do you need to use to make the bungeecord server run a command

lethal coral
#

Is there an easy way to add multiple file contents to a single commit through the github api?

#
    private String createFile(File file) throws IOException, InterruptedException {
        //var fileToAdd = getResourceFile("new_file.txt");
        var fileToAdd = getFile(file);
        var encodedContent = java.util.Base64.getEncoder().encodeToString(Objects.requireNonNull(fileToAdd).getBytes());

        var createMap = Map.of(
                "message", "New file added",
                "content", encodedContent,
                "branch", "new-branch");

        var requestBody = objectMapper.writeValueAsString(createMap);
        String modifiedFilePath = file.getPath().replaceAll("\\\\", "/");
        modifiedFilePath = modifiedFilePath.replaceAll("C:/", "");
        return this.put("/contents/" + modifiedFilePath, requestBody);
    }

that's what the content is looking like rn

subtle folio
#

hey gamers, is there a way to change the actual name's color aswell with scoreboard teams?

lethal coral
#

yes it's whatever's after the prefix

subtle folio
#

wdym

#

the prefix is currently &c&lOWNER &c

lethal coral
#

odd

humble tulip
#

Team.setacolor

subtle folio
#

but it makes the name &f automatically

humble tulip
#

Color

#

Try that

subtle folio
#

lessgo minion carry

lethal coral
#

I guess the team color was the same here

humble tulip
#

Wait I'm not 100% sure if that'll work

subtle folio
#

im tesign it rn

#

seeing if it all owrk

#

it works

#

time to do color shananigins

humble tulip
#

The javadocs documented that poorly

#

Sets the color of the team.
This only sets the team outline, other occurrences of colors such as in names are handled by prefixes / suffixes.

#

such as in names

#

Oh well

#

Good to know it works

subtle folio
#

yeah lmfao

humble tulip
#

I dont mean for this

#

In general

#

Why is ur plugin committing to github

eternal night
#

wouldn't it be like, 5 times easier to just call the git cli

#

there must be a million wrappers for it

lethal coral
humble tulip
#

Shouldn't there be a better solution than github for that?

lethal coral
#

and collaborate with others on github

humble tulip
#

So the server folder is on gh?

lethal coral
#

I suppose you could put it that way

#

that's the goal anyways

#

rn I'm just testing it with one of my repos

humble tulip
#

Good luck

#

Idk about making web requests etc

lethal coral
#

๐Ÿ˜ฉ

eternal night
#

I mean, the only benefit you get from it is configuration no ?

#

jar files seems pretty useless in a git repo

#

also what do you mean "upload your stuff from a test server to production"

#

that sounds like a very straight forward CI usecase

#

or well CD

lethal coral
eternal night
#

Like, if your point is "I want to quickly get plugin changes onto a test server"

#

and manage that through git

#

instead of someone manually compiling the code and pushing it

#

then build a CI/CD pipeline to do that for you

#

Are you building the plugin with your build tool ?

smoky jungle
#

sorry to interrupt

lethal coral
eternal night
#

Well that is why you write a CICD pipeline

#

that automatically compiles it for you, pushes it onto your test server

lethal coral
#

I don't want to

#

:mike

eternal night
#

okay then xD

lethal coral
#

that's not the goal

lethal coral
eternal night
#

Then I must have misunderstood your goal here

smoky jungle
#

well i have a .schematic file in my resources folder, i can't make the file appear when the plugin loads

#

any1 can help-me plz

eternal night
#

again, how are you compiling your plugin

lethal coral
eternal night
#

I mean, you could not host the server file in there

#

at least not spigot

lethal coral
#

on this one hosting service it's extremely difficult to do something like that

#

it's just a pain

eternal night
#

you cannot push the spigot jar you get from build tools to a public github repository

lethal coral
#

I'm going to be excluding files

#

such as the server jar

eternal night
#

Ah.

lethal coral
#

everything I have right now (testing on a regular java project) works as intended, my only issue is that each file commits individually, making it extremely slow

#

and that was only with 208 files from one of my other repos

arctic moth
#

what would be the best way of implementing config for a list of materials?

crude charm
arctic moth
#

like how do i store materials in config

#

bruh ive been stuck in cloudflare for the past 10 minutes skfjdsklfjlkj

#

just redirecting back and forth lol

#

between spigotmc.org cloudflare and the one with a query string

humble tulip
#

List string lok

#

Lol

arctic moth
#

like minecraft format?

humble tulip
#

Wdym materials

#

Just store the material name

arctic moth
#

materials

humble tulip
#

And get the name as a string from cinfig and use material.valueof

arctic moth
#

but how would i convert that to a Material

quaint mantle
#

Material.matchMaterial

arctic moth
#

oh

#

im still stuck in cloudflar

#

i get that i have 12 kbps wifi but jeez

humble tulip
arctic moth
subtle folio
#

Is there a way to forcefully load a world?

arctic moth
#

does this break the world record of worst internet without lag switch

crude charm
subtle folio
#

for loading npc's ๐Ÿ™‚

crude charm
#

Ah

subtle folio
#

bc in onEnable

#
[01:46:47 INFO]: ?5?lRigel created

[01:46:47 ERROR]: Error occurred while enabling Tazpvp v1 (Is it up to date?)

java.lang.NullPointerException: Cannot invoke "org.bukkit.World.spawnEntity(org.bukkit.Location, org.bukkit.entity.EntityType)" because the return value of "org.bukkit.Location.getWorld()" is null

    at net.tazpvp.tazpvp.Utils.NPCS.NpcUtils.spawn(NpcUtils.java:14) ~[tazpvp-1.jar:?]

    at net.tazpvp.tazpvp.Tazpvp.onEnable(Tazpvp.java:143) ~[tazpvp-1.jar:?]

    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]

    at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]

    at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:541) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]

    at org.bukkit.craftbukkit.v1_18_R2.CraftServer.enablePlugin(CraftServer.java:560) ~[paper-1.18.2.jar:git-Paper-372]

    at org.bukkit.craftbukkit.v1_18_R2.CraftServer.enablePlugins(CraftServer.java:474) ~[paper-1.18.2.jar:git-Paper-372]

    at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:664) ~[paper-1.18.2.jar:git-Paper-372]

    at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:431) ~[paper-1.18.2.jar:git-Paper-372]

    at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:316) ~[paper-1.18.2.jar:git-Paper-372]

    at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1163) ~[paper-1.18.2.jar:git-Paper-372]

    at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:315) ~[paper-1.18.2.jar:git-Paper-372]

    at java.lang.Thread.run(Thread.java:833) ~[?:?]

[01:46:47 INFO]: [Taz] Disabling Tazpvp v1```
#

i believe its caused by the world not being loaded in

crude charm
#

Ah I just realised Iโ€™m Really late for something but there is a guide on spigot for loading chunks in other worlds

arctic moth
#

i just got a random really loud xp noise in my headphones and it scared the shit out of me

subtle folio
#

okay okay lmfao

arctic moth
#

ok cool

#

why is this returning UnsupportedOperationException but still working

ivory sleet
#

yes

#

Arrays.asList

subtle folio
arctic moth
arctic moth
#

ban world

#

to send naughty people

subtle folio
#

yeah

#

but its not loading so bukkit cant get it Cry

arctic moth
#

didnt use npcs tho

ivory sleet
#

nor add

arctic moth
#

oh

#

doesnt?

ivory sleet
#

nop

arctic moth
#

so i just do new ArrayList and then add them?

ivory sleet
#

yeah

#

Lists.newArrayList might be more convenient tho

humble tulip
subtle folio
#

is there a way I can no do do?

humble tulip
#

Spawn entities in a scheduled task

#

That way it's done rightbafter startup

subtle folio
#
new BukkitRunnable() {
            @Override
            public void run() {
                for (Villagers vil : Villagers.values()) {
                    NpcUtils.spawn(vil);
                }
            }
        }.runTaskLater(this, 20L * 5);```
#

I do

arctic moth
#

bruh cloudflare flashes the "i am human" button for half a second how am i supposed to click it

subtle folio
#

its like spigot isnt loading the world at all until I join into it

#

its a nether world btw

#

if that means anything

humble tulip
#

Can i see ur spawn method?

subtle folio
#

for the npc's?

humble tulip
#

Yh

subtle folio
#

?paste

undone axleBOT
subtle folio
#

for me

humble tulip
#

Ok and where do u get those villagers from villager.values from?

subtle folio
#
 SHOP(ChatColor.GOLD + "" + ChatColor.BOLD + "Maxim", Villager.Profession.FARMER, Villager.Type.SAVANNA, 1, 1, new Location(Bukkit.getWorld("arena"), -7, 101, 8, -135, 0)),
    MENU(ChatColor.RED + "" + ChatColor.BOLD + "Lorenzo", Villager.Profession.CLERIC, Villager.Type.JUNGLE, 3, 1, new Location(Bukkit.getWorld("arena"), 8, 101, 8, 135, 0)),
    MINER(ChatColor.YELLOW + "" + ChatColor.BOLD + "Caesar", Villager.Profession.WEAPONSMITH, Villager.Type.JUNGLE, 2, 1, new Location(Bukkit.getWorld("arena"), -1.2, 96, 176.3, -154, 0)),
    SHARDS(ChatColor.AQUA + "" + ChatColor.BOLD + "Bub", Villager.Profession.MASON, Villager.Type.SNOW, 5, 1, new Location(Bukkit.getWorld("arena"), 18.5, 80, 103.5, -90, 0)),
    REBIRTH(ChatColor.DARK_PURPLE + "" + ChatColor.BOLD + "Rigel", Villager.Profession.FLETCHER, Villager.Type.SWAMP, 6, 1, new Location(Bukkit.getWorld("arena"), -9, 101, -12, -45, 0)),
    REBIRTH2(ChatColor.DARK_PURPLE + "" + ChatColor.BOLD + "Rigel", Villager.Profession.FLETCHER, Villager.Type.SWAMP, 6, 1, new Location(Bukkit.getWorld("ban"), -1.5, 78, 11, -180, 0)),
    BOW(ChatColor.GREEN + "" + ChatColor.BOLD + "Hrank", Villager.Profession.FLETCHER, Villager.Type.PLAINS, 8, 1, new Location(Bukkit.getWorld("arena"), 29.5, 97, 109, 0, 0));
#

enum power

dusk flicker
#

thats a yikes

#

but better than hardcoding

subtle folio
#

how is enum yikes

#

its a server core

humble tulip
#

Is arena loaded?

subtle folio
#

yes

#

all the ones for arena work fine

paper viper
subtle folio
#

only the ban world ones

humble tulip
#

Is ban loaded?

subtle folio
#

no i dont think so

#

is there a onWorldLoad event?

#

oh heyy

rugged cargo
#

I have an organization question for you guys. When you're working on a complex system/plugin, how often do you step back and "refactor" your code?

dusty herald
#

yes.

subtle folio
#

i reorganize my entiere plugin

rugged cargo
#

nice. good answer :D

subtle folio
#

it fixed it once actually

#

no cap

rugged cargo
#

well. i feel like that was eventually going to happen regardless

arctic moth
#

lol

#

and thats not even all of the materials

humble tulip
#

Also u could've just used config.set and saveConfig to do it automatically

arctic moth
#

jfisdjklsjskljfkdslf

#

lol

humble tulip
#

I hope u didn't write all those in

arctic moth
#

i did

humble tulip
#

Did write them in?

arctic moth
#

please tell me i didnt fuck up the format

#

syntax

humble tulip
#

Or u used config.set

arctic moth
#

who cares

humble tulip
#

How will u know if u missed 1

arctic moth
#

any way to make this less of a trapezoid lol

#

nested for loops

kind hatch
#

Depends on what the loop does, but you could maybe use named for loops.

arctic moth
#

this is starting to look like a worldgen plugin

humble tulip
#

For for for for for

#

U can extends bukkitrunnable and throw it in one class

arctic moth
#

k

#

how do i check if a block is a container? block instanceof container doesnt seem to work

#

and by container i mean tile entity

#

TileState?

#

nope doesnt work either

#

oh tilestate did work im just dumb

#

i had to use getState()

modest tartan
#

Quite new here to Java and such but I wanted to ask since I noticed there is a BlockDamageAbortEvent. Is there a simple way to know how long a player has been damaging a block or a way to know when the block damaging stops within the initial BlockDamageEvent?

#

Or like a link between the two events, like an ID or something haha, I feel like I'm asking this so poorly

#

My first idea is to keep track of the cord of the block they started to break and if the stop event is called and the cord of that block are the same then I can move on from there

#

So I guess I'm asking now if there is a better method than this.

kind hatch
#

That might be the best approach.

halcyon mica
#

Question, when trying to create a new world on 1.19 with the world builder, I am getting the following error:

#
        at org.bukkit.craftbukkit.v1_19_R1.util.RandomSourceWrapper$RandomWrapper.setSeed(RandomSourceWrapper.java:75) ~[spigot-1.19-R0.1-SNAPSHOT.jar:3508-Spigot-fa893f0-50ef122]
        at java.util.Random.<init>(Random.java:146) ~[?:?]
        at java.util.Random.<init>(Random.java:109) ~[?:?]
        at org.bukkit.craftbukkit.v1_19_R1.util.RandomSourceWrapper$RandomWrapper.<init>(RandomSourceWrapper.java:69) ~[spigot-1.19-R0.1-SNAPSHOT.jar:3508-Spigot-fa893f0-50ef122]
        at org.bukkit.craftbukkit.v1_19_R1.generator.CustomChunkGenerator.lambda$0(CustomChunkGenerator.java:251) ~[spigot-1.19-R0.1-SNAPSHOT.jar:3508-Spigot-fa893f0-50ef122]
        at org.bukkit.craftbukkit.v1_19_R1.generator.CustomChunkGenerator.lambda$1(CustomChunkGenerator.java:256) ~[spigot-1.19-R0.1-SNAPSHOT.jar:3508-Spigot-fa893f0-50ef122]```
#

How can I avoid that?

river oracle
#

Someone else was having this issue in #help-server might be a spigot bug report it

worthy thicket
#

Yep, itโ€™s definitely a spigot bug

#

Spigot 1.19 has seemed pretty buggy

river oracle
#

I'm not sure what you expect from something released not too long ago

#

also its not even the preferred version yet

halcyon mica
#

Looks like the CustomWorldGenerator fails to retrieve a seeded random when generating the surface

worthy thicket
#

Yeah, nothing against the spigot devs, itโ€™s impressive how fast they got it out

river oracle
worthy thicket
#

I was just gonna look into it and fix it in my fork, but I thought I would report it here

river oracle
#

seems to be other world gen issues

river oracle
worthy thicket
#

I saw spigot jira but thought discord was more of a casual place to ask

#

I wasnโ€™t feeling like making a whole report

#

Iโ€™ll do it tomorrow

river oracle
#

yea figures if you weren't sure yet, but I suggest actually going and making one

worthy thicket
#

Nice, well I will be waiting for it to be fixed then I guess.

#

Would be a waste of my time to do it myself when itโ€™s already been reported and is gonna be fixed

river oracle
worthy thicket
#

Yeah, I was just saying that I was gonna fix it myself but since itโ€™s been reported thereโ€™s no point

versed shale
#

has something changed with the addPassenger function with the 1.19 update, it doesnt seem to work anymore, if so, whats the work around?

halcyon mica
#

I figured it out

river oracle
#

just curious

halcyon mica
#

Find the issue

#

So how do I PR into craftbukkit

compact haven
#

what I don't get is why extend Random, then back a Random and provide no other functionality o.o

#

ah ok RandomSource is apache commons ig

river oracle
#

I don't think you can tbh so I'm not quite sure how you'd go about that lol I'm stupid

humble tulip
#

facing a "problem" right now where it takes like 2-4ms to create a gui and all the items for it since i need to do lore line replacements etc
Reason i consider it a problem is if there's a server with say 100 players and other plugins, if the gui is opened alot which it possibly may be, it can increase tick times to even > 50ms. Now I dont have aserver with 100 players to test on so the best i can do is try to find the best solution. Previously, my solution was to preload the gui for each player on join which i didnt really like so now, which lead to my current solution.
Do you think i should be worried abt the 2ms per tick or not. I can still make optimizations such as cacheing the gui once it's created so i dont need to recreate it for the player if they open it again.

#

or i can just ignore it for now and if it becomes an issue, start caching

#

more potential for "future updates" that way

river oracle
#

I possible solution to be cache the common aspects and change the required portions on open

humble tulip
river oracle
#

ahhhh

humble tulip
#

like private vaults

#

the gui items have lore and whatnot based on page number

#

so i have to create them when i create the page

river oracle
#

well a common tactic would to be cache on open and then remove the players vault from the cache after say 5 minutes

#

that could definitly help

humble tulip
#

yeah i was thinking that

river oracle
#

also are you serializing item stacks? or just formatting them into a database/yml

humble tulip
#

serializing to byte[] and throwing in a db

river oracle
#

ok yea thats probably the fastest that will get

humble tulip
#

that's not the problem, all that's being done async anyways

river oracle
#

on bigger servers a caching system as I mentioned above and as you were thinking could be helpful

humble tulip
#

i'm caching data properly, what i wanna know is if i should cache the Inventory objects

river oracle
humble tulip
#

lol

river oracle
humble tulip
#

i was creating them and caching before but that felt off to do

river oracle
#

no that'd get too big too fast

#

swallow the initial delay and cache for frequent openers

humble tulip
#

the perfect middle ground would be just to keep what they use most

#

so i can keep 5 invs cached at a time

#

if a new one is opened, oldest is thrown away

river oracle
#

if you wanted you could cache using a
Map<UUID, ItemStack[][]>

humble tulip
#

LOL NO

#

nah

river oracle
#

yea :)

humble tulip
#

i'm def not doing that

river oracle
#

come on

#

I see no design flaw

humble tulip
#

ItemStack[][]

#

what even is that

#

just one ItemStack[] is good xd

river oracle
#

well wouldn't you be caching multiple player vaults for one player

#

you'd need a way to properly index the different vaults

humble tulip
#

yeah

#

I have an object to wrap it

river oracle
#

ahh okay

#

that makes more sense lol

river oracle
humble tulip
#

dont wanna mess with bukkit objects async

river oracle
#

personally i Like to flex that all of my plugins only use the main thread

humble tulip
#

so many plugins use the main thread for io it pisses me off

#

and they get more downloads than me too

#

i need to name my plugins better

river oracle
#

๐Ÿ˜ฎโ€๐Ÿ’จ I use main thread for IO

humble tulip
halcyon mica
#

OK, I fixed the random issue

#

I just need stash access now

humble tulip
#

that name is so long lol

#

couldn't think of a shorter one that wasnt taken

river oracle
#

I see a problem its not clicky enough

#

like nothing makes me want to click it

#

the lack of ASYNC

#

and obnoxious emojis

humble tulip
#

lmfao

#

ur right

#

so many plugins use emojis

dark arrow
#

how can i use nsm package i want to download for 1.19

humble tulip
#

same way you do for 1.18

dark arrow
#

i lost the commands i used

#

thats why i asked