Paper/patches/unapplied/server/0152-Ocelot-despawns-should-honor-nametags-and-leash.patch
2023-09-21 19:18:04 +02:00

20 lines
1001 B
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: BillyGalbreath <Blake.Galbreath@GMail.com>
Date: Mon, 31 Jul 2017 01:54:40 -0500
Subject: [PATCH] Ocelot despawns should honor nametags and leash
diff --git a/src/main/java/net/minecraft/world/entity/animal/Ocelot.java b/src/main/java/net/minecraft/world/entity/animal/Ocelot.java
index 14b8b844af59ba84211fb029eb2470eb8044faf9..924ea172cab5178e5754bfe09cc7b83c1a66faa6 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Ocelot.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Ocelot.java
@@ -133,7 +133,7 @@ public class Ocelot extends Animal {
@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() {