@@ -6,12 +6,12 @@
|
||||
import javax.annotation.Nullable;
|
||||
+import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit
|
||||
|
||||
public class BlockTrapdoor extends Block {
|
||||
public class BlockTrapdoor extends BlockFacingHorizontal implements IFluidSource, IFluidContainer {
|
||||
|
||||
@@ -91,6 +92,19 @@
|
||||
@@ -94,6 +95,19 @@
|
||||
boolean flag = world.isBlockIndirectlyPowered(blockposition);
|
||||
|
||||
if (flag || block.getBlockData().m()) {
|
||||
if (flag != ((Boolean) iblockdata.get(BlockTrapdoor.c)).booleanValue()) {
|
||||
+ // CraftBukkit start
|
||||
+ org.bukkit.World bworld = world.getWorld();
|
||||
+ org.bukkit.block.Block bblock = bworld.getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ());
|
||||
@@ -19,12 +19,12 @@
|
||||
+ int power = bblock.getBlockPower();
|
||||
+ int oldPower = (Boolean) iblockdata.get(OPEN) ? 15 : 0;
|
||||
+
|
||||
+ if (oldPower == 0 ^ power == 0 || block.getBlockData().n()) {
|
||||
+ if (oldPower == 0 ^ power == 0 || block.getBlockData().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) {
|
||||
if (((Boolean) iblockdata.get(BlockTrapdoor.OPEN)).booleanValue() != flag) {
|
||||
iblockdata = (IBlockData) iblockdata.set(BlockTrapdoor.OPEN, Boolean.valueOf(flag));
|
||||
this.a((EntityHuman) null, world, blockposition, flag);
|
||||
|
||||
Reference in New Issue
Block a user