Multi Block Change API Implementation
This commit is contained in:
@@ -21,3 +21,18 @@
|
||||
private ClientboundSectionBlocksUpdatePacket(FriendlyByteBuf buf) {
|
||||
this.sectionPos = SectionPos.of(buf.readLong());
|
||||
int i = buf.readVarInt();
|
||||
@@ -54,6 +62,14 @@
|
||||
|
||||
}
|
||||
|
||||
+ // Paper start - Multi Block Change API
|
||||
+ public ClientboundSectionBlocksUpdatePacket(SectionPos sectionPos, it.unimi.dsi.fastutil.shorts.Short2ObjectMap<BlockState> blockChanges) {
|
||||
+ this.sectionPos = sectionPos;
|
||||
+ this.positions = blockChanges.keySet().toShortArray();
|
||||
+ this.states = blockChanges.values().toArray(new BlockState[0]);
|
||||
+ }
|
||||
+ // Paper end - Multi Block Change API
|
||||
+
|
||||
private void write(FriendlyByteBuf buf) {
|
||||
buf.writeLong(this.sectionPos.asLong());
|
||||
buf.writeVarInt(this.positions.length);
|
||||
|
||||
Reference in New Issue
Block a user