#help-development
1 messages · Page 1027 of 1
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?
that whole BiomeConfig stuff can be an enum
and you're not checking the input on getBiomeConfig, it could be null
but yeah, unless DEFAULT is null somehow
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
lol
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
"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?
probably, gonna have to be more specific
you can cancel messages?
from the chat?
yea
that is sick
?support
why i'm not getting the jar file when i compile it?
It‘s in the target folder
Oh and you need to run package
i think so
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
Instead of compile
Right side, click the maven tab, then lifecycle -> double click package
what is the difference between compile and package i usualy use it for the same way (sorry for the stupid question)
also i don't think you need to clean on every build, that just slows it down
Compile only compiles code but doesnt put it into a jar
Package = compile + create jar
oh okay thanks a lot
I mean clean is generally fast
Oh true
So it was the right call for me to remove it lol
I was trying to get incremental working with Kotlin
incremental is so good
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
it is
gradle + kotlin dsl is so good
Yes
how do i check if PlayerMoveEvent was triggered from velocity or by the player
isn't there a PlayerVelocityEvent or something
this might help you
hashmaps?
how can I check if my Runnable I scheduled as an async task has completed?
ru using bukkit scheduler or some other way to dispatch it async in the first place?
bukkit scheduler
oh is it that simple? great thanks
obviously but I guessed that something like this is builtin functionalizy
sounds like a design flaw
?jd
declaration: package: org.bukkit.scheduler, interface: BukkitScheduler
IsQueued/isRunning
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
how come
is the SignEditEvent also called on the initial edit when the sign is placed?
Can u set armorstands to no clip state in 1.16.5?
yes beacuse its impossible to distinguish between the two
I looked into PRing a edit type a while back but unfortunately its impossible add
thats actually nice, i just need to get the content of the sign on the initial write
i'd double check and make sure it still work but it did last time I check in like 1.19.4
is there a way to detect if the sign was empty before? to maybe detect if its the initial write
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
k nice
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
so i get the lines using getLines, but i cant get wheater or not its the initial edit ?
ye
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?
ok imma do that
but that's pretty easy. yeah I wish you could distinguish between the two
but alas :(
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
Try listening to the PlayerSteerPacket if they're riding on the armor stand
that should send you key presses
im on spigot 1.8.8
im bored
rip bro
Thats erotic
Love it
Is the field on the bottom for a seed?
I feel bad for doing it this way
yep
why the forEach, why the requireNonNull, why not using a stream?
why use streams when you can just have a regular for loop
+1
two points seemed a bit weak
what lang? dont tell me its java
intellij not detecting my lombok wtf help?
Where i can found minecraft packets list?
i need player click recipe book packet
PacketPlayOutCraftingRecipeBookOpen???
IDK
why not java?
idk
I'd rather make it in rust or something but I'm not fond of making UIs in it
i found it without packets, thanks
javafx is a thing ig
PlayerRecipeBookSettingsChangeEvent works perfectly
nice
wait wrong person lmao
i love compose
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
got the code?
do you mean bungee or spigot
It was a Waterfall (Bungeecord) plugin once, and now I migrate everything into the Spigot API. Got about 80 % so far.
So: Bungeecord -> Spigot
@timid spear
an async scheduler already exists
yup
Does a nether block has a tilestate?
why does this look like a completablefuture wrapper
What do you consider a nether block
Only blocks that need to store additional data have a tile state
completablefutures my beloved
For example chests, furnaces, beacons etc
@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.
?blockpdc
Learn about CustomBlockData here:
https://www.spigotmc.org/threads/custom-block-data-persistentdatacontainer-for-blocks.512422/
?blockpdc
Learn about CustomBlockData here:
https://www.spigotmc.org/threads/custom-block-data-persistentdatacontainer-for-blocks.512422/
rip got sniped
rekt
Incredibly predictable too
Wow this is incredibly useful.
Instead of BlockPDC I have my own chunk system so I can host custom data :)
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
Seems like so
why are you making your own wrapper
WorldBlockStorage<MyCustomData> storage = new WorldBlockStorage<>(plugin, new PDCChunkStorage(plugin));
MyCustomData data = storage.getBlockAt(location);
data.doWhatever()
storage.saveBlock(data)
pardon? 😮
why can't you just use the scheduler itself
hmm
How does this plugin work? How can it add PDC to every block?
ah so basically a chunk with a location/data table inside?
Something like that
and then patches the events
Better descriptor is a map
Not really no
Chunks have PDC
This just makes a PDC that gets stored inside the chunk for the block you're messing with
And tries its best to remove it when the block is removed iirc
Idk how much gets left behind
Ah yeah I see.
You just provide the block and it does its thing to store and get the metadata
in CustomBlockData? iirc only doesn't detect block changes through API/WorldEdit/setblock
why no we support 😢
how do i write string?
there is code provided to write varint
what about string?
The FriendlyByteBuf is what nms uses
?nms
also you can just use the packet directly
im not trying to create a plugin
you should have said so in your message
wiki vg has information on how the packets are structured
the string is just an utf8 string
[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]
?ask
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!
that method doesn't exist
so there you go
Inventory has no such method getName
whats that
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?
FriendlyByteBuf#writeType()
It's part of nms
new FriendlyByteBuf(Unpooled.directBuffer())
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
then you are in the wrong place here
where do i go then?
depends on what you're doing
trying to write a simple client?
then this is certainly not the place
where
How do I solve this?
if you're making it from scratch you're p much on your own good luck
what really?
what could be the formula to teleport player 1 block on their left?
wdym nope..??
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
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
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
like what
that seems corect
reinventing minestom?
read the docs
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
/**
* 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);
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
omg cabernetmc
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?
because noone has pull-requested it yet :p
because its a hack
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
I'm actually not a developer. I was just trying to upgrade a project on github from version 1.9 to 1.20.4 and I ran into this problem. I'll find some developers from admincraft and have them do it. nothing to do.
because I already have a scoreboard I use for displaying information, so idk how I would do that
idk does this help?
https://chatgpt.com/share/23dee229-2adf-4987-945c-e571152dc601
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
hmmm maybe this? https://chatgpt.com/share/23dee229-2adf-4987-945c-e571152dc601
why you only sharing chatgpt links
he has chatgpt4
because that's how I usually solve stuff like this and in 99% of cases, it has nice answers
I don't think alex has the ability to think by himself anymore
ik
so its somewhat intelligent
real
I don't think you guys realize how bad the AI problem is in search engines now
Whenever it's time to think, his brain fires open https://chatgpt.com
most of the stuff you search for isn't even valid rather have an LLM who sifts through the BS quickly sometimes
Truly 'I forgor' moment
@tender shard that second one did it
very weird but oh well
Anyone know what scriptus plugin does for craftbukkit
I guess it sets these properties
am i doing it correctly?
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
}
Ye, then it auto closes
ok
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..
i'd just create one scoreboard per player - alternatively an existing scoreboard API like this https://github.com/MegavexNetwork/scoreboard-library (I don't know that one, just googled scoreboard API because the bukkit way of adding text is a pain)
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
aren't scoreboards and teams two different things? tbh no clue, never used any of those
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
is there a UI or inventory i can use for the book signing page
poo
fastboard is good
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
you have what
Is the difference significant
it is usually 2x or higher
wait no that's splittable random
this is like 8x
Btw, have I seen you before?
Cuz your name is familiar
I am the owner of Legacy Modding
oh wait what
Yea
lmao
I only mod 1.7.10 but I sometimes dabble in servers, which are usually modern
Understandable
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
It's fast and modern has a lot of junk and random wrapper/helper classes
1.21 doesn't have tc4 so it can't be best
doesn't have what
Thaumcraft 4
oh
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
Well, 1.8 plugins can barely do anything comparing to 1.20.6
So anyways let's get back on topic, how can I initialize my custom worlds, with a custom Random instance?
which actually allow you to do more than texturss
Where may I insert Xoshiro over the standard random?
I wonder if reflection could do something here
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
Reflection can change final fields
Doubt it
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.
Static fields are the problem
Yeah, STATIC FINAL is basically impossible to change without ASM or Mixin
Reflection can't change them.
mixins ftw
I think you can do it with unsafe
Ty
Well, random shouldn't be static
Yeah, it's usually just final or a regular field
I think it's private final
Either way thanks, I'll use reflection and insert my Rand instance into Level, assuming that is the correct place.
Oh, if it's public that makes things easier
Weird shit
Might be us making it public
it's nms
Nah, it's the mappings website saying it
that's mappings..
Ah true
If a mapping website says it's public I doubt it's spigot-only
lol
Where is the first possible time the Level is available for me to patch the Rand instance for my custom world type only?
Probably the WorldInitEvent
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
Have not expected to encounter the owner of legacy modding while lurking in #help-development lol
raydan ik you're watching 👁️
Should've said this before I started chatting, not after
yes
@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
is there some kind of Pair class in one of the included libs?
thats not included with the spigot api though is it?
include apache commons
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.
?nocode
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.
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?
how am i supposed to help you
I don't know what part of my code you want me to show
the relevant part
dont know either
On Bungeecord
Does anyone know what this might mean?
Also the players are disconnected with "Network Protocol Error"
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
?paste
Yes, I know the code isn't clean. It's not finished
... Does the specific paste website suddenly matter?
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
Updating the data every time might be slow. How often does this get updated?
why not run it in the background
Its fine, just make sure its done off the server thread
Does anyone know?
Off-thread could work too yeah
Off thread. gotcha. thank yall.
I'd recommend using atomic writes in case the power goes out in the middle of updating the data.
How do you do that?
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.
wouldn't that use more resources constantly adding/removing files?
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.
so the xp is getting updated every time they lets say. mine a ore.
Better split the YAMLs.
Make a cache where player data is stored and push into YAMLs when plugin disables.
Mrarcane ru reading the data, or just writing it ?
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.
writing it.
Pick a time that is good for you, say every 10-30 seconds, and write all the data you've collected then.
Yea then just have a thread pool where u write to files
why the armorstand not teleports?
and u want to also have a concurrent hash map instead of a normal hash map
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.
And every time a server saves it's worlds
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
that's what i was thinking. im using my own xp system.
i need make bukkit.getscheduler.runtask?
Also use PacketEvents
Ye
is a lib?
Yes
why not protocollib
slow
but I already use protocollib for other plugins that need it, so it's better to use protocollib
And multiplatform
packet events is just nicer tho
So portable
I already use protocollib because of bungeeguard
kmp mentioned????
Doesn't matter
Uh
this?
Ye
yea
Where did you get that packetevents is faster? Did you see the code?
plib is known to be slow
That does not mean anything
Packet Events creates ByteBufs directly
i also prefer its way of handling payloads
While ProtocolLib uses reflection which create packets and only then are translated into ByteBufs
And this is true for all operations
Which make a huge difference
Also ProtocolLib reads and rewrites every packet
and why didn't protocollib solve it?
Which is very often unnecessary
idk ask dmulloy
there must be a reason
And for PacketEvents you need to explicitly state that you want to read or write
It's deemed more convenient
I wouldn’t use plib being faster as a good argument, just packetevents not suffering from inferior infrastructural design, and being platform agnostic
you shouldn't notice the difference
But it's probably because people got used to it
And it grew larger
plib's way of handling packet payloads is ass
And he had no choice but to follow
I never read plibs impl thankfully
There's a significant difference in the performance tho
i meant using it
Most stable 1.20 version?
.4
Thanks
you use velocity so?
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?
I mean I believe you, but do you have any benchmarks of it? Official ones
?whereami
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
No
ah yes, le gay
But just looking at the code
I know how fast everything is
Cuz I did a lot of performance tests
whats the difference
question
why
And I can tell when something is fast
wait that's so cool
but why not use the api for that
Haven't you already seen that and said the exact same thing? xD
too slow?
potentially
It'd take like 50 ms
Yooo this is actually a sick way to fight bots wtf
And here it takes 0.01ms
ngl that sounds reasonable
Okay maybe more like 5-10 ms
for perf just use nms
even more reasonable
why not use api then lol
i mean for perf dont u just inject into netty straight away?
Cuz it's 500-1000 times faster
for perf don't use networks
Duuh
Yes
yes but for 5-10ms? 😭
Naa that1 is crazy
It's an antibot
It needs to be able to handle a lot of bots/players
At the same time
I just write the data directly
It doesn't need to be compressed or anything
It can be sent as is
I mean yea that makes sense
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
rust? Not assembly???
@grim hound
what
Did not
map.get(p)
p being the player name
Altho u probably wanna rely on UUID
i don't understand the question lol
how are two longs that much faster than a string
Ik, im just curious if theres a good way to store the uuid and the value name plus the value.
pairs
or records
Strings
If not identity equivalent
I mean if you really wanna be fast, go with IdentityHashMap<Player,V>
Need to be compared with their entirety
Fun fact
IdentityHashMap in 99% of cases brings no actual benefit
Cuz the normal Map also does the identity check
fuck
...
And hashCode() is usually cached
use the spigot artifact
Or at the very least pretty fast
yes but Player uses UUID
not PLATFORM
Which is not delegated to Object#hashCode
and you can shade it btw
oh ok
no
UUID's hashCode method is just two bit operations
shade have better performance?
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
idk
So fast that they literally decide to not cache it
yes
User#sendPacket
Yes but System::identityHashCode is just the memory address basically
Yes
But the UUID's hashCode it bound to be more unique
And there is a difference to how collisions work w IdentityHashMap and HashMap
my phone just froze for a solid thirty seconds wtfrick
Or at least that's the whole idea behind being able to override that method
indeed
oh right I found it, I think getApi().getPlayerManager().sendPacket is the same thing right?
isn't there like PacketEvents.getPlayerManager().sendPacket()?
yea
I don't remember that
you want to distribute over the codomain of ints evenly
you can use thst one
There is
well iirc HashMap has a better collision impl w linkedlists, whereas IHM just iterates around the array
Link
not have packetplayreceiveevent.class
have yes
srry
That is a competly different thing to what you sent
How do I do this with packet events?
Can anyone help me with this?
you get stuff from the packet wrapper
new WrapperPlayClientSteerVehicle(event)
Just read the example @sleek estuary
uh that might have been the case a decade ago but not anymore
What
Wdym?
Ah alr, what changed Emily?
it's just based on some random algo
oh right
especially considering that the gc is free to move objects around
myea fair enough
maybe?
yes
is sync?
Btw is there any bungeecord development support channel?
No
Everything is done on netty threads
There's usually 4 overall
And each player only has ever 1
idk what exactly is netty thread
i know what is thread, but netty no
So when a player has it's transfer on thread#0 it will always been on that thread
Netty is the API used for data transportation
So sending, receiving
and to get the player instance in packetplayreceiveevent, is possible without use bukkit.getplayer(user.getname) ?
Used by minecraft since 1.8
Yes
lib for minercraft?
or java
how
Try User#getPlayer
not have
Uh
event.getPlayer
No
you'll have to cast it to the bukkit player
yes
ok
.
packetevents is multi-platform which is why
Cuz it's for many platforms
Like bungeecord will have a different player
Do I have the guarantee that casting will never throw an exception or do I have to check?
But remember
oh ok
The Player object does not exist until PlayerJoinEvent
(At least for PE)
It's null before that
not have?
I don't even touch this event
but thanks
im not seeing
Search
I'm telling you because packets flow before that event as well
how the steer vehicle packet will be called before the player enters
It won't
"Play" packets are called after JoinEvent
But for example "Handshaking" or "Login" packets are called before
from what I understand here, you said that the event I'm working on (packetplay...) is called before entering too
It's not
Search more
Weird
maybe works
Btw, how can I have two plugins (one on Bungeecord, the other on one of it's servers) exchange information fast?
No
ENTITY HEAD LOOK
is when an entity turns it's head
It's to inform others about that
It's not the player LOOK
weirdly im able to connect to my database through jdbc in my minecraft plugin but it doesn't let me connect through phpmyadmin
and I want it
It's sent to every player to update that ANY entity has turned it's head
So this is invoked many times
oh
api example only have packet events
There should be just LOOK
not have
PLAYER_LOOK
FACE_PLAYER?
I wanted to do this
The wrapper class that is
on manager?
Since they're for doing unholy stuff
maybe this
on manager idk what i make
yaw is always 0
maybe player.getlocation.getyaw fixes
PacketType.Play.Client.PLAYER_ROTATION
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?
thx
I just saw that my uuid is the same in the proxy and in backend server, so probably yes.
im using velocity
the man himself said that there can be two
copy the text pls
I understand that he said that each player can't possibly have two
Each server can't give a different uuid since each player name can only possibly have two. An online one and an offline one.
Each server can't give a different uuid since each player name can only possible have two. An online one and an offline one.
backend spigot servers are in offline mode
but I guess it's like that for every server
then it matches the statistics I told you
my uuid on velocity equals with backend
so what if the only allowing server is in online mode
and it forwards to an offline mode?
all backend spigot servers are offlien
its only frontend bungee servers that should be online mode
btw
Can I make something like this: my spigot plugin on each spigot backend server and my bungeecord plugin which coordinates their data?
yeah
is this how you do it?
just make sure you account for data when they move across servers and spigot will get leave but they might not actually leave
that requires a player to be online so if you only manage data while their online yes
if not use something like redis
how does this work exactly then?
and why only when they're online?
it just uses the player's connection
^^
to communicate between servers?
Yeah
yeah
the fuq
sends a client -> server packet from the proxy, through the player, to the backend
reverse process also works
a little
I hate that already
then how can I transfer it undependingly of the player's connection?
redis
wassdat
basically llike an in memeory db
why armorstand not is teleporting?
uhh
how do I use that
for server communication?
and is it free?
You didn't know about Redis?
I have no idea what that is
omg -'
yes
I need a way to create a connection between the bungeecord and the spigot server for a data transfer
redis pubsub
redis or plugin channel
hey
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.
PlayerLoginEvent
This event doesn't exist via bungeecord
https://javadoc.io/doc/net.md-5/bungeecord-api/latest/index.html
These are the only ones I see
then PostLoginEvent
This is again prior to the player actually joining the server
am i just SOL? 😭
what are you trying to accomplish
I want to send a proxy-wide join message iff a player successfully joins an underlying server.
@EventHandler
public void onPostLogin(PostLoginEvent postLoginEvent) {
// CODE
}```
tada
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
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)
also show the entire method
you're printing the same location in before and after?
I'm not sure what the point of that is
yes
don't tell me that's 1.8.8
teleport the armorstand
no
that's
is spigot-1.8.799999999999999999999
terrible
in the schedular try cloning the location
same thing
im tried already
the player can just change this as he sees fit
can i ask why you don't use a newer version? just curious
but armorstand.getlocation creates new object already
so clone is lower performance
Now ProxiedPlayer#getServer is null 😭 which I need
sending the same message twice has nothing to do with with teleporting
brazilian community
not have pc for 1.20
which event are you using
ServerSwitchEvent?
oh, okay, thats unfortunate :/
what you want mean
I'm using PostLoginEvent
I was using ServerConnectedEvent but that fires event when a player just joins the proxy but gets disconnected immediately after
send code
I asked what the point of sending the same message twice is and your answer was teleporting the player
which doesn't make sense
1.20 with some performance mods should run just as well as 1.8
don't mind this man with the CRV monitor who cannot run minecraft
You don't need a powerful PC to run Minecraft
I was wrong in sout
minecraft runs on 1 gb ram?
and singlecore?
a mid range pc from 10 years ago should be able to do it
My 10 year old i7 still runs it fine
okay. try cloningi t
1.1 ghz?
I'm sure you can afford something from within the last 10 years
@small valve it's null when the player hasn't connected to the server yet (Technically)
"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.
which happens sometimes
I'm not talking about me. I'm talking about Brazilians
anyway, 1.8 is the most played version
and hosting becomes much more expensive for 1.20
Is there no event for when the player successfully joins the server (not proxy)?
what ???
that makes ZERO sense.
i pay 20$
to host 800 players
on 1.8
you can make this on 1.20?
that's a skill issue :)
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?
You can easily get a cheap VPS for less
of course not
Use Folia
bro
Also you are underestimating how optimized Spigot is these days
okay imma be real with you 110%.
paper.
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
BARELY ANY
Paper is not necessary, it seems that vanilla Spigot 1.20.6 generates terrain faster than vanilla Spigot 1.16.5
Paper lobotomizes vanilla game mechanics
for host 800 players
If 1.8 can run it, a stripped down 1.20 can run it
on 1.8
The thing is, 800 players is really much, like, if all of em are online at the same time
my old pc had a 4th gen i5 and i would guess it couldnt handle such high player numbers
Even hypixel only runs 100 on their largest servers
this wouldn't be because of anything spigot did, rather mojang optimizing stuff. Spigot tends to not change any of the vanilla mechanics if it isn't necessary
I mean, if we account for enterprise level hardware, maybe a bit over 1000 players max until it starts lagging? something like that prob
?configs
See this wiki page on how to use custom configuration files: https://www.spigotmc.org/wiki/config-files/
no, enterprise level hardware wouldn't be able to handle it
you would need a completely custom implementation that makes it possible
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
Folia is only for new versions unfortunately
i runs 800 without lag on 1.8 on i7-4790k
Society if Folia had a 1.8 and 1.16 version
How ;-;
Yeah I don’t buy that
Pics or it didn't happen
I have a 4770k and it struggles with 1 server and 1 client
you can make whatever claims you want, but without verifiable proof you will be hard pressed to have many believe you on this
Believe whoever wants. If you want I can send you a print with 200 ons
200 != 800
i not have prints of 800
prints?
I never actually got 800. just 600
of 200? i have
oh you mean screenshots
So you claimed 800, but now you’re saying 600, and you only have proof of 200
and the only way to get 600 is basically reducing stuff probably too almost 0
claimed 800 multiple times
asked for proof backs down to 600
and only has proof of 200
as you said, except that last part
no, I just said I can get 800, but I never got it. I just got 600
It also depends on how spread out they are
I never caught it due to lack of players
If you shove 800 players all in the same chunk it’ll run a lot better than 800 players playing survival
view-distance: 3
for example
Even 200 my machine would struggle, and i got an i7-12700K on 4% oc w/ 32GB 3600MHz, that on a i7-4470? idkkk
I don't see anywhere where a "level" instance is exposed. I'm checking everything in World and the event itself but there's nowhere to hook my random into
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.
nobody complained
Level is NMS
Ah ok
You need to cast to CraftWorld and then getHandle
and the plugins weren't the best
No use the yaml/file configuration class
"My nuts were always swelling, why would anyone complain about their nuts swelling"
any solution to make the movement flow?
I am sure if many of them are from a third world country, they would most likely not complain
was factions
Imagine someone building a cannon to attack your base
But it’s too far away for you to see
no one complained about the gameplay 😂
imma just be sayin, maybe not the best, but hey,
if it works, don't u dare touch it
1k
