aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/og/net/minecraft/world/level/block/BlockPressurePlateAbstract.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/og/net/minecraft/world/level/block/BlockPressurePlateAbstract.patch')
-rw-r--r--patch-remap/og/net/minecraft/world/level/block/BlockPressurePlateAbstract.patch48
1 files changed, 48 insertions, 0 deletions
diff --git a/patch-remap/og/net/minecraft/world/level/block/BlockPressurePlateAbstract.patch b/patch-remap/og/net/minecraft/world/level/block/BlockPressurePlateAbstract.patch
new file mode 100644
index 0000000000..d985b2e505
--- /dev/null
+++ b/patch-remap/og/net/minecraft/world/level/block/BlockPressurePlateAbstract.patch
@@ -0,0 +1,48 @@
+--- a/net/minecraft/world/level/block/BlockPressurePlateAbstract.java
++++ b/net/minecraft/world/level/block/BlockPressurePlateAbstract.java
+@@ -22,6 +22,8 @@
+ import net.minecraft.world.phys.shapes.VoxelShape;
+ import net.minecraft.world.phys.shapes.VoxelShapeCollision;
+
++import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit
++
+ public abstract class BlockPressurePlateAbstract extends Block {
+
+ protected static final VoxelShape PRESSED_AABB = Block.box(1.0D, 0.0D, 1.0D, 15.0D, 0.5D, 15.0D);
+@@ -90,6 +92,19 @@
+ boolean flag = i > 0;
+ boolean flag1 = j > 0;
+
++ // CraftBukkit start - Interact Pressure Plate
++ org.bukkit.World bworld = world.getWorld();
++ org.bukkit.plugin.PluginManager manager = world.getCraftServer().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
++
+ if (i != j) {
+ IBlockData iblockdata1 = this.setSignalForState(iblockdata, j);
+
+@@ -144,9 +159,15 @@
+ }
+
+ protected static int getEntityCount(World world, AxisAlignedBB axisalignedbb, Class<? extends Entity> oclass) {
++ // CraftBukkit start
++ return getEntities(world, axisalignedbb, oclass).size();
++ }
++
++ protected static <T extends Entity> java.util.List<T> getEntities(World world, AxisAlignedBB axisalignedbb, Class<T> oclass) {
++ // CraftBukkit end
+ return world.getEntitiesOfClass(oclass, axisalignedbb, IEntitySelector.NO_SPECTATORS.and((entity) -> {
+ return !entity.isIgnoringBlockTriggers();
+- })).size();
++ })); // CraftBukkit
+ }
+
+ protected abstract int getSignalStrength(World world, BlockPosition blockposition);