Trigger EntityBlockChangeEvent for Silverfish. Adds BUKKIT-1560 and BUKKIT-1593

By: feildmaster <admin@feildmaster.com>
This commit is contained in:
CraftBukkit/Spigot 2012-04-28 12:26:07 -05:00
parent b91f0fe488
commit acc10eabc8

View File

@ -441,6 +441,13 @@ public class CraftEventFactory {
return event; return event;
} }
public static EntityChangeBlockEvent callEntityChangeBlockEvent(Entity entity, int x, int y, int z, int type) {
Block block = entity.world.getWorld().getBlockAt(x, y, z);
Material material = Material.getMaterial(type);
return callEntityChangeBlockEvent(entity, block, material);
}
public static CreeperPowerEvent callCreeperPowerEvent(Entity creeper, Entity lightning, CreeperPowerEvent.PowerCause cause) { public static CreeperPowerEvent callCreeperPowerEvent(Entity creeper, Entity lightning, CreeperPowerEvent.PowerCause cause) {
CreeperPowerEvent event = new CreeperPowerEvent((Creeper) creeper.getBukkitEntity(), (LightningStrike) lightning.getBukkitEntity(), cause); CreeperPowerEvent event = new CreeperPowerEvent((Creeper) creeper.getBukkitEntity(), (LightningStrike) lightning.getBukkitEntity(), cause);
creeper.getBukkitEntity().getServer().getPluginManager().callEvent(event); creeper.getBukkitEntity().getServer().getPluginManager().callEvent(event);