0
0
mirror of https://hub.spigotmc.org/stash/scm/spigot/craftbukkit.git synced 2024-11-25 09:16:13 +00:00
craftbukkit/nms-patches/net/minecraft/world/entity/animal/frog/ShootTongue.patch
2024-10-23 02:15:00 +11:00

41 lines
1.9 KiB
Diff

--- a/net/minecraft/world/entity/animal/frog/ShootTongue.java
+++ b/net/minecraft/world/entity/animal/frog/ShootTongue.java
@@ -20,6 +20,10 @@
import net.minecraft.world.level.pathfinder.PathEntity;
import net.minecraft.world.phys.Vec3D;
+// CraftBukkit start
+import org.bukkit.event.entity.EntityRemoveEvent;
+// CraftBukkit end
+
public class ShootTongue extends Behavior<Frog> {
public static final int TIME_OUT_DURATION = 100;
@@ -64,7 +68,7 @@
BehaviorUtil.lookAtEntity(frog, entityliving);
frog.setTongueTarget(entityliving);
- frog.getBrain().setMemory(MemoryModuleType.WALK_TARGET, (Object) (new MemoryTarget(entityliving.position(), 2.0F, 0)));
+ frog.getBrain().setMemory(MemoryModuleType.WALK_TARGET, (new MemoryTarget(entityliving.position(), 2.0F, 0))); // CraftBukkit - decompile error
this.calculatePathCounter = 10;
this.state = ShootTongue.a.MOVE_TO_TARGET;
}
@@ -85,7 +89,7 @@
if (entity.isAlive()) {
frog.doHurtTarget(worldserver, entity);
if (!entity.isAlive()) {
- entity.remove(Entity.RemovalReason.KILLED);
+ entity.remove(Entity.RemovalReason.KILLED, EntityRemoveEvent.Cause.DEATH); // CraftBukkit - add Bukkit remove cause
}
}
}
@@ -106,7 +110,7 @@
this.eatAnimationTimer = 0;
this.state = ShootTongue.a.CATCH_ANIMATION;
} else if (this.calculatePathCounter <= 0) {
- frog.getBrain().setMemory(MemoryModuleType.WALK_TARGET, (Object) (new MemoryTarget(entityliving.position(), 2.0F, 0)));
+ frog.getBrain().setMemory(MemoryModuleType.WALK_TARGET, (new MemoryTarget(entityliving.position(), 2.0F, 0))); // CraftBukkit - decompile error
this.calculatePathCounter = 10;
} else {
--this.calculatePathCounter;