From 720a8d706afcc2a099cbfed7ff42e34977199738 Mon Sep 17 00:00:00 2001 From: EvilSeph Date: Thu, 1 Aug 2013 21:56:29 -0400 Subject: [PATCH] Revert to 1.5 despawning behaviour for Ocelots and Wolves. Fixes BUKKIT-4449 --- src/main/java/net/minecraft/server/EntityInsentient.java | 9 +++------ src/main/java/net/minecraft/server/EntityOcelot.java | 2 +- src/main/java/net/minecraft/server/EntityWolf.java | 2 +- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java index 12d47daf6b..34eb87252e 100644 --- a/src/main/java/net/minecraft/server/EntityInsentient.java +++ b/src/main/java/net/minecraft/server/EntityInsentient.java @@ -377,8 +377,9 @@ public abstract class EntityInsentient extends EntityLiving { } protected void bo() { - // CraftBukkit - temporary hack to handle Ocelot despawning - if ((this instanceof EntityOcelot && this.isTypeNotPersistent()) || (!this.persistent)) { + if (this.persistent) { + this.aV = 0; + } else { EntityHuman entityhuman = this.world.findNearbyPlayer(this, -1.0D); if (entityhuman != null) { @@ -397,11 +398,7 @@ public abstract class EntityInsentient extends EntityLiving { this.aV = 0; } } - // CraftBukkit start - } else { - this.aV = 0; } - // CraftBukkit end } protected void bh() { diff --git a/src/main/java/net/minecraft/server/EntityOcelot.java b/src/main/java/net/minecraft/server/EntityOcelot.java index c4e85962f9..069408dbcc 100644 --- a/src/main/java/net/minecraft/server/EntityOcelot.java +++ b/src/main/java/net/minecraft/server/EntityOcelot.java @@ -48,7 +48,7 @@ public class EntityOcelot extends EntityTameableAnimal { } protected boolean isTypeNotPersistent() { - return !this.isTamed() && this.ticksLived > 2400; + return !this.isTamed(); // CraftBukkit } public boolean be() { diff --git a/src/main/java/net/minecraft/server/EntityWolf.java b/src/main/java/net/minecraft/server/EntityWolf.java index df22e837a6..9d7d4a711e 100644 --- a/src/main/java/net/minecraft/server/EntityWolf.java +++ b/src/main/java/net/minecraft/server/EntityWolf.java @@ -339,7 +339,7 @@ public class EntityWolf extends EntityTameableAnimal { } protected boolean isTypeNotPersistent() { - return !this.isTamed() && this.ticksLived > 2400; + return !this.isTamed(); // CraftBukkit } public boolean a(EntityLiving entityliving, EntityLiving entityliving1) {