mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-12 18:01:07 +01:00
SPIGOT-4735: ProjectileHitEvent Fires Immediately
This commit is contained in:
parent
14df075f80
commit
de6cdd0364
1 changed files with 5 additions and 2 deletions
|
@ -1052,7 +1052,11 @@ public class CraftEventFactory {
|
||||||
return event;
|
return event;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ProjectileHitEvent callProjectileHitEvent(Entity entity, MovingObjectPosition position) {
|
public static void callProjectileHitEvent(Entity entity, MovingObjectPosition position) {
|
||||||
|
if (position.getType() == MovingObjectPosition.EnumMovingObjectType.MISS) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Block hitBlock = null;
|
Block hitBlock = null;
|
||||||
BlockFace hitFace = null;
|
BlockFace hitFace = null;
|
||||||
if (position.getType() == MovingObjectPosition.EnumMovingObjectType.BLOCK) {
|
if (position.getType() == MovingObjectPosition.EnumMovingObjectType.BLOCK) {
|
||||||
|
@ -1068,7 +1072,6 @@ public class CraftEventFactory {
|
||||||
|
|
||||||
ProjectileHitEvent event = new ProjectileHitEvent((Projectile) entity.getBukkitEntity(), hitEntity, hitBlock, hitFace);
|
ProjectileHitEvent event = new ProjectileHitEvent((Projectile) entity.getBukkitEntity(), hitEntity, hitBlock, hitFace);
|
||||||
entity.world.getServer().getPluginManager().callEvent(event);
|
entity.world.getServer().getPluginManager().callEvent(event);
|
||||||
return event;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ExpBottleEvent callExpBottleEvent(Entity entity, int exp) {
|
public static ExpBottleEvent callExpBottleEvent(Entity entity, int exp) {
|
||||||
|
|
Loading…
Reference in a new issue