From 3685d6b5803d09bad27bc4a77f7399dff10139b3 Mon Sep 17 00:00:00 2001 From: DaPorkchop_ Date: Sat, 17 Oct 2020 17:38:14 +0200 Subject: [PATCH] palette does not always start with zero... --- .../mc/protocol/data/game/chunk/palette/ListPalette.java | 2 +- .../mc/protocol/data/game/chunk/palette/MapPalette.java | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/github/steveice10/mc/protocol/data/game/chunk/palette/ListPalette.java b/src/main/java/com/github/steveice10/mc/protocol/data/game/chunk/palette/ListPalette.java index e00a0e47..e82b33ec 100644 --- a/src/main/java/com/github/steveice10/mc/protocol/data/game/chunk/palette/ListPalette.java +++ b/src/main/java/com/github/steveice10/mc/protocol/data/game/chunk/palette/ListPalette.java @@ -10,7 +10,7 @@ public class ListPalette implements Palette { private final int maxId; private final int[] data; - private int nextId = 1; + private int nextId = 0; public ListPalette(int bitsPerEntry) { this.maxId = (1 << bitsPerEntry) - 1; diff --git a/src/main/java/com/github/steveice10/mc/protocol/data/game/chunk/palette/MapPalette.java b/src/main/java/com/github/steveice10/mc/protocol/data/game/chunk/palette/MapPalette.java index b98283bf..92a43bdc 100644 --- a/src/main/java/com/github/steveice10/mc/protocol/data/game/chunk/palette/MapPalette.java +++ b/src/main/java/com/github/steveice10/mc/protocol/data/game/chunk/palette/MapPalette.java @@ -13,13 +13,12 @@ public class MapPalette implements Palette { private final int[] idToState; private final IntObjectMap stateToId = new IntObjectHashMap<>(); - private int nextId = 1; + private int nextId = 0; public MapPalette(int bitsPerEntry) { this.maxId = (1 << bitsPerEntry) - 1; this.idToState = new int[this.maxId + 1]; - this.stateToId.put(0, (Integer) 0); } @Override