diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java index 362e3b396f..fff17a2da9 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -87,7 +87,7 @@ public abstract class EntityLiving extends Entity { public boolean bp = false; public int bq = 0; protected boolean canPickUpLoot = false; - private boolean persistent = false; + public boolean persistent = (this instanceof EntityAnimal); // CraftBukkit - private -> public, change value protected int bs; protected double bt; protected double bu; @@ -1394,11 +1394,11 @@ public abstract class EntityLiving extends Entity { double d2 = entityhuman.locZ - this.locZ; double d3 = d0 * d0 + d1 * d1 + d2 * d2; - if (this.bj() && d3 > 16384.0D) { + if (d3 > 16384.0D) { // CraftBukkit - remove this.bj() check this.die(); } - if (this.bA > 600 && this.random.nextInt(800) == 0 && d3 > 1024.0D && this.bj()) { + if (this.bA > 600 && this.random.nextInt(800) == 0 && d3 > 1024.0D) { // CraftBukkit - remove this.bj() check this.die(); } else if (d3 < 1024.0D) { this.bA = 0; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java index 096de37378..a6cbc3d71f 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java @@ -303,4 +303,12 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { public boolean hasLineOfSight(Entity other) { return getHandle().aA().canSee(((CraftEntity) other).getHandle()); // az should be getEntitySenses } + + public boolean getRemoveWhenFarAway() { + return !getHandle().persistent; + } + + public void setRemoveWhenFarAway(boolean remove) { + getHandle().persistent = !remove; + } }