Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-18 04:20:08 +01:00
Add hitEntity to ProjectileHitEvent
Dieser Commit ist enthalten in:
Ursprung
2ba48b4965
Commit
1c07d5c78f
@ -27,7 +27,7 @@
|
||||
protected void a(MovingObjectPosition movingobjectposition) {
|
||||
Entity entity = movingobjectposition.entity;
|
||||
-
|
||||
+ org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileHitEvent(this); // CraftBukkit - Call event
|
||||
+ org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileHitEvent(this, movingobjectposition); // CraftBukkit - Call event
|
||||
if (entity != null) {
|
||||
float f = MathHelper.sqrt(this.motX * this.motX + this.motY * this.motY + this.motZ * this.motZ);
|
||||
int i = MathHelper.f((double) f * this.damage);
|
||||
|
@ -44,7 +44,7 @@
|
||||
+
|
||||
+ // CraftBukkit start - Fire ProjectileHitEvent
|
||||
+ if (this.dead) {
|
||||
+ CraftEventFactory.callProjectileHitEvent(this);
|
||||
+ CraftEventFactory.callProjectileHitEvent(this, movingobjectposition);
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
|
@ -16,7 +16,7 @@
|
||||
}
|
||||
|
||||
if (movingobjectposition != null && movingobjectposition.type != MovingObjectPosition.EnumMovingObjectType.MISS) {
|
||||
+ org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileHitEvent(this); // Craftbukkit - Call event
|
||||
+ org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileHitEvent(this, movingobjectposition); // Craftbukkit - Call event
|
||||
if (movingobjectposition.type == MovingObjectPosition.EnumMovingObjectType.ENTITY) {
|
||||
this.hooked = movingobjectposition.entity;
|
||||
this.s();
|
||||
|
@ -14,7 +14,7 @@
|
||||
this.a(movingobjectposition);
|
||||
+ // CraftBukkit start
|
||||
+ if (this.dead) {
|
||||
+ org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileHitEvent(this);
|
||||
+ org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileHitEvent(this, movingobjectposition);
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
|
@ -778,8 +778,8 @@ public class CraftEventFactory {
|
||||
return event;
|
||||
}
|
||||
|
||||
public static ProjectileHitEvent callProjectileHitEvent(Entity entity) {
|
||||
ProjectileHitEvent event = new ProjectileHitEvent((Projectile) entity.getBukkitEntity());
|
||||
public static ProjectileHitEvent callProjectileHitEvent(Entity entity, MovingObjectPosition position) {
|
||||
ProjectileHitEvent event = new ProjectileHitEvent((Projectile) entity.getBukkitEntity(), position.entity == null ? null : position.entity.getBukkitEntity());
|
||||
entity.world.getServer().getPluginManager().callEvent(event);
|
||||
return event;
|
||||
}
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren