blob: 4bd9f0fe5bfe4531b371cca35d5c81b397dabf25 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
--- ../work/decompile-8eb82bde//net/minecraft/server/BlockTrapdoor.java 2014-11-28 17:43:42.969707438 +0000
+++ src/main/java/net/minecraft/server/BlockTrapdoor.java 2014-11-28 17:38:22.000000000 +0000
@@ -2,6 +2,8 @@
import com.google.common.base.Predicate;
+import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit
+
public class BlockTrapdoor extends Block {
public static final BlockStateDirection FACING = BlockStateDirection.of("facing", (Predicate) EnumDirectionLimit.HORIZONTAL);
@@ -101,6 +103,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());
+
+ 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 (flag1 != flag) {
|