summaryrefslogtreecommitdiffstats
path: root/nms-patches/BlockTrapdoor.patch
diff options
context:
space:
mode:
Diffstat (limited to 'nms-patches/BlockTrapdoor.patch')
-rw-r--r--nms-patches/BlockTrapdoor.patch39
1 files changed, 19 insertions, 20 deletions
diff --git a/nms-patches/BlockTrapdoor.patch b/nms-patches/BlockTrapdoor.patch
index 595644f3..90372d08 100644
--- a/nms-patches/BlockTrapdoor.patch
+++ b/nms-patches/BlockTrapdoor.patch
@@ -1,31 +1,30 @@
--- a/net/minecraft/server/BlockTrapdoor.java
+++ b/net/minecraft/server/BlockTrapdoor.java
-@@ -2,6 +2,8 @@
-
- import com.google.common.base.Predicate;
+@@ -1,5 +1,7 @@
+ package net.minecraft.server;
+import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit
+
public class BlockTrapdoor extends Block {
- public static final BlockStateDirection FACING = BlockStateDirection.of("facing", (Predicate) EnumDirection.EnumDirectionLimit.HORIZONTAL);
-@@ -101,6 +103,19 @@
- boolean flag = world.isBlockIndirectlyPowered(blockposition);
+ public static final BlockStateDirection FACING = BlockFacingHorizontal.FACING;
+@@ -92,6 +94,19 @@
+ boolean flag = world.isBlockIndirectlyPowered(blockposition);
- if (flag || block.isPowerSource()) {
-+ // CraftBukkit start
-+ org.bukkit.World bworld = world.getWorld();
-+ org.bukkit.block.Block bblock = bworld.getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ());
+ if (flag || block.getBlockData().m()) {
++ // CraftBukkit start
++ org.bukkit.World bworld = world.getWorld();
++ org.bukkit.block.Block bblock = bworld.getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ());
+
-+ int power = bblock.getBlockPower();
-+ int oldPower = (Boolean) iblockdata.get(OPEN) ? 15 : 0;
++ int power = bblock.getBlockPower();
++ int oldPower = (Boolean) iblockdata.get(OPEN) ? 15 : 0;
+
-+ if (oldPower == 0 ^ power == 0 || block.isPowerSource()) {
-+ BlockRedstoneEvent eventRedstone = new BlockRedstoneEvent(bblock, oldPower, power);
-+ world.getServer().getPluginManager().callEvent(eventRedstone);
-+ flag = eventRedstone.getNewCurrent() > 0;
-+ }
-+ // CraftBukkit end
- boolean flag1 = ((Boolean) iblockdata.get(BlockTrapdoor.OPEN)).booleanValue();
++ if (oldPower == 0 ^ power == 0 || block.getBlockData().n()) {
++ BlockRedstoneEvent eventRedstone = new BlockRedstoneEvent(bblock, oldPower, power);
++ world.getServer().getPluginManager().callEvent(eventRedstone);
++ flag = eventRedstone.getNewCurrent() > 0;
++ }
++ // CraftBukkit end
+ boolean flag1 = ((Boolean) iblockdata.get(BlockTrapdoor.OPEN)).booleanValue();
- if (flag1 != flag) {
+ if (flag1 != flag) {