mirror of
https://github.com/PaperMC/Paper.git
synced 2025-03-13 19:28:03 +01:00
Ocelot despawns should honor nametags and leash
This commit is contained in:
parent
c2f10d08a9
commit
08aaee1b77
1 changed files with 9 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue