Fire BlockSpreadEvent for vine growth. Fixes BUKKIT-1097

This commit is contained in:
Travis Watkins
2012-11-17 10:03:16 -06:00
parent 0c78ce40e5
commit dca54ff187
2 changed files with 36 additions and 7 deletions

View File

@@ -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));
}