mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-08 19:34:09 +01:00
65bc2541a3
By: md_5 <git@md-5.net>
29 lines
1.3 KiB
Diff
29 lines
1.3 KiB
Diff
--- a/net/minecraft/world/entity/EntityCreature.java
|
|
+++ b/net/minecraft/world/entity/EntityCreature.java
|
|
@@ -11,6 +11,10 @@
|
|
import net.minecraft.world.level.World;
|
|
import net.minecraft.world.phys.Vec3D;
|
|
|
|
+// CraftBukkit start
|
|
+import org.bukkit.event.entity.EntityUnleashEvent;
|
|
+// CraftBukkit end
|
|
+
|
|
public abstract class EntityCreature extends EntityInsentient {
|
|
|
|
protected static final float DEFAULT_WALK_TARGET_VALUE = 0.0F;
|
|
@@ -67,6 +71,7 @@
|
|
|
|
if (this instanceof EntityTameableAnimal && ((EntityTameableAnimal) this).isInSittingPose()) {
|
|
if (f > 10.0F) {
|
|
+ this.level().getCraftServer().getPluginManager().callEvent(new EntityUnleashEvent(this.getBukkitEntity(), EntityUnleashEvent.UnleashReason.DISTANCE)); // CraftBukkit
|
|
this.dropLeash(true, true);
|
|
}
|
|
|
|
@@ -75,6 +80,7 @@
|
|
|
|
this.onLeashDistance(f);
|
|
if (f > 10.0F) {
|
|
+ this.level().getCraftServer().getPluginManager().callEvent(new EntityUnleashEvent(this.getBukkitEntity(), EntityUnleashEvent.UnleashReason.DISTANCE)); // CraftBukkit
|
|
this.dropLeash(true, true);
|
|
this.goalSelector.disableControlFlag(PathfinderGoal.Type.MOVE);
|
|
} else if (f > 6.0F) {
|