3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-20 21:40:06 +01:00
Paper/nms-patches/EntityProjectile.patch

32 Zeilen
1.3 KiB
Diff

2015-05-25 12:37:24 +02:00
--- a/net/minecraft/server/EntityProjectile.java
+++ b/net/minecraft/server/EntityProjectile.java
2019-04-23 04:00:00 +02:00
@@ -32,6 +32,7 @@
2019-12-10 23:00:00 +01:00
this(entitytypes, entityliving.locX(), entityliving.getHeadY() - 0.10000000149011612D, entityliving.locZ(), world);
this.shooter = entityliving;
2018-07-15 02:00:00 +02:00
this.shooterId = entityliving.getUniqueID();
+ this.projectileSource = (org.bukkit.entity.LivingEntity) entityliving.getBukkitEntity(); // CraftBukkit
2016-02-29 22:32:46 +01:00
}
2019-04-23 04:00:00 +02:00
public void a(Entity entity, float f, float f1, float f2, float f3, float f4) {
2019-12-10 23:00:00 +01:00
@@ -83,7 +84,7 @@
2019-04-23 04:00:00 +02:00
break;
}
2019-12-10 23:00:00 +01:00
- if (this.shooter != null && this.ticksLived < 2 && this.ap == null) {
+ if (this.shooter != null && this.ticksLived < 2 && this.ap == null && this.shooter == entity) { // CraftBukkit - MC-88491
this.ap = entity;
this.aq = 3;
2019-04-23 04:00:00 +02:00
break;
2019-12-10 23:00:00 +01:00
@@ -103,6 +104,11 @@
2019-04-23 04:00:00 +02:00
this.c(((MovingObjectPositionBlock) movingobjectposition).getBlockPosition());
} else {
this.a(movingobjectposition);
+ // CraftBukkit start
+ if (this.dead) {
2016-11-28 02:47:01 +01:00
+ org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileHitEvent(this, movingobjectposition);
+ }
+ // CraftBukkit end
}
}