DenizenScript / Denizen

NPC and general Spigot scripting, using the Denizen Scripting Language!
https://denizenscript.com/
MIT License
213 stars 106 forks source link

Fake blocks with bundle packets POC #2606

Closed tal5 closed 6 months ago

tal5 commented 7 months ago

Currently there's some issues with showfake, and in general it's pretty complex handling with directly editing the chunk packet's data and all. With bundle packets now being a thing, it's possible to bundle together the original chunk packet with separate block change packets for the fake blocks, which seems to fix the tile entity issue & looks a lot cleaner imo. I've used ClientboundSectionBlocksUpdatePacket instead of just normal block change packets, to be a little more efficient with large amounts of fake blocks - currently it sorts the blocks into sections every single time, but can store them per section in FakeBlockMap to avoid that.

As for performance, I've done some stress testing with ~100k fake blocks and it seemed to work fine (albit on a local server lol, but this is a pretty extreme case anyway).