2015-05-25 12:37:24 +02:00
|
|
|
--- a/net/minecraft/server/BlockTrapdoor.java
|
|
|
|
+++ b/net/minecraft/server/BlockTrapdoor.java
|
2016-05-10 13:47:39 +02:00
|
|
|
@@ -1,6 +1,7 @@
|
2016-02-29 22:32:46 +01:00
|
|
|
package net.minecraft.server;
|
2014-11-25 22:32:16 +01:00
|
|
|
|
2016-05-10 13:47:39 +02:00
|
|
|
import javax.annotation.Nullable;
|
2014-11-25 22:32:16 +01:00
|
|
|
+import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit
|
2016-05-10 13:47:39 +02:00
|
|
|
|
2014-11-25 22:32:16 +01:00
|
|
|
public class BlockTrapdoor extends Block {
|
|
|
|
|
2016-06-09 03:43:49 +02:00
|
|
|
@@ -91,6 +92,19 @@
|
2016-02-29 22:32:46 +01:00
|
|
|
boolean flag = world.isBlockIndirectlyPowered(blockposition);
|
2014-11-25 22:32:16 +01:00
|
|
|
|
2017-05-19 13:00:13 +02:00
|
|
|
if (flag || block.getBlockData().m()) {
|
2016-02-29 22:32:46 +01:00
|
|
|
+ // CraftBukkit start
|
|
|
|
+ org.bukkit.World bworld = world.getWorld();
|
|
|
|
+ org.bukkit.block.Block bblock = bworld.getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ());
|
2014-11-25 22:32:16 +01:00
|
|
|
+
|
2016-02-29 22:32:46 +01:00
|
|
|
+ int power = bblock.getBlockPower();
|
|
|
|
+ int oldPower = (Boolean) iblockdata.get(OPEN) ? 15 : 0;
|
2014-11-25 22:32:16 +01:00
|
|
|
+
|
2016-02-29 22:32:46 +01:00
|
|
|
+ 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();
|
2014-11-25 22:32:16 +01:00
|
|
|
|
2016-02-29 22:32:46 +01:00
|
|
|
if (flag1 != flag) {
|