2021-03-15 23:00:00 +01:00
|
|
|
--- a/net/minecraft/world/level/block/BlockCommand.java
|
|
|
|
+++ b/net/minecraft/world/level/block/BlockCommand.java
|
2024-04-23 17:15:00 +02:00
|
|
|
@@ -29,6 +29,8 @@
|
2022-02-28 16:00:00 +01:00
|
|
|
import net.minecraft.world.phys.MovingObjectPositionBlock;
|
|
|
|
import org.slf4j.Logger;
|
2014-11-25 22:32:16 +01:00
|
|
|
|
|
|
|
+import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit
|
|
|
|
+
|
2021-06-11 07:00:00 +02:00
|
|
|
public class BlockCommand extends BlockTileEntity implements GameMasterBlock {
|
2014-11-25 22:32:16 +01:00
|
|
|
|
2023-12-05 17:40:00 +01:00
|
|
|
public static final MapCodec<BlockCommand> CODEC = RecordCodecBuilder.mapCodec((instance) -> {
|
2024-04-23 17:15:00 +02:00
|
|
|
@@ -69,6 +71,15 @@
|
2017-05-14 04:00:00 +02:00
|
|
|
TileEntityCommand tileentitycommand = (TileEntityCommand) tileentity;
|
2021-11-21 23:00:00 +01:00
|
|
|
boolean flag1 = world.hasNeighborSignal(blockposition);
|
|
|
|
boolean flag2 = tileentitycommand.isPowered();
|
2017-05-14 04:00:00 +02:00
|
|
|
+ // CraftBukkit start
|
|
|
|
+ org.bukkit.block.Block bukkitBlock = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ());
|
2019-04-23 04:00:00 +02:00
|
|
|
+ int old = flag2 ? 15 : 0;
|
|
|
|
+ int current = flag1 ? 15 : 0;
|
2015-02-26 23:41:06 +01:00
|
|
|
+
|
2017-05-14 04:00:00 +02:00
|
|
|
+ BlockRedstoneEvent eventRedstone = new BlockRedstoneEvent(bukkitBlock, old, current);
|
2021-06-11 13:33:49 +02:00
|
|
|
+ world.getCraftServer().getPluginManager().callEvent(eventRedstone);
|
2019-04-23 04:00:00 +02:00
|
|
|
+ flag1 = eventRedstone.getNewCurrent() > 0;
|
2017-05-14 04:00:00 +02:00
|
|
|
+ // CraftBukkit end
|
2016-02-29 22:32:46 +01:00
|
|
|
|
2021-11-21 23:00:00 +01:00
|
|
|
tileentitycommand.setPowered(flag1);
|
|
|
|
if (!flag2 && !tileentitycommand.isAutomatic() && tileentitycommand.getMode() != TileEntityCommand.Type.SEQUENCE) {
|