2015-05-25 12:37:24 +02:00
--- a/net/minecraft/server/BlockPressurePlateAbstract.java
+++ b/net/minecraft/server/BlockPressurePlateAbstract.java
2018-07-15 02:00:00 +02:00
@@ -2,6 +2,8 @@
2014-11-25 22:32:16 +01:00
import java.util.Random;
+import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit
+
public abstract class BlockPressurePlateAbstract extends Block {
2018-07-15 02:00:00 +02:00
protected static final VoxelShape a = Block.a(1.0D, 0.0D, 1.0D, 15.0D, 0.5D, 15.0D);
2019-12-10 23:00:00 +01:00
@@ -66,6 +68,19 @@
2014-11-25 22:32:16 +01:00
boolean flag = i > 0;
boolean flag1 = j > 0;
2015-02-26 23:41:06 +01:00
2014-11-25 22:32:16 +01:00
+ // CraftBukkit start - Interact Pressure Plate
+ org.bukkit.World bworld = world.getWorld();
+ org.bukkit.plugin.PluginManager manager = world.getServer().getPluginManager();
+
+ if (flag != flag1) {
+ BlockRedstoneEvent eventRedstone = new BlockRedstoneEvent(bworld.getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()), i, j);
+ manager.callEvent(eventRedstone);
+
+ flag1 = eventRedstone.getNewCurrent() > 0;
+ j = eventRedstone.getNewCurrent();
+ }
+ // CraftBukkit end
2015-02-26 23:41:06 +01:00
+
2014-11-25 22:32:16 +01:00
if (i != j) {
2019-07-20 01:00:00 +02:00
IBlockData iblockdata1 = this.a(iblockdata, j);