public class ChunkDeltaUpdateS2CPacket extends Object implements Packet<ClientPlayPacketListener>
| Modifier and Type | Field and Description |
|---|---|
private BlockState[] |
blockStates |
private short[] |
positions
The packed local positions
ChunkSectionPos#getPackedLocalPos for each entry in blockStates. |
private ChunkSectionPos |
sectionPos |
| Constructor and Description |
|---|
ChunkDeltaUpdateS2CPacket() |
ChunkDeltaUpdateS2CPacket(ChunkSectionPos sectionPos,
it.unimi.dsi.fastutil.shorts.ShortSet updatedPositions,
ChunkSection section) |
| Modifier and Type | Method and Description |
|---|---|
private void |
allocateBuffers(int positionCount) |
void |
apply(ClientPlayPacketListener clientPlayPacketListener) |
void |
read(PacketByteBuf buf) |
void |
visitUpdates(BiConsumer<BlockPos,BlockState> biConsumer)
Calls the given consumer for each pair of block position and block state contained in this packet.
|
void |
write(PacketByteBuf buf) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisWritingErrorSkippableprivate ChunkSectionPos sectionPos
private short[] positions
ChunkSectionPos#getPackedLocalPos for each entry in blockStates.private BlockState[] blockStates
public ChunkDeltaUpdateS2CPacket()
public ChunkDeltaUpdateS2CPacket(ChunkSectionPos sectionPos, it.unimi.dsi.fastutil.shorts.ShortSet updatedPositions, ChunkSection section)
sectionPos - the position of the given chunk section that will be sent to the clientupdatedPositions - the set of packed local positions within the given chunk section that should be included in the packetprivate void allocateBuffers(int positionCount)
public void read(PacketByteBuf buf) throws IOException
read in interface Packet<ClientPlayPacketListener>IOExceptionpublic void write(PacketByteBuf buf) throws IOException
write in interface Packet<ClientPlayPacketListener>IOExceptionpublic void apply(ClientPlayPacketListener clientPlayPacketListener)
apply in interface Packet<ClientPlayPacketListener>public void visitUpdates(BiConsumer<BlockPos,BlockState> biConsumer)