From d8904827ec6831038ab5c21ef11aca1e75988f09 Mon Sep 17 00:00:00 2001 From: GJ Date: Tue, 26 Feb 2013 10:01:37 -0500 Subject: [PATCH] This should have the same effect. --- .../nossr50/skills/archery/TrackedEntity.java | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/skills/archery/TrackedEntity.java b/src/main/java/com/gmail/nossr50/skills/archery/TrackedEntity.java index b59e6584d..a8db0ff97 100644 --- a/src/main/java/com/gmail/nossr50/skills/archery/TrackedEntity.java +++ b/src/main/java/com/gmail/nossr50/skills/archery/TrackedEntity.java @@ -9,7 +9,6 @@ import com.gmail.nossr50.mcMMO; public class TrackedEntity implements Runnable { private LivingEntity livingEntity; private int arrowCount; - private int previousTicksLived; private int taskId; private BukkitScheduler scheduler; @@ -19,19 +18,6 @@ public class TrackedEntity implements Runnable { this.taskId = scheduler.scheduleSyncRepeatingTask(mcMMO.p, this, 12000, 12000); } - //LivingEntity.isDead() isn't a reliable way to know if an entity is still active - //This method must not be called more than once per server tick - private boolean isActive() { - int currentTicksLived = livingEntity.getTicksLived(); - - if (currentTicksLived == previousTicksLived) { - return false; - } - - previousTicksLived = currentTicksLived; - return true; - } - protected LivingEntity getLivingEntity() { return livingEntity; } @@ -46,7 +32,7 @@ public class TrackedEntity implements Runnable { @Override public void run() { - if (!isActive()) { + if (!livingEntity.isValid()) { Archery.removeFromTracker(this); scheduler.cancelTask(taskId); }