From 8854d8afc30f9ca92f4aef5cdd2c980253836c89 Mon Sep 17 00:00:00 2001 From: jhqwqmc <2110242767@qq.com> Date: Sun, 13 Jul 2025 15:19:27 +0800 Subject: [PATCH] =?UTF-8?q?fix(block):=20=E5=8E=8B=E5=8A=9B=E6=9D=BF?= =?UTF-8?q?=E7=A7=BB=E9=99=A4=E6=97=B6=E6=AD=A3=E7=A1=AE=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E7=BA=A2=E7=9F=B3=E4=BF=A1=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../behavior/PressurePlateBlockBehavior.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/bukkit/src/main/java/net/momirealms/craftengine/bukkit/block/behavior/PressurePlateBlockBehavior.java b/bukkit/src/main/java/net/momirealms/craftengine/bukkit/block/behavior/PressurePlateBlockBehavior.java index 51ad4edb3..999fe0da3 100644 --- a/bukkit/src/main/java/net/momirealms/craftengine/bukkit/block/behavior/PressurePlateBlockBehavior.java +++ b/bukkit/src/main/java/net/momirealms/craftengine/bukkit/block/behavior/PressurePlateBlockBehavior.java @@ -182,6 +182,21 @@ public class PressurePlateBlockBehavior extends BukkitBlockBehavior { } } + @Override + public void onRemove(Object thisBlock, Object[] args, Callable superMethod) throws Exception { + Object state = args[0]; + Object level = args[1]; + Object pos = args[2]; + Object newState = args[3]; + boolean movedByPiston = (boolean) args[4]; + if (!movedByPiston && !FastNMS.INSTANCE.method$BlockStateBase$is(state, FastNMS.INSTANCE.method$BlockState$getBlock(newState))) { + if (this.getSignalForState(state) > 0) { + this.updateNeighbours(level, pos, thisBlock); + } + superMethod.call(); + } + } + private void updateNeighbours(Object level, Object pos, Object thisBlock) { FastNMS.INSTANCE.method$Level$updateNeighborsAt(level, pos, thisBlock); FastNMS.INSTANCE.method$Level$updateNeighborsAt(level, LocationUtils.below(pos), thisBlock);