From b664395684aee02733fb069584a2bd0a432fc0fe Mon Sep 17 00:00:00 2001 From: chris Date: Tue, 23 Jul 2024 23:12:05 +0200 Subject: [PATCH] Fix: Sticky pistons not retracting on Geyser-Spigot/turning visually into normal pistons on all other platforms (#4891) --- .../java/level/JavaBlockEventTranslator.java | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaBlockEventTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaBlockEventTranslator.java index f56750d12..ff861530a 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaBlockEventTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaBlockEventTranslator.java @@ -43,7 +43,15 @@ import org.geysermc.geyser.translator.level.block.entity.BlockEntityTranslator; import org.geysermc.geyser.translator.level.block.entity.PistonBlockEntity; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; -import org.geysermc.mcprotocollib.protocol.data.game.level.block.value.*; +import org.geysermc.mcprotocollib.protocol.data.game.level.block.value.BellValue; +import org.geysermc.mcprotocollib.protocol.data.game.level.block.value.BlockValue; +import org.geysermc.mcprotocollib.protocol.data.game.level.block.value.ChestValue; +import org.geysermc.mcprotocollib.protocol.data.game.level.block.value.DecoratedPotValue; +import org.geysermc.mcprotocollib.protocol.data.game.level.block.value.EndGatewayValue; +import org.geysermc.mcprotocollib.protocol.data.game.level.block.value.MobSpawnerValue; +import org.geysermc.mcprotocollib.protocol.data.game.level.block.value.NoteBlockValue; +import org.geysermc.mcprotocollib.protocol.data.game.level.block.value.PistonValue; +import org.geysermc.mcprotocollib.protocol.data.game.level.block.value.PistonValueType; import org.geysermc.mcprotocollib.protocol.packet.ingame.clientbound.level.ClientboundBlockEventPacket; @Translator(packet = ClientboundBlockEventPacket.class) @@ -80,7 +88,7 @@ public class JavaBlockEventTranslator extends PacketTranslator { BlockState state = session.getGeyser().getWorldManager().blockAt(session, position); - boolean sticky = state.is(Blocks.STICKY_PISTON); + boolean sticky = isSticky(state); boolean extended = action != PistonValueType.PUSHING; return new PistonBlockEntity(session, pos, direction, sticky, extended); }); @@ -149,4 +157,8 @@ public class JavaBlockEventTranslator extends PacketTranslator