mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-10 03:52:45 +01:00
65bc2541a3
By: md_5 <git@md-5.net>
43 lines
1.9 KiB
Diff
43 lines
1.9 KiB
Diff
--- a/net/minecraft/world/entity/projectile/EntityLlamaSpit.java
|
|
+++ b/net/minecraft/world/entity/projectile/EntityLlamaSpit.java
|
|
@@ -15,6 +15,10 @@
|
|
import net.minecraft.world.phys.MovingObjectPositionEntity;
|
|
import net.minecraft.world.phys.Vec3D;
|
|
|
|
+// CraftBukkit start
|
|
+import org.bukkit.event.entity.EntityRemoveEvent;
|
|
+// CraftBukkit end
|
|
+
|
|
public class EntityLlamaSpit extends IProjectile {
|
|
|
|
public EntityLlamaSpit(EntityTypes<? extends EntityLlamaSpit> entitytypes, World world) {
|
|
@@ -38,7 +42,7 @@
|
|
Vec3D vec3d = this.getDeltaMovement();
|
|
MovingObjectPosition movingobjectposition = ProjectileHelper.getHitResultOnMoveVector(this, this::canHitEntity);
|
|
|
|
- this.hitTargetOrDeflectSelf(movingobjectposition);
|
|
+ this.preHitTargetOrDeflectSelf(movingobjectposition); // CraftBukkit - projectile hit event
|
|
double d0 = this.getX() + vec3d.x;
|
|
double d1 = this.getY() + vec3d.y;
|
|
double d2 = this.getZ() + vec3d.z;
|
|
@@ -47,9 +51,9 @@
|
|
float f = 0.99F;
|
|
|
|
if (this.level().getBlockStates(this.getBoundingBox()).noneMatch(BlockBase.BlockData::isAir)) {
|
|
- this.discard();
|
|
+ this.discard(EntityRemoveEvent.Cause.DESPAWN); // CraftBukkit - add Bukkit remove cause
|
|
} else if (this.isInWaterOrBubble()) {
|
|
- this.discard();
|
|
+ this.discard(EntityRemoveEvent.Cause.DESPAWN); // CraftBukkit - add Bukkit remove cause
|
|
} else {
|
|
this.setDeltaMovement(vec3d.scale(0.9900000095367432D));
|
|
this.applyGravity();
|
|
@@ -72,7 +76,7 @@
|
|
protected void onHitBlock(MovingObjectPositionBlock movingobjectpositionblock) {
|
|
super.onHitBlock(movingobjectpositionblock);
|
|
if (!this.level().isClientSide) {
|
|
- this.discard();
|
|
+ this.discard(EntityRemoveEvent.Cause.HIT); // CraftBukkit - add Bukkit remove cause
|
|
}
|
|
|
|
}
|