PaperMC/paper-server/nms-patches/net/minecraft/world/entity/projectile/IProjectile.patch
CraftBukkit/Spigot 9da047989c Repackage NMS
By: md_5 <git@md-5.net>
2021-03-16 09:00:00 +11:00

29 lines
1.2 KiB
Diff

--- a/net/minecraft/world/entity/projectile/IProjectile.java
+++ b/net/minecraft/world/entity/projectile/IProjectile.java
@@ -15,6 +15,10 @@
import net.minecraft.world.phys.MovingObjectPositionEntity;
import net.minecraft.world.phys.Vec3D;
+// CraftBukkit start
+import org.bukkit.projectiles.ProjectileSource;
+// CraftBukkit end
+
public abstract class IProjectile extends Entity {
private UUID shooter;
@@ -30,6 +34,7 @@
this.shooter = entity.getUniqueID();
this.c = entity.getId();
}
+ this.projectileSource = (entity != null && entity.getBukkitEntity() instanceof ProjectileSource) ? (ProjectileSource) entity.getBukkitEntity() : null; // CraftBukkit
}
@@ -112,6 +117,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) {