Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-18 20:40:08 +01:00
Call unleash event for non-sitting animals. Fixes BUKKIT-4658
The unleash event is only called for animals that are sitting - ones that receive no movement vector. This adds the missing event call for non-sitting animals.
Dieser Commit ist enthalten in:
Ursprung
e489840ca9
Commit
4aeb3ff63d
@ -5,6 +5,7 @@ import java.util.UUID;
|
||||
// CraftBukkit start
|
||||
import org.bukkit.craftbukkit.entity.CraftEntity;
|
||||
import org.bukkit.event.entity.EntityTargetEvent;
|
||||
import org.bukkit.event.entity.EntityUnleashEvent;
|
||||
// CraftBukkit end
|
||||
|
||||
public abstract class EntityCreature extends EntityInsentient {
|
||||
@ -264,7 +265,7 @@ public abstract class EntityCreature extends EntityInsentient {
|
||||
|
||||
if (this instanceof EntityTameableAnimal && ((EntityTameableAnimal) this).isSitting()) {
|
||||
if (f > 10.0F) {
|
||||
this.world.getServer().getPluginManager().callEvent(new org.bukkit.event.entity.EntityUnleashEvent(this.getBukkitEntity(), org.bukkit.event.entity.EntityUnleashEvent.UnleashReason.DISTANCE)); // CraftBukkit
|
||||
this.world.getServer().getPluginManager().callEvent(new EntityUnleashEvent(this.getBukkitEntity(), EntityUnleashEvent.UnleashReason.DISTANCE)); // CraftBukkit
|
||||
this.a(true, true);
|
||||
}
|
||||
|
||||
@ -293,6 +294,7 @@ public abstract class EntityCreature extends EntityInsentient {
|
||||
}
|
||||
|
||||
if (f > 10.0F) {
|
||||
this.world.getServer().getPluginManager().callEvent(new EntityUnleashEvent(this.getBukkitEntity(), EntityUnleashEvent.UnleashReason.DISTANCE)); // CraftBukkit
|
||||
this.a(true, true);
|
||||
}
|
||||
} else if (!this.bH() && this.bt) {
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren