summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCeltic Minstrel <celtic.minstrel.ca@some.place>2012-02-25 12:49:46 -0500
committerEvilSeph <evilseph@gmail.com>2012-02-25 19:10:28 -0500
commiteb8632fca7bca1e36a4ed3cc2b2647b2dddbe925 (patch)
treec47b0d22455b6bd3b22687fece59785fd2605051
parent2ba3ab3fb820c07877f50eee967aed2cdeff51da (diff)
downloadbukkit-eb8632fca7bca1e36a4ed3cc2b2647b2dddbe925.tar
bukkit-eb8632fca7bca1e36a4ed3cc2b2647b2dddbe925.tar.gz
bukkit-eb8632fca7bca1e36a4ed3cc2b2647b2dddbe925.tar.lz
bukkit-eb8632fca7bca1e36a4ed3cc2b2647b2dddbe925.tar.xz
bukkit-eb8632fca7bca1e36a4ed3cc2b2647b2dddbe925.zip
[Bleeding] Add constructor to BlockFromToEvent for dragon egg teleportation. Addresses BUKKIT-828
-rw-r--r--src/main/java/org/bukkit/event/block/BlockFromToEvent.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/main/java/org/bukkit/event/block/BlockFromToEvent.java b/src/main/java/org/bukkit/event/block/BlockFromToEvent.java
index 97832353..70fd6724 100644
--- a/src/main/java/org/bukkit/event/block/BlockFromToEvent.java
+++ b/src/main/java/org/bukkit/event/block/BlockFromToEvent.java
@@ -6,7 +6,8 @@ import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
/**
- * Represents events with a source block and a destination block, currently only applies to liquid (lava and water).
+ * Represents events with a source block and a destination block, currently only applies to liquid (lava and water)
+ * and teleporting dragon eggs.
* <p />
* If a Block From To event is cancelled, the block will not move (the liquid will not flow).
*/
@@ -22,6 +23,13 @@ public class BlockFromToEvent extends BlockEvent implements Cancellable {
this.cancel = false;
}
+ public BlockFromToEvent(final Block block, final Block toBlock) {
+ super(block);
+ this.to = toBlock;
+ this.face = BlockFace.SELF;
+ this.cancel = false;
+ }
+
/**
* Gets the BlockFace that the block is moving to.
*
@@ -38,7 +46,7 @@ public class BlockFromToEvent extends BlockEvent implements Cancellable {
*/
public Block getToBlock() {
if (to == null) {
- to = block.getRelative(face.getModX(), face.getModY(), face.getModZ());
+ to = block.getRelative(face);
}
return to;
}