fix duplicated entities and posible crash

This commit is contained in:
Esmorall 2019-12-12 11:38:33 -03:00
parent 8c08bcd81f
commit b300b0b87c

View File

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