mirror of https://github.com/Minestom/Minestom.git
Fix entity uuid map memory leak
This commit is contained in:
parent
835a769080
commit
23fc19430a
|
@ -1219,12 +1219,13 @@ public abstract class Entity implements Viewable, EventHandler, DataContainer, P
|
|||
/**
|
||||
* Removes the entity from the server immediately.
|
||||
* <p>
|
||||
* WARNING: this do not trigger the {@link EntityDeathEvent} event.
|
||||
* WARNING: this does not trigger {@link EntityDeathEvent}.
|
||||
*/
|
||||
public void remove() {
|
||||
this.removed = true;
|
||||
this.shouldRemove = true;
|
||||
entityById.remove(id);
|
||||
Entity.entityById.remove(id);
|
||||
Entity.entityByUuid.remove(uuid);
|
||||
if (instance != null)
|
||||
instance.UNSAFE_removeEntity(this);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue