mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-24 18:07:39 +01:00
32 lines
1.6 KiB
Diff
32 lines
1.6 KiB
Diff
--- /home/matt/mc-dev-private//net/minecraft/server/BlockTrapdoor.java 2015-02-26 22:40:22.275608143 +0000
|
|
+++ src/main/java/net/minecraft/server/BlockTrapdoor.java 2015-02-26 22:40:22.275608143 +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) EnumDirection.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) {
|