fix duplicated entities and posible crash
This commit is contained in:
parent
8c08bcd81f
commit
b300b0b87c
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue