#help-development

1 messages · Page 1027 of 1

mint lynx
#

I think the difference is between managing an existing Entity or creating a new type of Entity.

wise mulch
#

Getting a bit of a weird crash here. I'm getting a NullPointerException in a place where it is seemingly impossible for the value to be null. I'm using getOrDefault, and at NO POINT do I insert any null values into the map. What's the deal? Excuse the dirty code, I'm updating my SkyGrid generator from 1.16 and it needs a few heavy reworks, so I'm making patchy solutions to get things running, and slowly ironing it out as I go.

"Impossible" crash: https://gist.github.com/Roadhog360/8b95060f957cac2b79c7bb4da6a9b5e0
Code snippet it crashes on: https://gist.github.com/Roadhog360/3253fc1ed6c7bf408386476ac36f8e18 (config.getRandomBlockFromLayer is what it crashes on. This is what I think is impossible because I use getOrDefault, at no point do I EVER insert null into the map)
getBiomeConfig (line 81): https://gist.github.com/Roadhog360/78e1559c716ddf7ecfaa53587b60118a (As can be seen, there is NEVER a null element inserted, which would seemingly be the ONLY WAY getOrDefault would return null.)
Making getBiomeConfig return just DEFAULT seems to work but I obviously don't want that. So... how the hell's BaseBiomeConfig.getBiomeConfig outputting null?

drowsy helm
#

and you're not checking the input on getBiomeConfig, it could be null

#

but yeah, unless DEFAULT is null somehow

wise mulch
#

In that case, null is not a key and would return the default. Also I had a realization that hit me in the face like a brick, I put the initialization of the variables BELOW the static

#

And, yeah, that worked. It's always right after requesting help on a difficult issue that I immediately think of the solution, lmao

drowsy helm
#

lol

wise mulch
#

It could very well be an enum but for now I'm rolling with this. I am still in the middle of working on it, so rough solutions become what is primarily used for now.

#

This will eventually be replaced with a map that fills itself, using the enum constructor

#

Actually, I should probably do that, on second thought that'd make dev time a bit faster

small valve
#

"Chat message validation failure" is when you cancel messages right? If my plugin isn't cancelling messages then my plugin can't be the cause right?

sullen marlin
#

probably, gonna have to be more specific

umbral ridge
#

you can cancel messages?

blazing ocean
#

yes

#

but you shouldn't just broadcast them

umbral ridge
#

from the chat?

blazing ocean
#

yea

umbral ridge
#

that is sick

tender shard
#

?support

undone axleBOT
agile hollow
#

why i'm not getting the jar file when i compile it?

tender shard
#

Oh and you need to run package

agile hollow
spice burrow
#

I've never worked with armor stand animations before, is the best way to smoothly move them from one spot to another to get the difference vector, divide that by how long I want the animation to be, and then run a repeating task until the armorstand is at the location (with some room for error)

this would all be done with teleports instead of velocity because it's in the air

tender shard
#

Right side, click the maven tab, then lifecycle -> double click package

agile hollow
#

what is the difference between compile and package i usualy use it for the same way (sorry for the stupid question)

blazing ocean
#

also i don't think you need to clean on every build, that just slows it down

tender shard
#

Compile only compiles code but doesnt put it into a jar

#

Package = compile + create jar

agile hollow
#

oh okay thanks a lot

icy beacon
blazing ocean
#

it clears caches

#

incremental compilation doesn't work then

icy beacon
#

Oh true

#

So it was the right call for me to remove it lol

#

I was trying to get incremental working with Kotlin

blazing ocean
#

incremental is so good

icy beacon
#

And it wasn't working so i decided to remove clean from the goal

#

And it suddenly sped up so much

#

1:20 -> 20 secs

#

Gradle would still probably be faster for Kotlin though

blazing ocean
#

it is

icy beacon
#

Yeah one day I'll change this project to use Gradle

#

Too lazy ngl

blazing ocean
#

gradle + kotlin dsl is so good

icy beacon
#

Yes

dawn flower
#

how do i check if PlayerMoveEvent was triggered from velocity or by the player

eternal oxide
#

you can't

#

playerMoveEvent fires for every movement of the player.

blazing ocean
#

isn't there a PlayerVelocityEvent or something

dawn flower
#

i want to cancel normal movement but not velocity

#

i want the opposite

blazing ocean
#

hashmaps?

lusty cipher
#

how can I check if my Runnable I scheduled as an async task has completed?

blazing ocean
#

make a variable isCompleted or something?

#

or check if the task exists

ivory sleet
lusty cipher
#

bukkit scheduler

lusty cipher
lusty cipher
tardy delta
#

sounds like a design flaw

sullen marlin
#

?jd

undone axleBOT
sullen marlin
#

IsQueued/isRunning

pliant topaz
#

Is there a way I can get the players target blockface? because player#getTargetBlockFace(5) for example, ignores everything and just returns the blockface the player is looking at 5 blocks away, even tho the nearest targeted blockface is up it might output south

lusty cipher
silent slate
#

is the SignEditEvent also called on the initial edit when the sign is placed?

quaint mantle
#

Can u set armorstands to no clip state in 1.16.5?

river oracle
#

I looked into PRing a edit type a while back but unfortunately its impossible add

silent slate
river oracle
#

i'd double check and make sure it still work but it did last time I check in like 1.19.4

silent slate
#

is there a way to detect if the sign was empty before? to maybe detect if its the initial write

river oracle
#

one sec

#

?jd-s

undone axleBOT
silent slate
#

maybe create an array of signs that you add coordinates to on the OnBuild event and then remove from the array on the onEdit event

river oracle
#

sign change event gives you a snapshot of the block state

#

you could use that

silent slate
#

k nice

river oracle
#

you can use lines[] though it should be empty given it wasn't tampered with

#

oh you do have access to getBlock so nvm

#

SignChangeEvent#getBlock#getState

silent slate
#

so i get the lines using getLines, but i cant get wheater or not its the initial edit ?

river oracle
#

no

#

you'd have to use block place event

#

and have some expiring cache

silent slate
#

ye

sleek estuary
#

I want to make a vehicle plugin. For that I'm going to make a teleporting armorstand, but how do I detect that the player clicked 'W' etc to teleport the armorstand?

silent slate
#

ok imma do that

river oracle
#

but that's pretty easy. yeah I wish you could distinguish between the two

#

but alas :(

silent slate
#

ill create an hashmap for Location and int, set the int to 100 or something and let it count down, player has 100 seconds of time to edit, afterwards imma just delete the block and reset it

river oracle
#

that should send you key presses

halcyon hemlock
#

im bored

river oracle
#

Then have fun

icy beacon
fair rock
#

Love it

#

Is the field on the bottom for a seed?

sullen canyon
#

I feel bad for doing it this way

sleek estuary
#

how i update the gradle version

#

i update here but not works

halcyon hemlock
tardy delta
echo basalt
#

why use streams when you can just have a regular for loop

worldly ingot
#

+1

tardy delta
#

two points seemed a bit weak

tardy delta
sleek estuary
#

intellij not detecting my lombok wtf help?

brittle geyser
#

Where i can found minecraft packets list?

tardy delta
#

have you got the annotation processor?

sleek estuary
brittle geyser
#

PacketPlayOutCraftingRecipeBookOpen???

#

IDK

halcyon hemlock
halcyon hemlock
#

I'd rather make it in rust or something but I'm not fond of making UIs in it

tardy delta
#

could use raylib

#

but the rust bindings are absolutely horrendous

brittle geyser
#

i found it without packets, thanks

brittle geyser
#

PlayerRecipeBookSettingsChangeEvent works perfectly

icy beacon
#

nice

halcyon hemlock
#

already javafx

rough drift
river oracle
#

Compose is a thing

#

💪

blazing ocean
timid spear
#

Ayo

#

Can someone help me to convert a snippet from Waterfall to Spigot API?
I am migrating some code of an old plugin of mine, but could not get my head around one particular class

tardy delta
#

got the code?

timid spear
#

If you want, also as hastebin

blazing ocean
#

do you mean bungee or spigot

timid spear
#

It was a Waterfall (Bungeecord) plugin once, and now I migrate everything into the Spigot API. Got about 80 % so far.

So: Bungeecord -> Spigot

blazing ocean
#

?scheduler

#

what

#

is cafebabe dead

#

?tas

undone axleBOT
blazing ocean
#

what was the command

#

?scheduling

undone axleBOT
blazing ocean
#

an async scheduler already exists

timid spear
#

Oh? ;o

#

So the BukkitScheduler it is for me

blazing ocean
#

yup

sand mirage
#

Does a nether block has a tilestate?

echo basalt
#

why does this look like a completablefuture wrapper

eternal night
#

What do you consider a nether block

echo basalt
blazing ocean
echo basalt
#

For example chests, furnaces, beacons etc

sand mirage
#

@echo basalt That makes sense. Thanks.

#

So there is no way to store some metadata to a nether portal block, right? I would need to store by location in a config or something. I thought I might be able to use PersistentDataContainer but it is only possible for TileStates.

young knoll
#

?blockpdc

undone axleBOT
echo basalt
#

?blockpdc

undone axleBOT
echo basalt
#

rip got sniped

young knoll
#

rekt

echo basalt
#

Incredibly predictable too

sand mirage
#

Wow this is incredibly useful.

echo basalt
#

Instead of BlockPDC I have my own chunk system so I can host custom data :)

young knoll
#

Nerd

#

I mean that's basically all BlockPDC is

echo basalt
#

Well yeah but it comes to the advantage of uh

#

supporting other kinds of databases

#

And also just being generic instead of a pdc container

#

Pair that with a default gson codec and you have heaven

timid spear
#

Seems like so

blazing ocean
echo basalt
#
WorldBlockStorage<MyCustomData> storage = new WorldBlockStorage<>(plugin, new PDCChunkStorage(plugin));

MyCustomData data = storage.getBlockAt(location);
data.doWhatever()

storage.saveBlock(data)
timid spear
#

pardon? 😮

blazing ocean
#

why can't you just use the scheduler itself

timid spear
#

hmm

sand mirage
#

How does this plugin work? How can it add PDC to every block?

echo basalt
#

It just uses the chunk's PDC instead

#

And some fancy wrapping

sand mirage
#

ah so basically a chunk with a location/data table inside?

echo basalt
#

Something like that

sand mirage
#

and then patches the events

twilit coral
#

Better descriptor is a map

echo basalt
#

Chunks have PDC

#

This just makes a PDC that gets stored inside the chunk for the block you're messing with

young knoll
#

And tries its best to remove it when the block is removed iirc

#

Idk how much gets left behind

sand mirage
#

Ah yeah I see.

#

You just provide the block and it does its thing to store and get the metadata

tender shard
charred blaze
#

how do i write string?

#

there is code provided to write varint

#

what about string?

chrome beacon
#

The FriendlyByteBuf is what nms uses

charred blaze
#

does that mean i should use it too?

#

how do i get that package?

chrome beacon
#

?nms

chrome beacon
#

also you can just use the packet directly

charred blaze
#

im not trying to create a plugin

chrome beacon
#

you should have said so in your message

charred blaze
#

my bad

#

this is probably wrong channel to ask sorry

chrome beacon
#

wiki vg has information on how the packets are structured

#

the string is just an utf8 string

unreal sky
#
[ERROR] /C:/Users/talha/OneDrive/Masaüstü/ffa/src/main/java/me/paulvogel/ffa/listeners/PlayerInventoryListener.java:[22,34] cannot find symbol
[ERROR]   symbol:   method getName()
[ERROR]   location: interface org.bukkit.inventory.Inventory
[ERROR] /C:/Users/talha/OneDrive/Masaüstü/ffa/src/main/java/me/paulvogel/ffa/listeners/PlayerInventoryListener.java:[22,140] cannot find symbol
[ERROR]   symbol:   method getName()
[ERROR]   location: interface org.bukkit.inventory.Inventory
[ERROR] -> [Help 1]
eternal oxide
#

?ask

undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

river oracle
#

so there you go

#

Inventory has no such method getName

charred blaze
#

i mean i already have seen that it is utf8 string

#

but what is utf8 string

#

will try google

#

StandardCharsets.UTF_8.encode(myString)

#

this?

#

how do i write all this stuff?

blazing ocean
#

FriendlyByteBuf#writeType()

charred blaze
#

how do i get that class

#

??

chrome beacon
#

It's part of nms

blazing ocean
#

new FriendlyByteBuf(Unpooled.directBuffer())

charred blaze
#

does it make easier to work with all this datatypes? if so how do i get it in my situation?

#

im not trying to create plugin

blazing ocean
charred blaze
#

where do i go then?

blazing ocean
#

depends on what you're doing

charred blaze
#

trying to write a simple client?

blazing ocean
#

then this is certainly not the place

charred blaze
#

where

blazing ocean
#

idk

#

depends on what you're using

unreal sky
blazing ocean
#

if you're making it from scratch you're p much on your own good luck

charred blaze
#

what really?

blazing ocean
#

i mean

#

nobody really does that

#

like why

#

just use something like fbaric

halcyon hemlock
#

More fun frfr

vital sandal
#

what could be the formula to teleport player 1 block on their left?

pseudo hazel
#

player.teleport()

#

and then its just their location but add 1 to x

vital sandal
#

nope

#

that is different

blazing ocean
#

wdym nope..??

pseudo hazel
#

how so

#

oh you mean depending on where they are looking

vital sandal
#

well sometime left could be south

#

and some it could be west

#

so adding 1 to x of location doesn't do the trick here

pseudo hazel
#

you have to get the y angle of their head probably and then see which axis is closest to it

#

and then you add one left relatvie to that

vital sandal
#

well we got facing direction vector here

#

and I'm looking for a way with that

#

Normally I rotate the vector by 90 degree then add by that direction but looking to see a smarter attempts

charred blaze
#

etc

tardy delta
river oracle
#

its in InventoryView now

#

though I'd put a million on why you're using the title so

#

inb4 you use title to detect your GUI

eternal oxide
# vital sandal what could be the formula to teleport player 1 block on their left?
    /**
     * Location left or right of the source.
     * 
     * @param location the source.
     * @param offset distance to the new Location.
     * @param direction LEFT or RIGHT
     * @return a new Location LEFT or RIGHT of the origin.
     */
    public Location getSide(Location location, double offset, SIDE direction) {
        
        double rad = Math.toRadians(location.getYaw() + ((direction == SIDE.LEFT)? 0: 180) );
        double x = Math.cos(rad);
        double z = Math.sin(rad);
        
        Vector shift = new Vector(x, 0, z).normalize().multiply(offset);

        Location finalLoc = location.clone().add(shift);
        finalLoc.setDirection(location.getDirection()); // Set same facing as the Location.
        
        return finalLoc;
    }
    
    public enum SIDE {LEFT, RIGHT}```
#

So if you want Right of the player Location loc = getSide(player.getEyeLocation(), 1.0, SIDE.RIGHT);

river oracle
#

Does anyone know how to use gradle to pipe outputs from one task to another.
Right now I've got one task called VineyardMetaSetup which produces a executor which is mutated in the task, however other subtasks need metadata and other information from this executor. I'm not really sure how to handle this.

I've tried

        project.tasks.register(VINEYARD_PREPARE_NMS_TASK, VineyardPrepareNMS::class.java) {
            val metaSetup = project.tasks.getByName(VINEYARD_META_SETUP_TASK) as VineyardMetaSetup
            dependsOn(metaSetup)
            group = VINEYARD_TASK_CATEGORY
            this.executor.set(metaSetup.executor)
        }``` 
However it is somehow not mutated from its original state
blazing ocean
#

omg cabernetmc

pseudo hazel
#

hey yall, how do I set a player's prefix in chat/tablist/above head using a scoreboard, I have a team with the player's name as an entry in it. Do I need to set the scoreboard to the player to be able to see the prefix?

tender shard
river oracle
#

I don't think it would fly as good API tbh. Also because mojang is heading more and more towards data driven each update it'll likely be completely useless within a few years

unreal sky
pseudo hazel
river oracle
#

not really unfortunately, because I'm working with memory not really file system stuff. The shitty thing is gradle doesn't let you pipe in and out just regular objects

#

which would be hella useful. Ig i'll just contcatonate it all into one task

#

Gonna just need to make super intelligent casting

tender shard
blazing ocean
#

why you only sharing chatgpt links

river oracle
#

he has chatgpt4

tender shard
#

because that's how I usually solve stuff like this and in 99% of cases, it has nice answers

shadow night
#

I don't think alex has the ability to think by himself anymore

blazing ocean
#

ik

river oracle
#

so its somewhat intelligent

river oracle
#

I don't think you guys realize how bad the AI problem is in search engines now

shadow night
river oracle
#

most of the stuff you search for isn't even valid rather have an LLM who sifts through the BS quickly sometimes

quaint mantle
river oracle
#

@tender shard that second one did it

#

very weird but oh well

#

Anyone know what scriptus plugin does for craftbukkit

tender shard
charred blaze
#

am i doing it correctly?

tender shard
#

you'd usually move the creation of the streams into a try-with-resources

#
try(DataOutputStream output = new ...;
    DataInputStream input = new ...;
) {
  // Do your stuff
} catch (IOException ex) {
  // Handle Ecxeption
}
shadow night
#

Ye, then it auto closes

charred blaze
#

ok

pseudo hazel
#

can I have separate scoreboard test per player?

#

or does that mean every player needs thier own scoreboard

#

essentially I want to use placeholders on the scoreboard, but they are different per player so yeah..

tender shard
pseudo hazel
#

I see

#

hmm thats going to complicate player team prefixes a lot

#

because I think it only shows prefixes for the board set on the player

tender shard
#

aren't scoreboards and teams two different things? tbh no clue, never used any of those

pseudo hazel
#

no

#

its abhorrently designed

#

you have a scoreboard, that can register objectives and teams

#

but you only have 1 socreboard set on a player

#

but team prefixes can only show if that team exist in the scoreboard the player has set and those teams have the entries

#

so to do what I want, one scoreboard per player, you have to copy all the teams and entries for each player individually

#

I mean ideally I would want to use some packet thing but I have never used packets

fleet imp
#

is there a UI or inventory i can use for the book signing page

young knoll
#

no

#

It's client side

fleet imp
#

poo

wise mulch
#

Is there any way to swap out the world's Random instance with a faster one?

#

I have a faster Random class, I'm wondering if I can initialize my custom worldgen worlds with it for faster RNG

#

It's the Xoshiro256** random formula btw

wise mulch
#

A faster Random class

shadow night
#

Is the difference significant

wise mulch
#

It's faster

#

I don't have benchmarks atm but I do remember it's fast

rough drift
#

wait no that's splittable random

#

this is like 8x

shadow night
#

Cuz your name is familiar

wise mulch
#

I am the owner of Legacy Modding

shadow night
#

oh wait what

wise mulch
#

Yea

shadow night
#

lmao

wise mulch
#

I only mod 1.7.10 but I sometimes dabble in servers, which are usually modern

shadow night
#

Understandable

wise mulch
# rough drift this is like 8x

So I want it to be the standard for my world, since I haven't started generating a production world with my generator yet, I think it'd be a good idea to make them use Xoshiro while I am ahead

blazing ocean
#

why 1.7.10

#

1.21/latest best version

wise mulch
#

It's fast and modern has a lot of junk and random wrapper/helper classes

shadow night
#

1.21 doesn't have tc4 so it can't be best

blazing ocean
shadow night
blazing ocean
wise mulch
#

Off-topic, if you want to know more about why I mod 1.7.10 ping me in general

#

My plugins are for modern servers

shadow night
#

Well, 1.8 plugins can barely do anything comparing to 1.20.6

blazing ocean
#

yea

#

need display entities

#

resource packs

wise mulch
#

So anyways let's get back on topic, how can I initialize my custom worlds, with a custom Random instance?

blazing ocean
wise mulch
#

Where may I insert Xoshiro over the standard random?

shadow night
#

I wonder if reflection could do something here

wise mulch
#

Thinking NMS reflection is probably needed.

#

Which is okay since this plugin is private for my server so it'll work in my use cases.

#

But I was wondering if there was a proper way first, like if a simple random field is exposed that I can just change to something else

blazing ocean
#

in an nms world it's final

#

so i doubt it

wise mulch
#

Reflection can change final fields

blazing ocean
#

okay wtf

wise mulch
#

Final doesn't actually make much differece in the Java bytecode. It's just a flag that the variable shouldn't be changed, but it can easily be forced to be changed.

young knoll
#

Static fields are the problem

wise mulch
#

Yeah, STATIC FINAL is basically impossible to change without ASM or Mixin

#

Reflection can't change them.

blazing ocean
#

mixins ftw

young knoll
#

I think you can do it with unsafe

shadow night
#

Well, random shouldn't be static

wise mulch
#

Yeah, it's usually just final or a regular field

shadow night
#

I think it's private final

wise mulch
#

Either way thanks, I'll use reflection and insert my Rand instance into Level, assuming that is the correct place.

blazing ocean
#

see the link i sent

wise mulch
#

Oh, if it's public that makes things easier

shadow night
young knoll
#

Might be us making it public

blazing ocean
shadow night
#

Nah, it's the mappings website saying it

young knoll
#

Yes?

#

We patch NMS

#

lol

blazing ocean
#

that's mappings..

young knoll
shadow night
#

If a mapping website says it's public I doubt it's spigot-only

blazing ocean
#

uh

#

wrong emoji

shadow night
#

lol

wise mulch
young knoll
#

Probably the WorldInitEvent

wise mulch
#

I want to be sure I am patching only my world types too so if I ever release this, that other people's different worlds are not affected

#

Ty, thanks

shadow night
#

Have not expected to encounter the owner of legacy modding while lurking in #help-development lol

blazing ocean
shadow night
blazing ocean
#

no i'm different

#

that one time was funny tho lmao

shadow night
#

yes

fierce salmon
#

@wet breach now I have the opposite issue from what I had before

#

I'm able to access the database through minecraft but im unable to access it through phpmyadmin

lusty cipher
#

is there some kind of Pair class in one of the included libs?

lusty cipher
#

thats not included with the spigot api though is it?

blazing ocean
wise mulch
#

So I have a simply SkyGrid generator, and I have generate structure set to true, however when I TP to a structure nothing is there (implying it only generated the bounding box)
How can I make it actually place the structure, or maybe detect when I am going over one and place something custom there?

#

For example since this is a challenge world type I don't mind say, just placing a frame where the stronghold should be, I just want a way to detect it.

undone axleBOT
#

It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.

wise mulch
#

I don't know what there is to show. in Spigot's source ChunkGenerator's only reference to structures contains a boolean whether or not to generate a structure, and BlockPopulator does not have anything relating to structures

#

What class are you wanting to see?

tardy delta
#

how am i supposed to help you

wise mulch
#

I don't know what part of my code you want me to show

orchid trout
#

the relevant part

tardy delta
#

dont know either

grim hound
#

On Bungeecord

#

Does anyone know what this might mean?

#

Also the players are disconnected with "Network Protocol Error"

wise mulch
#

I don't really know what part here is relevant. As I said the only reference to structures in the Spigot source is the boolean to enable them, which is true

blazing ocean
#

?paste

undone axleBOT
wise mulch
#

Yes, I know the code isn't clean. It's not finished

#

... Does the specific paste website suddenly matter?

viscid carbon
#

Quick question for yall. im creating a level system saving player files as yml. Should i store the xp in a say hashmap or just update the data everytime?

#

the question is will it use too many resources if i keep accessing/saving files like that

wise mulch
#

Updating the data every time might be slow. How often does this get updated?

blazing ocean
ivory sleet
grim hound
wise mulch
#

Off-thread could work too yeah

viscid carbon
#

Off thread. gotcha. thank yall.

wise mulch
#

I'd recommend using atomic writes in case the power goes out in the middle of updating the data.

wise mulch
#

Make copy of file > Update that file > When it is completely done overwrite the original file, and when that is successfully done, delete the copy.

#

You can name the copy something like yourname.yml.bak.

viscid carbon
#

wouldn't that use more resources constantly adding/removing files?

wise mulch
#

Atomic writes ensure that there is always an intact copy of the file in case of sudden interruptions like a power outage or crash that manages to abruptly stop the server before it can clean up.

#

If you don't do it, then your file will be become corrupted if your process is interrupted while it is writing.

viscid carbon
#

so the xp is getting updated every time they lets say. mine a ore.

quaint mantle
quaint mantle
ivory sleet
#

Mrarcane ru reading the data, or just writing it ?

wise mulch
#

If it's every time they pick up an orb I'd recommend storing the data as an object, and updating the yml periodically if you want it to save while the server is running.

viscid carbon
#

writing it.

wise mulch
#

Pick a time that is good for you, say every 10-30 seconds, and write all the data you've collected then.

ivory sleet
#

Yea then just have a thread pool where u write to files

sleek estuary
#

why the armorstand not teleports?

ivory sleet
#

and u want to also have a concurrent hash map instead of a normal hash map

wise mulch
#

You'll spam tons of file writes if you write every single time the exp of a player is updated, so I recommend just cachine the updated xp values and then running periodically.

grim hound
wise mulch
#

That too

#

Unless you mean your own XP system and not Minecraft's in which case it should be fine.

#

But if you mean vanilla's XP system then yeah it will cause issues spamming file writes when players kill tons of mobs in a farm

viscid carbon
sleek estuary
grim hound
#

Needs to be sync

sleek estuary
grim hound
#

Also use PacketEvents

sleek estuary
sleek estuary
blazing ocean
#

yea

#

you can shade it as well

grim hound
sleek estuary
#

why not protocollib

blazing ocean
#

slow

grim hound
#

Cuz it's more reliable

#

Faster

sleek estuary
grim hound
#

And multiplatform

ivory sleet
#

packet events is just nicer tho

grim hound
#

So portable

sleek estuary
blazing ocean
grim hound
grim hound
sleek estuary
#

this?

grim hound
#

Ye

blazing ocean
#

yea

sleek estuary
#

Where did you get that packetevents is faster? Did you see the code?

blazing ocean
#

plib is known to be slow

sleek estuary
grim hound
#

Packet Events creates ByteBufs directly

blazing ocean
#

i also prefer its way of handling payloads

grim hound
#

While ProtocolLib uses reflection which create packets and only then are translated into ByteBufs

grim hound
#

Which make a huge difference

#

Also ProtocolLib reads and rewrites every packet

sleek estuary
grim hound
#

Which is very often unnecessary

blazing ocean
sleek estuary
grim hound
#

And for PacketEvents you need to explicitly state that you want to read or write

grim hound
ivory sleet
#

I wouldn’t use plib being faster as a good argument, just packetevents not suffering from inferior infrastructural design, and being platform agnostic

sleek estuary
#

you shouldn't notice the difference

grim hound
#

And it grew larger

blazing ocean
grim hound
#

And he had no choice but to follow

ivory sleet
grim hound
blazing ocean
lament tree
#

Most stable 1.20 version?

blazing ocean
lament tree
#

Thanks

sleek estuary
#

I'm going to take off the bungeeguard

#

idk what option i put

#

if i not use bungeeguard

#

im on 1.8

#

legay or none?

ivory sleet
blazing ocean
#

?whereami

grim hound
#

Cuz I studied PacketEvents' internal structure I figured out a way to send a lot (like 600) in 0.01ms with NIO or 0.01ms per like 150 packets with Epoll

#

Very fast

blazing ocean
grim hound
#

I know how fast everything is

#

Cuz I did a lot of performance tests

sleek estuary
grim hound
#

And I can tell when something is fast

grim hound
blazing ocean
sleek estuary
#

@grim hound

#

and hamsterapi

#

you already see the code?

blazing ocean
grim hound
blazing ocean
grim hound
wise mulch
# grim hound

Yooo this is actually a sick way to fight bots wtf

grim hound
#

And here it takes 0.01ms

blazing ocean
grim hound
blazing ocean
#

for perf just use nms

blazing ocean
grim hound
#

My method

blazing ocean
ivory sleet
#

i mean for perf dont u just inject into netty straight away?

quaint mantle
#

I see

grim hound
blazing ocean
grim hound
#

Duuh

blazing ocean
ivory sleet
grim hound
#

It needs to be able to handle a lot of bots/players

#

At the same time

grim hound
#

It doesn't need to be compressed or anything

#

It can be sent as is

ivory sleet
#

I mean yea that makes sense

viscid carbon
#

if yall were trying to store a value and wanted to access it like a map but need a player name how would you do it?
map.put(p, skill, xp);
Something like that

blazing ocean
#

ez

ivory sleet
#

rust? Not assembly???

sleek estuary
grim hound
ivory sleet
#

p being the player name

#

Altho u probably wanna rely on UUID

blazing ocean
#

i don't understand the question lol

grim hound
#

UUID for a map key is faster

#

Even significantly I'd say

blazing ocean
viscid carbon
#

Ik, im just curious if theres a good way to store the uuid and the value name plus the value.

grim hound
#

If not identity equivalent

ivory sleet
grim hound
#

Need to be compared with their entirety

grim hound
#

IdentityHashMap in 99% of cases brings no actual benefit

#

Cuz the normal Map also does the identity check

sleek estuary
blazing ocean
grim hound
#

And hashCode() is usually cached

sleek estuary
blazing ocean
#

use the spigot artifact

grim hound
#

Or at the very least pretty fast

ivory sleet
blazing ocean
#

not PLATFORM

ivory sleet
#

Which is not delegated to Object#hashCode

blazing ocean
sleek estuary
#

oh ok

sleek estuary
grim hound
sleek estuary
#

shade have better performance?

pseudo hazel
#

im also actually trying to learn packetevents, is there a way to just send a packet to the client ? all the example use listeners but I just want to send a packet myself

blazing ocean
#

idk

grim hound
#

So fast that they literally decide to not cache it

ivory sleet
grim hound
#

But the UUID's hashCode it bound to be more unique

ivory sleet
#

And there is a difference to how collisions work w IdentityHashMap and HashMap

blazing ocean
#

my phone just froze for a solid thirty seconds wtfrick

grim hound
#

Or at least that's the whole idea behind being able to override that method

pseudo hazel
#

oh right I found it, I think getApi().getPlayerManager().sendPacket is the same thing right?

blazing ocean
pseudo hazel
#

cool

#

thanks

ivory sleet
#

you want to distribute over the codomain of ints evenly

blazing ocean
#

you can use thst one

ivory sleet
grim hound
#

Link

sleek estuary
#

not have packetplayreceiveevent.class

#

have yes

#

srry

grim hound
sleek estuary
grim hound
dire marsh
#

new WrapperPlayClientSteerVehicle(event)

grim hound
slender elbow
ivory sleet
#

Ah alr, what changed Emily?

slender elbow
#

it's just based on some random algo

ivory sleet
#

oh right

slender elbow
#

especially considering that the gc is free to move objects around

ivory sleet
#

myea fair enough

sleek estuary
dire marsh
sleek estuary
#

is sync?

grim hound
#

Btw is there any bungeecord development support channel?

grim hound
#

Everything is done on netty threads

#

There's usually 4 overall

#

And each player only has ever 1

sleek estuary
#

i know what is thread, but netty no

grim hound
#

So when a player has it's transfer on thread#0 it will always been on that thread

grim hound
#

So sending, receiving

sleek estuary
#

and to get the player instance in packetplayreceiveevent, is possible without use bukkit.getplayer(user.getname) ?

grim hound
#

Used by minecraft since 1.8

sleek estuary
#

or java

sleek estuary
grim hound
#

It's a lib for java

#

Used by minecraft

grim hound
sleek estuary
#

not have

grim hound
#

Uh

dire marsh
#

event.getPlayer

grim hound
#

No

dire marsh
#

you'll have to cast it to the bukkit player

sleek estuary
#

here say Object

dire marsh
#

yes

sleek estuary
#

ok

dire marsh
#

packetevents is multi-platform which is why

grim hound
#

Like bungeecord will have a different player

sleek estuary
grim hound
#

But remember

sleek estuary
grim hound
#

The Player object does not exist until PlayerJoinEvent

#

(At least for PE)

#

It's null before that

sleek estuary
#

not have?

sleek estuary
#

but thanks

grim hound
#

Name different

sleek estuary
grim hound
#

Search

grim hound
sleek estuary
grim hound
#

"Play" packets are called after JoinEvent

#

But for example "Handshaking" or "Login" packets are called before

sleek estuary
sleek estuary
#

It must have been the translator who misunderstood

#

not have look packet 😢

grim hound
#

Search more

sleek estuary
#

on play.client not have

#

only play.server

#

on protocollib i was using play.client

grim hound
#

Weird

sleek estuary
#

maybe works

grim hound
#

Btw, how can I have two plugins (one on Bungeecord, the other on one of it's servers) exchange information fast?

grim hound
#

ENTITY HEAD LOOK

#

is when an entity turns it's head

#

It's to inform others about that

#

It's not the player LOOK

fierce salmon
#

weirdly im able to connect to my database through jdbc in my minecraft plugin but it doesn't let me connect through phpmyadmin

sleek estuary
grim hound
#

So this is invoked many times

sleek estuary
#

api example only have packet events

grim hound
#

There should be just LOOK

sleek estuary
#

not have

grim hound
#

PLAYER_LOOK

sleek estuary
#

FACE_PLAYER?

grim hound
#

Maybe

#

See the class

sleek estuary
#

I wanted to do this

grim hound
#

The wrapper class that is

sleek estuary
grim hound
#

Do not use any "read"

#

Or "write"

#

Methods

sleek estuary
grim hound
#

Since they're for doing unholy stuff

grim hound
#

On manager do

sleek estuary
#

maybe this

sleek estuary
#

yaw is always 0

#

maybe player.getlocation.getyaw fixes

grim hound
#

is what the client sends when he just turns his head

#

PacketType.Play.Client.PLAYER_POSITION_AND_ROTATION is what he sends when he also moves at the same time

#

are UUIDs forwarded on bungeecord?

sleek estuary
sleek estuary
#

im using velocity

grim hound
#

the man himself said that there can be two

sleek estuary
sleek estuary
grim hound
#

Each server can't give a different uuid since each player name can only possibly have two. An online one and an offline one.

sleek estuary
#

Each server can't give a different uuid since each player name can only possible have two. An online one and an offline one.

remote swallow
#

backend spigot servers are in offline mode

grim hound
sleek estuary
#

my uuid on velocity equals with backend

grim hound
sleek estuary
grim hound
#

and it forwards to an offline mode?

sleek estuary
#

armorstand not teleporting. any solution?

remote swallow
#

all backend spigot servers are offlien

#

its only frontend bungee servers that should be online mode

grim hound
#

Can I make something like this: my spigot plugin on each spigot backend server and my bungeecord plugin which coordinates their data?

remote swallow
#

yeah

grim hound
#

is this how you do it?

remote swallow
#

just make sure you account for data when they move across servers and spigot will get leave but they might not actually leave

remote swallow
#

if not use something like redis

echo basalt
#

it just uses the player's connection

remote swallow
#

^^

grim hound
#

to communicate between servers?

echo basalt
#

Yeah

remote swallow
#

yeah

grim hound
#

the fuq

echo basalt
#

sends a client -> server packet from the proxy, through the player, to the backend

#

reverse process also works

grim hound
#

isn't that

#

like terrible?

echo basalt
#

a little

grim hound
#

I hate that already

#

then how can I transfer it undependingly of the player's connection?

remote swallow
#

redis

grim hound
remote swallow
#

basically llike an in memeory db

sleek estuary
#

why armorstand not is teleporting?

grim hound
#

how do I use that

#

for server communication?

#

and is it free?

sleek estuary
#

You didn't know about Redis?

grim hound
#

I have no idea what that is

sleek estuary
#

omg -'

sleek estuary
grim hound
#

I need a way to create a connection between the bungeecord and the spigot server for a data transfer

echo basalt
#

redis pubsub

sleek estuary
small valve
#

What event would I use on bungeecord to check if a player has successfully connected to a server?

Is it ServerConnectedEvent? This seems to be the instant before joining the server. The problem is sometimes the server kicks the player for some unknown reason; could be a ban or something else. I want something that fires only once the player is inside the server.

small valve
grim hound
small valve
#

am i just SOL? 😭

dusty herald
#

what are you trying to accomplish

small valve
dusty herald
#
    @EventHandler
    public void onPostLogin(PostLoginEvent postLoginEvent) {
        // CODE
    }```
#

tada

small valve
#

I'll try that and get back to you all, I thought i tried this a while ago and it was the instance before logging in

dusty herald
#

bungeecord has a few events for listening to player connections due to it being a proxy 😄

#

like ServerConnectEvent

#

so PostLoginEvent would be for a player joining the proxy but doesn't re-fire whenever joining a server within the network (i think), ServerConnectEvent would fire for each server switch (i think)

sleek estuary
#

why armorstand not is teleporting?

chrome beacon
#

Don't send code as image

#

?paste

undone axleBOT
chrome beacon
#

also show the entire method

chrome beacon
#

you're printing the same location in before and after?

#

I'm not sure what the point of that is

pliant topaz
sleek estuary
sleek estuary
sleek estuary
#

is spigot-1.8.799999999999999999999

grim hound
#

terrible

dusty herald
#

in the schedular try cloning the location

sleek estuary
#

im tried already

grim hound
pliant topaz
sleek estuary
#

but armorstand.getlocation creates new object already

#

so clone is lower performance

small valve
chrome beacon
sleek estuary
#

not have pc for 1.20

dusty herald
grim hound
pliant topaz
small valve
dusty herald
#

send code

chrome beacon
#

which doesn't make sense

young knoll
#

1.20 with some performance mods should run just as well as 1.8

dusty herald
#

don't mind this man with the CRV monitor who cannot run minecraft

chrome beacon
#

You don't need a powerful PC to run Minecraft

sleek estuary
sleek estuary
#

and singlecore?

chrome beacon
#

a mid range pc from 10 years ago should be able to do it

young knoll
#

My 10 year old i7 still runs it fine

dusty herald
#

okay. try cloningi t

sleek estuary
#

1.1 ghz?

sleek estuary
#

1.8 runs

chrome beacon
dusty herald
#

@small valve it's null when the player hasn't connected to the server yet (Technically)

small valve
#

"Old" code

    @EventHandler
    public void onPlayerJoinProxy(ServerConnectedEvent event) {
        if (event.getPlayer().getGroups().contains("not-first-join")) return;  // If not first join, don't do anything.
        event.getPlayer().addGroups("not-first-join");

        if (plugin.getConfig().getAsBoolean(ConfigDataKey.VANISH_ENABLED) && BungeeVanishAPI.isInvisible(event.getPlayer())) return;  // Ignore if invisible.

        join(event.getPlayer(), event.getServer(), false);
    }

"New" code

    @EventHandler
    public void onPostLogin(PostLoginEvent event) {
        if (event.getPlayer().getGroups().contains("not-first-join")) return;  // If not first join, don't do anything.
        event.getPlayer().addGroups("not-first-join");

        if (plugin.getConfig().getAsBoolean(ConfigDataKey.VANISH_ENABLED) && BungeeVanishAPI.isInvisible(event.getPlayer())) return;  // Ignore if invisible.

        plugin.getProxy().getScheduler().schedule(plugin, () -> {
            join(event.getPlayer(), event.getPlayer().getServer(), false);
        }, 50L, TimeUnit.MILLISECONDS);
    }

I delayed it by 50 milliseconds to see if that's what's causing the null server.

dusty herald
#

which happens sometimes

sleek estuary
#

anyway, 1.8 is the most played version

dusty herald
#

nah it's not

#

that would be 1.2.5

sleek estuary
#

and hosting becomes much more expensive for 1.20

small valve
dusty herald
dusty herald
sleek estuary
#

to host 800 players

#

on 1.8

#

you can make this on 1.20?

dusty herald
#

that's a skill issue :)

wise mulch
#

How do I generate a tree with a bee nest? I see LimitedRegion has an option to place trees, but I don't see any option to make it generate with a bee nest. Does it do so automatically?

dusty herald
#

You can easily get a cheap VPS for less

sleek estuary
wise mulch
sleek estuary
wise mulch
#

Also you are underestimating how optimized Spigot is these days

dusty herald
#

paper.

sleek estuary
#

1 dedicated without plugins, just with the .jar itself, it already takes up I don't know how much processor/ram

#

i use a cpu 4º generation

dusty herald
#

BARELY ANY

wise mulch
#

Paper is not necessary, it seems that vanilla Spigot 1.20.6 generates terrain faster than vanilla Spigot 1.16.5

wise mulch
sleek estuary
young knoll
#

If 1.8 can run it, a stripped down 1.20 can run it

sleek estuary
#

on 1.8

pliant topaz
#

my old pc had a 4th gen i5 and i would guess it couldnt handle such high player numbers

young knoll
#

Even hypixel only runs 100 on their largest servers

wet breach
pliant topaz
timid spear
#

Heya,

#

me again.

#

What is the equivalent of ConfigurationProvider?

chrome beacon
undone axleBOT
wet breach
#

you would need a completely custom implementation that makes it possible

pliant topaz
#

was just a guess, ik how powerful one of the new threadrippers is, but not how much such high player numbers would actually take up on performance

young knoll
#

Even folia’s test was only like 330

#

Granted it wasn’t 1.8 but still

wise mulch
#

Folia is only for new versions unfortunately

sleek estuary
#

i runs 800 without lag on 1.8 on i7-4790k

wise mulch
#

Society if Folia had a 1.8 and 1.16 version

pliant topaz
young knoll
#

Yeah I don’t buy that

wise mulch
sleek estuary
#

and good plugins

young knoll
#

I have a 4770k and it struggles with 1 server and 1 client

wet breach
sleek estuary
young knoll
#

200 != 800

sleek estuary
wet breach
#

prints?

sleek estuary
#

I never actually got 800. just 600

sleek estuary
wet breach
#

oh you mean screenshots

young knoll
#

So you claimed 800, but now you’re saying 600, and you only have proof of 200

wet breach
#

and the only way to get 600 is basically reducing stuff probably too almost 0

chrome beacon
#

claimed 800 multiple times
asked for proof backs down to 600
and only has proof of 200

wet breach
#

as you said, except that last part

sleek estuary
young knoll
#

It also depends on how spread out they are

sleek estuary
#

I never caught it due to lack of players

young knoll
#

If you shove 800 players all in the same chunk it’ll run a lot better than 800 players playing survival

sleek estuary
#

for example

pliant topaz
#

Even 200 my machine would struggle, and i got an i7-12700K on 4% oc w/ 32GB 3600MHz, that on a i7-4470? idkkk

young knoll
#

lol

#

That sounds horrible to play

wise mulch
timid spear
# chrome beacon ?configs

Well, I know how to usually use configs.
My question was, if there is anything like the ConfigurationProvider from Bungeecord.
Because I am migrating this whole code from a Waterfall plugin into a new Spigot API plugin.

sleek estuary
wise mulch
#

Ah ok

young knoll
#

You need to cast to CraftWorld and then getHandle

sleek estuary
#

and the plugins weren't the best

chrome beacon
wise mulch
sleek estuary
#

any solution to make the movement flow?

wet breach
young knoll
#

3 chunk render distance would not be fun in survival

#

Or even something like bedwars

sleek estuary
#

was factions

young knoll
#

Imagine someone building a cannon to attack your base

#

But it’s too far away for you to see

sleek estuary
pliant topaz
#

imma just be sayin, maybe not the best, but hey,
if it works, don't u dare touch it

slender elbow