3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-18 12:30:06 +01:00
Paper/nms-patches/IProjectile.patch

30 Zeilen
1.1 KiB
Diff

2020-06-25 02:00:00 +02:00
--- a/net/minecraft/server/IProjectile.java
+++ b/net/minecraft/server/IProjectile.java
@@ -4,6 +4,10 @@
import java.util.UUID;
import javax.annotation.Nullable;
+// CraftBukkit start
2020-07-06 00:50:27 +02:00
+import org.bukkit.projectiles.ProjectileSource;
2020-06-25 02:00:00 +02:00
+// CraftBukkit end
+
public abstract class IProjectile extends Entity {
private UUID shooter;
@@ -19,6 +23,7 @@
this.shooter = entity.getUniqueID();
this.c = entity.getId();
}
+ this.projectileSource = (entity != null && entity.getBukkitEntity() instanceof ProjectileSource) ? (ProjectileSource) entity.getBukkitEntity() : null; // CraftBukkit
2020-06-25 02:00:00 +02:00
}
@@ -101,6 +106,7 @@
}
protected void a(MovingObjectPosition movingobjectposition) {
+ org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileHitEvent(this, movingobjectposition); // CraftBukkit - Call event
MovingObjectPosition.EnumMovingObjectType movingobjectposition_enummovingobjecttype = movingobjectposition.getType();
if (movingobjectposition_enummovingobjecttype == MovingObjectPosition.EnumMovingObjectType.ENTITY) {