From d4e1b8a99d37897456a0cc536658b5077e7ff2a5 Mon Sep 17 00:00:00 2001 From: jhqwqmc <2110242767@qq.com> Date: Sun, 22 Jun 2025 04:43:08 +0800 Subject: [PATCH] =?UTF-8?q?fix(block):=20=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bukkit/block/behavior/PressurePlateBlockBehavior.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 526e2ac03..fa31ce97a 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 @@ -114,6 +114,8 @@ public class PressurePlateBlockBehavior extends BukkitBlockBehavior { int signalForState = this.getSignalForState(state); if (signalForState == 0) { this.checkPressed(args[3], args[1], args[2], state, signalForState, thisBlock); + } else { + FastNMS.INSTANCE.method$LevelAccessor$scheduleBlockTick(args[1], args[2], thisBlock, 20); } } @@ -165,7 +167,7 @@ public class PressurePlateBlockBehavior extends BukkitBlockBehavior { World world = BukkitWorldManager.instance().getWorld(craftWorld).world(); world.playBlockSound(LocationUtils.toVec3d(LocationUtils.fromBlockPos(pos)), this.offSound); craftWorld.sendGameEvent( - FastNMS.INSTANCE.method$Entity$getBukkitEntity(entity), + entity != null ? FastNMS.INSTANCE.method$Entity$getBukkitEntity(entity) : null, GameEvent.BLOCK_DEACTIVATE, positionVector ); @@ -175,7 +177,7 @@ public class PressurePlateBlockBehavior extends BukkitBlockBehavior { World world = BukkitWorldManager.instance().getWorld(craftWorld).world(); world.playBlockSound(LocationUtils.toVec3d(LocationUtils.fromBlockPos(pos)), this.onSound); craftWorld.sendGameEvent( - FastNMS.INSTANCE.method$Entity$getBukkitEntity(entity), + entity != null ? FastNMS.INSTANCE.method$Entity$getBukkitEntity(entity) : null, GameEvent.BLOCK_ACTIVATE, positionVector );