Checking again if list contains entity before ticking again

This commit is contained in:
Esmorall 2019-12-22 23:36:28 -03:00
parent 0da24f4c37
commit 2e3e3f3037
No known key found for this signature in database
GPG Key ID: 3F4DD7CEC746EEB3
2 changed files with 6 additions and 0 deletions

View File

@ -73,6 +73,9 @@ public class EntityTickManager extends BukkitRunnable {
if(!entity.valid) { if(!entity.valid) {
continue; continue;
} }
if(ws.entitiesById.containsValue(entity)) {
continue;
}
if(ws.entitiesById.containsKey(i)) { if(ws.entitiesById.containsKey(i)) {
int id = ((AtomicInteger)entityCount.get(null)).incrementAndGet(); int id = ((AtomicInteger)entityCount.get(null)).incrementAndGet();
ws.entitiesById.put(id, entity); ws.entitiesById.put(id, entity);

View File

@ -73,6 +73,9 @@ public class EntityTickManager extends BukkitRunnable {
if(!entity.valid) { if(!entity.valid) {
continue; continue;
} }
if(ws.entitiesById.containsValue(entity)) {
continue;
}
if(ws.entitiesById.containsKey(i)) { if(ws.entitiesById.containsKey(i)) {
int id = ((AtomicInteger)entityCount.get(null)).incrementAndGet(); int id = ((AtomicInteger)entityCount.get(null)).incrementAndGet();
ws.entitiesById.put(id, entity); ws.entitiesById.put(id, entity);