Fire BlockSpreadEvent for vine growth. Fixes BUKKIT-1097

By: Travis Watkins <amaranth@ubuntu.com>
This commit is contained in:
CraftBukkit/Spigot
2012-11-17 10:03:16 -06:00
parent a152d0cdcb
commit 9f7e1a3759

View File

@@ -288,6 +288,19 @@ public class CraftEventFactory {
return event; 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) { public static EntityDeathEvent callEntityDeathEvent(EntityLiving victim) {
return callEntityDeathEvent(victim, new ArrayList<org.bukkit.inventory.ItemStack>(0)); return callEntityDeathEvent(victim, new ArrayList<org.bukkit.inventory.ItemStack>(0));
} }