mirror of
https://github.com/Minestom/Minestom.git
synced 2024-06-26 06:24:54 +02:00
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.
|
* Removes the entity from the server immediately.
|
||||||
* <p>
|
* <p>
|
||||||
* WARNING: this do not trigger the {@link EntityDeathEvent} event.
|
* WARNING: this does not trigger {@link EntityDeathEvent}.
|
||||||
*/
|
*/
|
||||||
public void remove() {
|
public void remove() {
|
||||||
this.removed = true;
|
this.removed = true;
|
||||||
this.shouldRemove = true;
|
this.shouldRemove = true;
|
||||||
entityById.remove(id);
|
Entity.entityById.remove(id);
|
||||||
|
Entity.entityByUuid.remove(uuid);
|
||||||
if (instance != null)
|
if (instance != null)
|
||||||
instance.UNSAFE_removeEntity(this);
|
instance.UNSAFE_removeEntity(this);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user