Ocelot despawns should honor nametags and leash
This commit is contained in:
@@ -1,5 +1,14 @@
|
|||||||
--- a/net/minecraft/world/entity/animal/Ocelot.java
|
--- a/net/minecraft/world/entity/animal/Ocelot.java
|
||||||
+++ b/net/minecraft/world/entity/animal/Ocelot.java
|
+++ b/net/minecraft/world/entity/animal/Ocelot.java
|
||||||
|
@@ -132,7 +132,7 @@
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean removeWhenFarAway(double distanceSquared) {
|
||||||
|
- return !this.isTrusting() && this.tickCount > 2400;
|
||||||
|
+ return !this.isTrusting() && this.tickCount > 2400 && !this.hasCustomName() && !this.isLeashed(); // Paper - honor name and leash
|
||||||
|
}
|
||||||
|
|
||||||
|
public static AttributeSupplier.Builder createAttributes() {
|
||||||
@@ -167,7 +167,7 @@
|
@@ -167,7 +167,7 @@
|
||||||
if ((this.temptGoal == null || this.temptGoal.isRunning()) && !this.isTrusting() && this.isFood(itemstack) && player.distanceToSqr((Entity) this) < 9.0D) {
|
if ((this.temptGoal == null || this.temptGoal.isRunning()) && !this.isTrusting() && this.isFood(itemstack) && player.distanceToSqr((Entity) this) < 9.0D) {
|
||||||
this.usePlayerItem(player, hand, itemstack);
|
this.usePlayerItem(player, hand, itemstack);
|
||||||
|
|||||||
Reference in New Issue
Block a user