Paper/Spigot-Server-Patches/0229-Ocelot-despawns-should-honor-nametags-and-leash.patch
Aikar 18c3716c49
Current Chunk for Entity and Block Entities, counts by entity type
This enables us a fast reference to the entities current chunk instead
of having to look it up by hashmap lookups.

We also store counts by type to further enable other performance optimizations in later patches.
2018-07-04 03:58:56 -04:00

23 lines
936 B
Diff

From cee3ee7d056d74ede8ec145e8028fdff1ba18ec4 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/server/EntityOcelot.java b/src/main/java/net/minecraft/server/EntityOcelot.java
index 5a76821ea..858bbef5b 100644
--- a/src/main/java/net/minecraft/server/EntityOcelot.java
+++ b/src/main/java/net/minecraft/server/EntityOcelot.java
@@ -58,7 +58,7 @@ public class EntityOcelot extends EntityTameableAnimal {
}
protected boolean isTypeNotPersistent() {
- return !this.isTamed() /*&& this.ticksLived > 2400*/; // CraftBukkit
+ return !this.isTamed() && !this.hasCustomName() && !this.isLeashed() /*&& this.ticksLived > 2400*/; // CraftBukkit (ticks lived) - Paper (honor name and leash)
}
protected void initAttributes() {
--
2.18.0