#776: Add ability to cancel ProjectileHitEvent
By: Martoph <sager1018@gmail.com>
This commit is contained in:
@@ -1167,9 +1167,9 @@ public class CraftEventFactory {
|
||||
return event;
|
||||
}
|
||||
|
||||
public static void callProjectileHitEvent(Entity entity, MovingObjectPosition position) {
|
||||
public static ProjectileHitEvent callProjectileHitEvent(Entity entity, MovingObjectPosition position) {
|
||||
if (position.getType() == MovingObjectPosition.EnumMovingObjectType.MISS) {
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
|
||||
Block hitBlock = null;
|
||||
@@ -1187,6 +1187,7 @@ public class CraftEventFactory {
|
||||
|
||||
ProjectileHitEvent event = new ProjectileHitEvent((Projectile) entity.getBukkitEntity(), hitEntity, hitBlock, hitFace);
|
||||
entity.world.getServer().getPluginManager().callEvent(event);
|
||||
return event;
|
||||
}
|
||||
|
||||
public static ExpBottleEvent callExpBottleEvent(Entity entity, int exp) {
|
||||
|
||||
Reference in New Issue
Block a user