diff options
author | Tahg <tahgtahv@gmail.com> | 2011-09-30 03:27:36 -0400 |
---|---|---|
committer | Tahg <tahgtahv@gmail.com> | 2011-10-05 10:59:41 -0400 |
commit | 963622f8cff9952d01b94b6b4e5a0faa553c3d1c (patch) | |
tree | e50c47adb8555a6d6c31f9038c61cad41629f8a4 /src/main/java/org | |
parent | 2276eb899e5308373f5eccf2a27a65cba294361d (diff) | |
download | bukkit-963622f8cff9952d01b94b6b4e5a0faa553c3d1c.tar bukkit-963622f8cff9952d01b94b6b4e5a0faa553c3d1c.tar.gz bukkit-963622f8cff9952d01b94b6b4e5a0faa553c3d1c.tar.lz bukkit-963622f8cff9952d01b94b6b4e5a0faa553c3d1c.tar.xz bukkit-963622f8cff9952d01b94b6b4e5a0faa553c3d1c.zip |
hopeful fix for blocks not being pistons when they should be
Diffstat (limited to 'src/main/java/org')
3 files changed, 12 insertions, 7 deletions
diff --git a/src/main/java/org/bukkit/event/block/BlockPistonEvent.java b/src/main/java/org/bukkit/event/block/BlockPistonEvent.java index 3ffaea7e..4c2560aa 100644 --- a/src/main/java/org/bukkit/event/block/BlockPistonEvent.java +++ b/src/main/java/org/bukkit/event/block/BlockPistonEvent.java @@ -8,9 +8,11 @@ import org.bukkit.material.PistonBaseMaterial; public abstract class BlockPistonEvent extends BlockEvent implements Cancellable { private boolean cancelled; + private BlockFace direction; - public BlockPistonEvent(Type type, Block block) { + public BlockPistonEvent(Type type, Block block, BlockFace direction) { super(type, block); + this.direction = direction; } public boolean isCancelled() { @@ -37,7 +39,8 @@ public abstract class BlockPistonEvent extends BlockEvent implements Cancellable */ public BlockFace getDirection() { // Both are meh! - // return ((PistonBaseMaterial) block.getType().getNewData(block.getData ())).getFacing(); - return ((PistonBaseMaterial) block.getState().getData()).getFacing(); + // return ((PistonBaseMaterial) block.getType().getNewData(block.getData())).getFacing(); + // return ((PistonBaseMaterial) block.getState().getData()).getFacing(); + return direction; } } diff --git a/src/main/java/org/bukkit/event/block/BlockPistonExtendEvent.java b/src/main/java/org/bukkit/event/block/BlockPistonExtendEvent.java index 1643120d..dff70f0b 100644 --- a/src/main/java/org/bukkit/event/block/BlockPistonExtendEvent.java +++ b/src/main/java/org/bukkit/event/block/BlockPistonExtendEvent.java @@ -5,13 +5,14 @@ import java.util.Collections; import java.util.List; import org.bukkit.block.Block; +import org.bukkit.block.BlockFace; public class BlockPistonExtendEvent extends BlockPistonEvent { private int length; private List<Block> blocks; - public BlockPistonExtendEvent(Block block, int length) { - super(Type.BLOCK_PISTON_EXTEND, block); + public BlockPistonExtendEvent(Block block, int length, BlockFace direction) { + super(Type.BLOCK_PISTON_EXTEND, block, direction); this.length = length; } diff --git a/src/main/java/org/bukkit/event/block/BlockPistonRetractEvent.java b/src/main/java/org/bukkit/event/block/BlockPistonRetractEvent.java index d57fc6b7..7534cbe0 100644 --- a/src/main/java/org/bukkit/event/block/BlockPistonRetractEvent.java +++ b/src/main/java/org/bukkit/event/block/BlockPistonRetractEvent.java @@ -2,10 +2,11 @@ package org.bukkit.event.block; import org.bukkit.Location; import org.bukkit.block.Block; +import org.bukkit.block.BlockFace; public class BlockPistonRetractEvent extends BlockPistonEvent { - public BlockPistonRetractEvent(Block block) { - super(Type.BLOCK_PISTON_RETRACT, block); + public BlockPistonRetractEvent(Block block, BlockFace direction) { + super(Type.BLOCK_PISTON_RETRACT, block, direction); } /** |