From 58b103afd6225af5953b6c15ef7abd62ddf3cc9c Mon Sep 17 00:00:00 2001 From: themode Date: Fri, 25 Feb 2022 03:00:53 +0100 Subject: [PATCH] Improve FilledPalette serialization --- .../server/instance/palette/FilledPalette.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/main/java/net/minestom/server/instance/palette/FilledPalette.java b/src/main/java/net/minestom/server/instance/palette/FilledPalette.java index c69d26a52..eda1cfd10 100644 --- a/src/main/java/net/minestom/server/instance/palette/FilledPalette.java +++ b/src/main/java/net/minestom/server/instance/palette/FilledPalette.java @@ -38,14 +38,8 @@ record FilledPalette(int dimension, int value) implements SpecializedPalette.Imm @Override public void write(@NotNull BinaryWriter writer) { - writer.writeByte((byte) 1); // bitsPerEntry - // Palette - writer.writeVarInt(1); + writer.writeByte((byte) 0); writer.writeVarInt(value); - // Data - final int length = maxSize() / 64; - writer.writeVarInt(length); - // TODO: may be possible to write everything in one call instead of a loop - for (int i = 0; i < length; i++) writer.writeLong(0); + writer.writeVarInt(0); } }