9
0
mirror of https://github.com/Xiao-MoMi/craft-engine.git synced 2025-12-19 15:09:15 +00:00

Merge pull request #502 from MelodyYuuka/patch-1

修复按钮行为按下后不能更新隔壁方块
This commit is contained in:
XiaoMoMi
2025-12-11 17:46:18 +08:00
committed by GitHub

View File

@@ -190,6 +190,7 @@ public class ButtonBlockBehavior extends BukkitBlockBehavior {
private void press(Object thisBlock, ImmutableBlockState state, Object level, Object pos, @Nullable Object player) {
FastNMS.INSTANCE.method$LevelWriter$setBlock(level, pos, state.with(this.poweredProperty, true).customBlockState().literalObject(), UpdateOption.UPDATE_ALL.flags());
this.updateNeighbours(thisBlock, state, level, pos);
FastNMS.INSTANCE.method$ScheduledTickAccess$scheduleBlockTick(level, pos, thisBlock, this.ticksToStayPressed);
playSound(level, pos, true);
Object gameEvent = VersionHelper.isOrAbove1_20_5() ? FastNMS.INSTANCE.method$Holder$direct(MGameEvents.BLOCK_ACTIVATE) : MGameEvents.BLOCK_ACTIVATE;