summaryrefslogtreecommitdiffstats
path: root/src/main/java/org
diff options
context:
space:
mode:
authorTravis Watkins <amaranth@ubuntu.com>2012-11-17 10:03:16 -0600
committerTravis Watkins <amaranth@ubuntu.com>2012-11-17 15:00:14 -0600
commitdca54ff187fa10f37523ff744b765b66d177967e (patch)
tree4f4bbed6473be8963281698cf35694b811ad9f0e /src/main/java/org
parent0c78ce40e595243617e8093388ab5622bea3be32 (diff)
downloadcraftbukkit-dca54ff187fa10f37523ff744b765b66d177967e.tar
craftbukkit-dca54ff187fa10f37523ff744b765b66d177967e.tar.gz
craftbukkit-dca54ff187fa10f37523ff744b765b66d177967e.tar.lz
craftbukkit-dca54ff187fa10f37523ff744b765b66d177967e.tar.xz
craftbukkit-dca54ff187fa10f37523ff744b765b66d177967e.zip
Fire BlockSpreadEvent for vine growth. Fixes BUKKIT-1097
Diffstat (limited to 'src/main/java/org')
-rw-r--r--src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 370980ed..73945848 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -288,6 +288,19 @@ public class CraftEventFactory {
return event;
}
+ public static void handleBlockSpreadEvent(Block block, Block source, int type, int data) {
+ BlockState state = block.getState();
+ state.setTypeId(type);
+ state.setRawData((byte) data);
+
+ BlockSpreadEvent event = new BlockSpreadEvent(block, source, state);
+ Bukkit.getPluginManager().callEvent(event);
+
+ if (!event.isCancelled()) {
+ state.update(true);
+ }
+ }
+
public static EntityDeathEvent callEntityDeathEvent(EntityLiving victim) {
return callEntityDeathEvent(victim, new ArrayList<org.bukkit.inventory.ItemStack>(0));
}