3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-22 14:28:09 +01:00
Paper/nms-patches/BlockRedstoneWire.patch

28 Zeilen
983 B
Diff

2015-05-25 12:37:24 +02:00
--- a/net/minecraft/server/BlockRedstoneWire.java
+++ b/net/minecraft/server/BlockRedstoneWire.java
2018-07-15 02:00:00 +02:00
@@ -11,6 +11,8 @@
import java.util.Set;
2016-05-10 13:47:39 +02:00
import javax.annotation.Nullable;
+import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit
+
public class BlockRedstoneWire extends Block {
2019-04-23 04:00:00 +02:00
public static final BlockStateEnum<BlockPropertyRedstoneSide> NORTH = BlockProperties.R;
@@ -206,6 +208,15 @@
l = j;
}
2015-02-26 23:41:06 +01:00
+ // CraftBukkit start
2019-04-23 04:00:00 +02:00
+ if (i != l) {
+ BlockRedstoneEvent event = new BlockRedstoneEvent(world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()), i, l);
+ world.getServer().getPluginManager().callEvent(event);
+
2019-04-23 04:00:00 +02:00
+ l = event.getNewCurrent();
+ }
+ // CraftBukkit end
2015-02-26 23:41:06 +01:00
+
2019-04-23 04:00:00 +02:00
if (i != l) {
iblockdata = (IBlockData) iblockdata.set(BlockRedstoneWire.POWER, l);
2015-02-26 23:41:06 +01:00
if (world.getType(blockposition) == iblockdata1) {