Ocelot despawns should honor nametags and leash

This commit is contained in:
BillyGalbreath 2017-07-31 01:54:40 -05:00
parent c2f10d08a9
commit 08aaee1b77

View file

@ -1,5 +1,14 @@
--- a/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 @@
if ((this.temptGoal == null || this.temptGoal.isRunning()) && !this.isTrusting() && this.isFood(itemstack) && player.distanceToSqr((Entity) this) < 9.0D) {
this.usePlayerItem(player, hand, itemstack);