mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-10 12:02:36 +01:00
9ee989ea81
By: md_5 <git@md-5.net>
27 lines
1.4 KiB
Diff
27 lines
1.4 KiB
Diff
--- a/net/minecraft/world/level/block/BlockCommand.java
|
|
+++ b/net/minecraft/world/level/block/BlockCommand.java
|
|
@@ -27,6 +27,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 {
|
|
|
|
private static final Logger LOGGER = LogUtils.getLogger();
|
|
@@ -57,6 +59,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) {
|