Improve calling of ProjectileHitEvent. Fixes BUKKIT-3872

By: Andre LeBlanc <andre@norcode.com>
This commit is contained in:
CraftBukkit/Spigot 2013-03-23 12:16:00 -04:00
parent 10245ce119
commit 3c6a12547b

View File

@ -532,6 +532,12 @@ public class CraftEventFactory {
return event;
}
public static ProjectileHitEvent callProjectileHitEvent(Entity entity) {
ProjectileHitEvent event = new ProjectileHitEvent((Projectile) entity.getBukkitEntity());
entity.world.getServer().getPluginManager().callEvent(event);
return event;
}
public static ExpBottleEvent callExpBottleEvent(Entity entity, int exp) {
ThrownExpBottle bottle = (ThrownExpBottle) entity.getBukkitEntity();
ExpBottleEvent event = new ExpBottleEvent(bottle, exp);