@@ -6,12 +6,12 @@
|
||||
import javax.annotation.Nullable;
|
||||
+import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit
|
||||
|
||||
public class BlockTrapdoor extends BlockFacingHorizontal implements IFluidSource, IFluidContainer {
|
||||
public class BlockTrapdoor extends BlockFacingHorizontal implements IBlockWaterlogged {
|
||||
|
||||
@@ -88,6 +89,19 @@
|
||||
boolean flag = world.isBlockIndirectlyPowered(blockposition);
|
||||
boolean flag1 = world.isBlockIndirectlyPowered(blockposition);
|
||||
|
||||
if (flag != (Boolean) iblockdata.get(BlockTrapdoor.c)) {
|
||||
if (flag1 != (Boolean) iblockdata.get(BlockTrapdoor.c)) {
|
||||
+ // CraftBukkit start
|
||||
+ org.bukkit.World bworld = world.getWorld();
|
||||
+ org.bukkit.block.Block bblock = bworld.getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ());
|
||||
@@ -22,9 +22,9 @@
|
||||
+ if (oldPower == 0 ^ power == 0 || block.getBlockData().isPowerSource()) {
|
||||
+ BlockRedstoneEvent eventRedstone = new BlockRedstoneEvent(bblock, oldPower, power);
|
||||
+ world.getServer().getPluginManager().callEvent(eventRedstone);
|
||||
+ flag = eventRedstone.getNewCurrent() > 0;
|
||||
+ flag1 = eventRedstone.getNewCurrent() > 0;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
if ((Boolean) iblockdata.get(BlockTrapdoor.OPEN) != flag) {
|
||||
iblockdata = (IBlockData) iblockdata.set(BlockTrapdoor.OPEN, flag);
|
||||
this.a((EntityHuman) null, world, blockposition, flag);
|
||||
if ((Boolean) iblockdata.get(BlockTrapdoor.OPEN) != flag1) {
|
||||
iblockdata = (IBlockData) iblockdata.set(BlockTrapdoor.OPEN, flag1);
|
||||
this.a((EntityHuman) null, world, blockposition, flag1);
|
||||
|
||||
Reference in New Issue
Block a user