mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-24 19:46:21 +01:00
Made ProjectileHitEvent fire instantly when projectiles don't hit entities.
This commit is contained in:
parent
43492ab6af
commit
30a382a6dc
@ -141,12 +141,6 @@ public abstract class Entity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void die() {
|
public void die() {
|
||||||
// CraftBukkit start
|
|
||||||
if (this.getBukkitEntity() instanceof Projectile && !(this instanceof EntityFish)) {
|
|
||||||
ProjectileHitEvent event = new ProjectileHitEvent((Projectile) this.getBukkitEntity());
|
|
||||||
this.world.getServer().getPluginManager().callEvent(event);
|
|
||||||
}
|
|
||||||
// CraftBukkit end
|
|
||||||
this.dead = true;
|
this.dead = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,6 +7,7 @@ import org.bukkit.craftbukkit.entity.CraftLivingEntity;
|
|||||||
import org.bukkit.entity.Projectile;
|
import org.bukkit.entity.Projectile;
|
||||||
import org.bukkit.event.entity.EntityDamageByProjectileEvent;
|
import org.bukkit.event.entity.EntityDamageByProjectileEvent;
|
||||||
import org.bukkit.event.entity.EntityDamageEvent;
|
import org.bukkit.event.entity.EntityDamageEvent;
|
||||||
|
import org.bukkit.event.entity.ProjectileHitEvent;
|
||||||
import org.bukkit.event.player.PlayerPickupItemEvent;
|
import org.bukkit.event.player.PlayerPickupItemEvent;
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
|
|
||||||
@ -162,6 +163,10 @@ public class EntityArrow extends Entity {
|
|||||||
float f2;
|
float f2;
|
||||||
|
|
||||||
if (movingobjectposition != null) {
|
if (movingobjectposition != null) {
|
||||||
|
// CraftBukkit start
|
||||||
|
ProjectileHitEvent phe = new ProjectileHitEvent((Projectile) this.getBukkitEntity());
|
||||||
|
this.world.getServer().getPluginManager().callEvent(phe);
|
||||||
|
// CraftBukkit end
|
||||||
if (movingobjectposition.entity != null) {
|
if (movingobjectposition.entity != null) {
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
boolean stick;
|
boolean stick;
|
||||||
|
@ -8,6 +8,7 @@ import org.bukkit.entity.Projectile;
|
|||||||
import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
|
import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
|
||||||
import org.bukkit.event.entity.EntityDamageByProjectileEvent;
|
import org.bukkit.event.entity.EntityDamageByProjectileEvent;
|
||||||
import org.bukkit.event.entity.EntityDamageEvent;
|
import org.bukkit.event.entity.EntityDamageEvent;
|
||||||
|
import org.bukkit.event.entity.ProjectileHitEvent;
|
||||||
import org.bukkit.event.player.PlayerEggThrowEvent;
|
import org.bukkit.event.player.PlayerEggThrowEvent;
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
|
|
||||||
@ -150,6 +151,9 @@ public class EntityEgg extends Entity {
|
|||||||
|
|
||||||
if (movingobjectposition != null) {
|
if (movingobjectposition != null) {
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
|
ProjectileHitEvent phe = new ProjectileHitEvent((Projectile) this.getBukkitEntity());
|
||||||
|
this.world.getServer().getPluginManager().callEvent(phe);
|
||||||
|
|
||||||
if (movingobjectposition.entity != null) {
|
if (movingobjectposition.entity != null) {
|
||||||
boolean stick;
|
boolean stick;
|
||||||
if (movingobjectposition.entity instanceof EntityLiving) {
|
if (movingobjectposition.entity instanceof EntityLiving) {
|
||||||
|
@ -10,6 +10,7 @@ import org.bukkit.entity.Projectile;
|
|||||||
import org.bukkit.event.entity.EntityDamageByProjectileEvent;
|
import org.bukkit.event.entity.EntityDamageByProjectileEvent;
|
||||||
import org.bukkit.event.entity.EntityDamageEvent;
|
import org.bukkit.event.entity.EntityDamageEvent;
|
||||||
import org.bukkit.event.entity.ExplosionPrimeEvent;
|
import org.bukkit.event.entity.ExplosionPrimeEvent;
|
||||||
|
import org.bukkit.event.entity.ProjectileHitEvent;
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
|
|
||||||
public class EntityFireball extends Entity {
|
public class EntityFireball extends Entity {
|
||||||
@ -127,6 +128,10 @@ public class EntityFireball extends Entity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (movingobjectposition != null) {
|
if (movingobjectposition != null) {
|
||||||
|
// CraftBukkit start
|
||||||
|
ProjectileHitEvent phe = new ProjectileHitEvent((Projectile) this.getBukkitEntity());
|
||||||
|
this.world.getServer().getPluginManager().callEvent(phe);
|
||||||
|
// CraftBukkit end
|
||||||
if (!this.world.isStatic) {
|
if (!this.world.isStatic) {
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
if (movingobjectposition.entity != null) {
|
if (movingobjectposition.entity != null) {
|
||||||
|
@ -7,6 +7,7 @@ import org.bukkit.craftbukkit.entity.CraftLivingEntity;
|
|||||||
import org.bukkit.entity.Projectile;
|
import org.bukkit.entity.Projectile;
|
||||||
import org.bukkit.event.entity.EntityDamageByProjectileEvent;
|
import org.bukkit.event.entity.EntityDamageByProjectileEvent;
|
||||||
import org.bukkit.event.entity.EntityDamageEvent;
|
import org.bukkit.event.entity.EntityDamageEvent;
|
||||||
|
import org.bukkit.event.entity.ProjectileHitEvent;
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
|
|
||||||
public class EntitySnowball extends Entity {
|
public class EntitySnowball extends Entity {
|
||||||
@ -148,6 +149,9 @@ public class EntitySnowball extends Entity {
|
|||||||
|
|
||||||
if (movingobjectposition != null) {
|
if (movingobjectposition != null) {
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
|
ProjectileHitEvent phe = new ProjectileHitEvent((Projectile) this.getBukkitEntity());
|
||||||
|
this.world.getServer().getPluginManager().callEvent(phe);
|
||||||
|
|
||||||
if (movingobjectposition.entity != null) {
|
if (movingobjectposition.entity != null) {
|
||||||
boolean stick;
|
boolean stick;
|
||||||
if (movingobjectposition.entity instanceof EntityLiving) {
|
if (movingobjectposition.entity instanceof EntityLiving) {
|
||||||
|
Loading…
Reference in New Issue
Block a user