Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-19 04:50:06 +01:00
moved firing of ProjectileHitEvent for mojang projectiles
Dieser Commit ist enthalten in:
Ursprung
fb8a45b648
Commit
5adcf526ab
@ -27,9 +27,6 @@ public class EntityEgg extends EntityProjectile {
|
|||||||
|
|
||||||
protected void a(MovingObjectPosition movingobjectposition) {
|
protected void a(MovingObjectPosition movingobjectposition) {
|
||||||
// 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) {
|
||||||
|
@ -1,6 +1,11 @@
|
|||||||
package net.minecraft.server;
|
package net.minecraft.server;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
// CraftBukkit start
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.entity.Projectile;
|
||||||
|
import org.bukkit.event.entity.ProjectileHitEvent;
|
||||||
|
// CraftBukkit end
|
||||||
|
|
||||||
public abstract class EntityProjectile extends Entity {
|
public abstract class EntityProjectile extends Entity {
|
||||||
|
|
||||||
@ -149,6 +154,12 @@ public abstract class EntityProjectile extends Entity {
|
|||||||
|
|
||||||
if (movingobjectposition != null) {
|
if (movingobjectposition != null) {
|
||||||
this.a(movingobjectposition);
|
this.a(movingobjectposition);
|
||||||
|
// CraftBukkit start
|
||||||
|
if (this.dead) {
|
||||||
|
ProjectileHitEvent hitEvent = new ProjectileHitEvent((Projectile) this.getBukkitEntity());
|
||||||
|
Bukkit.getPluginManager().callEvent(hitEvent);
|
||||||
|
}
|
||||||
|
// CraftBukkit end
|
||||||
}
|
}
|
||||||
|
|
||||||
this.locX += this.motX;
|
this.locX += this.motX;
|
||||||
|
@ -6,7 +6,6 @@ import org.bukkit.craftbukkit.entity.CraftLivingEntity;
|
|||||||
import org.bukkit.entity.Projectile;
|
import org.bukkit.entity.Projectile;
|
||||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||||
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 EntityProjectile {
|
public class EntitySnowball extends EntityProjectile {
|
||||||
@ -31,8 +30,6 @@ public class EntitySnowball extends EntityProjectile {
|
|||||||
b0 = 3;
|
b0 = 3;
|
||||||
}
|
}
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
ProjectileHitEvent hitEvent = new ProjectileHitEvent((Projectile) this.getBukkitEntity());
|
|
||||||
Bukkit.getPluginManager().callEvent(hitEvent);
|
|
||||||
final Entity movingEntity = movingobjectposition.entity;
|
final Entity movingEntity = movingobjectposition.entity;
|
||||||
boolean stick = false;
|
boolean stick = false;
|
||||||
|
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren