How to create MultiBlockChangePacket in 1.16.2?
GorgeousOne opened this issue · 1 comments
I wanted to know how to create the new MultiBlockChangePacket introduced in 1.16.2. I could not figure out yet how exactly to write the data for the changed blocks into it.
As I understood it from reading the PacketContainerTest the chunk in which the changes happen can be set with a BlockPosition of any position in the chunk like
packet.getSectionPositions().writeSafely(0, new BlockPosition(42, 43, 44));
And the different changed block data is as added with an array of WarappedBlockData like
packet.getBlockDataArrays().writeSafely(0, new WrappedBlockData[] { WrappedBlockData.createData(Material.IRON_BARS), WrappedBlockData.createData(Material.IRON_BLOCK) });
But didn’t understand how the position for each block can be defined. Is it connected to this line?
packet.getShortArrays().writeSafely(0, new short[] { 420, 69 });
how exactly would these integers connect to positions?
Thanks for reading