From 8aed471ba07b4022c3ab1d01aba50570e94f9d6b Mon Sep 17 00:00:00 2001 From: Konicai <71294714+Konicai@users.noreply.github.com> Date: Thu, 22 Jun 2023 18:05:07 -0400 Subject: [PATCH] Fix serverbound hanging sign updates (#3904) --- .../geyser/level/block/BlockStateValues.java | 18 ------------------ .../BedrockBlockEntityDataTranslator.java | 4 ++-- .../org/geysermc/geyser/util/SignUtils.java | 4 ++-- 3 files changed, 4 insertions(+), 22 deletions(-) diff --git a/core/src/main/java/org/geysermc/geyser/level/block/BlockStateValues.java b/core/src/main/java/org/geysermc/geyser/level/block/BlockStateValues.java index 1a4e96bca..6b09881bb 100644 --- a/core/src/main/java/org/geysermc/geyser/level/block/BlockStateValues.java +++ b/core/src/main/java/org/geysermc/geyser/level/block/BlockStateValues.java @@ -45,7 +45,6 @@ import java.util.Locale; */ public final class BlockStateValues { private static final IntSet ALL_CAULDRONS = new IntOpenHashSet(); - private static final IntSet HANGING_SIGNS = new IntOpenHashSet(); private static final Int2IntMap BANNER_COLORS = new FixedInt2IntMap(); private static final Int2ByteMap BED_COLORS = new FixedInt2ByteMap(); private static final Int2IntMap BRUSH_PROGRESS = new Int2IntOpenHashMap(); @@ -88,12 +87,6 @@ public final class BlockStateValues { * @param blockData JsonNode of info about the block from blocks.json */ public static void storeBlockStateValues(String javaId, int javaBlockState, JsonNode blockData) { - if (javaId.contains("_hanging_sign")) { - // covers hanging_sign and wall_hanging_sign - HANGING_SIGNS.add(javaBlockState); - return; - } - JsonNode bannerColor = blockData.get("banner_color"); if (bannerColor != null) { BANNER_COLORS.put(javaBlockState, (byte) bannerColor.intValue()); @@ -220,17 +213,6 @@ public final class BlockStateValues { } } - /** - * Hanging signs have a different maximum text width than "normal" signs. As a result, when the client - * updates the text of a sign without indication of the sign type, we must determine it. - * - * @param state BlockState of the block - * @return true if the sign is any hanging variant - */ - public static boolean isHangingSign(int state) { - return HANGING_SIGNS.contains(state); - } - /** * Banner colors are part of the namespaced ID in Java Edition, but part of the block entity tag in Bedrock. * This gives an integer color that Bedrock can use. diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockBlockEntityDataTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockBlockEntityDataTranslator.java index 7e972c3da..f280f144f 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockBlockEntityDataTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockBlockEntityDataTranslator.java @@ -43,9 +43,9 @@ public class BedrockBlockEntityDataTranslator extends PacketTranslator