diff options
Diffstat (limited to 'patch-remap/og/net/minecraft/world/level/block/BlockCommand.patch')
-rw-r--r-- | patch-remap/og/net/minecraft/world/level/block/BlockCommand.patch | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/patch-remap/og/net/minecraft/world/level/block/BlockCommand.patch b/patch-remap/og/net/minecraft/world/level/block/BlockCommand.patch new file mode 100644 index 0000000000..49d5b66ba7 --- /dev/null +++ b/patch-remap/og/net/minecraft/world/level/block/BlockCommand.patch @@ -0,0 +1,27 @@ +--- a/net/minecraft/world/level/block/BlockCommand.java ++++ b/net/minecraft/world/level/block/BlockCommand.java +@@ -30,6 +30,8 @@ + import net.minecraft.world.phys.MovingObjectPositionBlock; + import org.slf4j.Logger; + ++import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit ++ + public class BlockCommand extends BlockTileEntity implements GameMasterBlock { + + public static final MapCodec<BlockCommand> CODEC = RecordCodecBuilder.mapCodec((instance) -> { +@@ -70,6 +72,15 @@ + TileEntityCommand tileentitycommand = (TileEntityCommand) tileentity; + boolean flag1 = world.hasNeighborSignal(blockposition); + boolean flag2 = tileentitycommand.isPowered(); ++ // CraftBukkit start ++ org.bukkit.block.Block bukkitBlock = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()); ++ int old = flag2 ? 15 : 0; ++ int current = flag1 ? 15 : 0; ++ ++ BlockRedstoneEvent eventRedstone = new BlockRedstoneEvent(bukkitBlock, old, current); ++ world.getCraftServer().getPluginManager().callEvent(eventRedstone); ++ flag1 = eventRedstone.getNewCurrent() > 0; ++ // CraftBukkit end + + tileentitycommand.setPowered(flag1); + if (!flag2 && !tileentitycommand.isAutomatic() && tileentitycommand.getMode() != TileEntityCommand.Type.SEQUENCE) { |