From b73f23de0f190ae2b6942af083b9767059dc78dd Mon Sep 17 00:00:00 2001 From: onebeastchris Date: Sun, 21 Apr 2024 22:54:54 +0200 Subject: [PATCH] remove global palette bits, fix nullable block entity tags --- .../java/org/geysermc/geyser/session/GeyserSession.java | 5 ----- .../geysermc/geyser/translator/level/BiomeTranslator.java | 4 ---- .../java/level/JavaLevelChunkWithLightTranslator.java | 8 ++++---- .../src/main/java/org/geysermc/geyser/util/MathUtils.java | 7 ------- 4 files changed, 4 insertions(+), 20 deletions(-) diff --git a/core/src/main/java/org/geysermc/geyser/session/GeyserSession.java b/core/src/main/java/org/geysermc/geyser/session/GeyserSession.java index 8e1ed2e51..994879f82 100644 --- a/core/src/main/java/org/geysermc/geyser/session/GeyserSession.java +++ b/core/src/main/java/org/geysermc/geyser/session/GeyserSession.java @@ -263,11 +263,6 @@ public class GeyserSession implements GeyserConnection, GeyserCommandSource { @Setter private ItemMappings itemMappings; - /** - * Required to decode biomes correctly. - */ - @Setter - private int biomeGlobalPalette; /** * Stores the map between Java and Bedrock biome network IDs. */ diff --git a/core/src/main/java/org/geysermc/geyser/translator/level/BiomeTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/level/BiomeTranslator.java index d4288c5a7..f05ed5ed1 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/level/BiomeTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/level/BiomeTranslator.java @@ -31,7 +31,6 @@ import com.github.steveice10.mc.protocol.data.game.chunk.DataPalette; import com.github.steveice10.mc.protocol.data.game.chunk.palette.GlobalPalette; import com.github.steveice10.mc.protocol.data.game.chunk.palette.Palette; import com.github.steveice10.mc.protocol.data.game.chunk.palette.SingletonPalette; -import com.github.steveice10.opennbt.tag.builtin.CompoundTag; import it.unimi.dsi.fastutil.ints.*; import org.geysermc.geyser.level.chunk.BlockStorage; import org.geysermc.geyser.level.chunk.bitarray.BitArray; @@ -39,7 +38,6 @@ import org.geysermc.geyser.level.chunk.bitarray.BitArrayVersion; import org.geysermc.geyser.level.chunk.bitarray.SingletonBitArray; import org.geysermc.geyser.registry.Registries; import org.geysermc.geyser.session.GeyserSession; -import org.geysermc.geyser.util.MathUtils; import java.util.List; @@ -49,8 +47,6 @@ public class BiomeTranslator { public static void loadServerBiomes(GeyserSession session, List entries) { Int2IntMap biomeTranslations = new Int2IntOpenHashMap(); - session.setBiomeGlobalPalette(MathUtils.getGlobalPaletteForSize(entries.size())); - int greatestBiomeId = 0; for (int i = 0; i < entries.size(); i++) { RegistryEntry entry = entries.get(i); diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaLevelChunkWithLightTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaLevelChunkWithLightTranslator.java index a98ead719..e34c0d96d 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaLevelChunkWithLightTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaLevelChunkWithLightTranslator.java @@ -98,7 +98,6 @@ public class JavaLevelChunkWithLightTranslator extends PacketTranslator