mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-13 11:41:52 +01:00
MultiBlockChangePacket use a var long array
This commit is contained in:
parent
1c2ebc3991
commit
c5728a2df1
@ -24,7 +24,7 @@ public record MultiBlockChangePacket(long chunkSectionPosition,
|
||||
public void write(@NotNull BinaryWriter writer) {
|
||||
writer.writeLong(chunkSectionPosition);
|
||||
writer.writeBoolean(suppressLightUpdates);
|
||||
writer.writeLongArray(blocks);
|
||||
writer.writeVarLongArray(blocks);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -221,6 +221,17 @@ public class BinaryWriter extends OutputStream {
|
||||
}
|
||||
}
|
||||
|
||||
public void writeVarLongArray(long[] array) {
|
||||
if (array == null) {
|
||||
writeVarInt(0);
|
||||
return;
|
||||
}
|
||||
writeVarInt(array.length);
|
||||
for (long element : array) {
|
||||
writeVarLong(element);
|
||||
}
|
||||
}
|
||||
|
||||
public void writeLongArray(long[] array) {
|
||||
if (array == null) {
|
||||
writeVarInt(0);
|
||||
|
Loading…
Reference in New Issue
Block a user