From c54624fb2632dd5dc60626eb55ea830b3818836c Mon Sep 17 00:00:00 2001 From: Camotoy <20743703+Camotoy@users.noreply.github.com> Date: Tue, 23 Apr 2024 16:14:18 -0400 Subject: [PATCH] Fix some cases of empty tags being needed --- .../level/block/entity/BlockEntityTranslator.java | 8 ++++++-- .../level/JavaLevelChunkWithLightTranslator.java | 12 ++++++++---- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/BlockEntityTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/BlockEntityTranslator.java index 7566e0d90..053e2c8f3 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/BlockEntityTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/BlockEntityTranslator.java @@ -43,12 +43,16 @@ public abstract class BlockEntityTranslator { public abstract void translateTag(NbtMapBuilder builder, CompoundTag tag, int blockState); public NbtMap getBlockEntityTag(GeyserSession session, BlockEntityType type, int x, int y, int z, CompoundTag tag, int blockState) { - NbtMapBuilder tagBuilder = getConstantBedrockTag(BlockEntityUtils.getBedrockBlockEntityId(type), x, y, z); + NbtMapBuilder tagBuilder = getConstantBedrockTag(type, x, y, z); translateTag(tagBuilder, tag, blockState); return tagBuilder.build(); } - protected NbtMapBuilder getConstantBedrockTag(String bedrockId, int x, int y, int z) { + public static NbtMapBuilder getConstantBedrockTag(BlockEntityType type, int x, int y, int z) { + return getConstantBedrockTag(BlockEntityUtils.getBedrockBlockEntityId(type), x, y, z); + } + + public static NbtMapBuilder getConstantBedrockTag(String bedrockId, int x, int y, int z) { return NbtMap.builder() .putInt("x", x) .putInt("y", y) 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 fc1d0316c..1e6534130 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 @@ -393,10 +393,9 @@ public class JavaLevelChunkWithLightTranslator extends PacketTranslator