remove unnecesary check on checktask

This commit is contained in:
Esmorall 2019-12-21 12:48:07 -03:00
parent 7e31f4bab2
commit e38f3a5a3f
2 changed files with 6 additions and 10 deletions

View File

@ -40,14 +40,12 @@ public class CheckTask extends BukkitRunnable {
int d = ConfigMain.getTrackingRange(); int d = ConfigMain.getTrackingRange();
for(Player player : Bukkit.getWorld(worldName).getPlayers()) { for(Player player : Bukkit.getWorld(worldName).getPlayers()) {
for(Entity ent : player.getNearbyEntities(d, d, d)) { for(Entity ent : player.getNearbyEntities(d, d, d)) {
if(!cps.playerChunkMap.trackedEntities.containsKey(ent.getEntityId())) {
trackAgain.add(((CraftEntity)ent).getHandle()); trackAgain.add(((CraftEntity)ent).getHandle());
if(ConfigMain.isDisableTickUntracked()) { if(ConfigMain.isDisableTickUntracked()) {
EntityTickManager.getInstance().enableTicking(((CraftEntity)ent).getHandle(), worldName); EntityTickManager.getInstance().enableTicking(((CraftEntity)ent).getHandle(), worldName);
} }
} }
} }
}
NMSEntityTracker.trackEntities(cps, trackAgain); NMSEntityTracker.trackEntities(cps, trackAgain);
} }

View File

@ -40,14 +40,12 @@ public class CheckTask extends BukkitRunnable {
int d = ConfigMain.getTrackingRange(); int d = ConfigMain.getTrackingRange();
for(Player player : Bukkit.getWorld(worldName).getPlayers()) { for(Player player : Bukkit.getWorld(worldName).getPlayers()) {
for(Entity ent : player.getNearbyEntities(d, d, d)) { for(Entity ent : player.getNearbyEntities(d, d, d)) {
if(!cps.playerChunkMap.trackedEntities.containsKey(ent.getEntityId())) {
trackAgain.add(((CraftEntity)ent).getHandle()); trackAgain.add(((CraftEntity)ent).getHandle());
if(ConfigMain.isDisableTickUntracked()) { if(ConfigMain.isDisableTickUntracked()) {
EntityTickManager.getInstance().enableTicking(((CraftEntity)ent).getHandle(), worldName); EntityTickManager.getInstance().enableTicking(((CraftEntity)ent).getHandle(), worldName);
} }
} }
} }
}
NMSEntityTracker.trackEntities(cps, trackAgain); NMSEntityTracker.trackEntities(cps, trackAgain);
} }