Getting chunk block data?
soshimee opened this issue ยท 2 comments
Make sure you're doing the following
- You're using the latest build for your server version
- This isn't an issue caused by another plugin
- You've checked for duplicate issues
- You didn't use
/reload
Describe the question
There doesn't seem to be a method for getting the block data from the chunk data.
API method(s) used
AbstractStructure#getLevelChunkData()
Expected behavior
There should be a way to access all the block data, not just the block entities and height maps.
Code
None.
Additional context
None.
Hi, you can access the encoded block data of the chunk using getBuffer()
. However, this just a byte array like in the actual NMS packet class. I do not think that we can provide proper wrapper methods for parsing this raw data in ProtocolLib.
Hi, is it possible to set chunk data from a bukkit Chunk? e.g.
Here I'm using PacketWrapper but if you have a solution with ProtocolLib I'll take it.
Chunk playerChunk = player.getChunk();
PacketContainer packet = protocolManager.createPacket(PacketType.Play.Server.MAP_CHUNK);
WrapperPlayServerMapChunk wrapper = new WrapperPlayServerMapChunk(packet);
wrapper.setChunkData(/* get chunk data somehow */);
wrapper.setLightData(/* get chunk light data somehow */);
Thanks!