diff --git a/EntityTrackerFixer/config.yml b/EntityTrackerFixer/config.yml index e17d20a..760f924 100644 --- a/EntityTrackerFixer/config.yml +++ b/EntityTrackerFixer/config.yml @@ -16,7 +16,7 @@ disable-tick-for-untracked-entities: true untrack-ticks: 400 #if tps are not below this value, the task will not perform the untrack and it will wait for the next run -tps-limit: 18.5 +tps-limit: 19.5 #frecuency in ticks to check untracked entities #It will check for players traking entities and will track it again (this is to prevent invisible entities) diff --git a/EntityTrackerFixer/src/net/minemora/entitytrackerfixer/entitytick/EntityTickManager.java b/EntityTrackerFixer/src/net/minemora/entitytrackerfixer/entitytick/EntityTickManager.java index c98da86..290b3ed 100644 --- a/EntityTrackerFixer/src/net/minemora/entitytrackerfixer/entitytick/EntityTickManager.java +++ b/EntityTrackerFixer/src/net/minemora/entitytrackerfixer/entitytick/EntityTickManager.java @@ -16,10 +16,12 @@ import net.minemora.entitytrackerfixer.util.ReflectionUtils; public class EntityTickManager extends TimerTask { private static Field tickingField; + private static Field tickingEntitiesField; static { try { - tickingField = ReflectionUtils.getClassPrivateField(WorldServer.class, "tickingEntities"); + tickingEntitiesField = ReflectionUtils.getClassPrivateField(WorldServer.class, "tickingEntities"); + tickingField = ReflectionUtils.getClassPrivateField(WorldServer.class, "ticking"); } catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e) { e.printStackTrace(); } @@ -54,8 +56,7 @@ public class EntityTickManager extends TimerTask { for(String worldName : cache.keySet()) { WorldServer ws = ((CraftWorld)Bukkit.getWorld(worldName)).getHandle(); try { - boolean ticking = tickingField.getBoolean(ws); - if(ticking) { + if(tickingEntitiesField.getBoolean(ws) || tickingField.getBoolean(ws)) { //System.out.println("ticking"); continue; }