leMaik / ManagedEntities

An API for managed entities for Bukkit plugins.
MIT License
0 stars 0 forks source link

Entities can't be controlled anymore after the chunk is unloaded and loaded again #1

Open leMaik opened 8 years ago

leMaik commented 8 years ago

When a chunk with a managed entity is unloaded, the entity can't be controlled anymore when the chunk is loaded again. Also, the reference for that entity is not removed, resulting in a memory leak.

Managed entities should not tick() anymore when they are unloaded and the reference should be dropped.

leMaik commented 8 years ago

This could be solved by using entity.setRemoveWhenFarAway(true), but that will hit performance.

leMaik commented 8 years ago

Note: That doesn't hit performance as chunks are still unloaded. :blush:

leMaik commented 8 years ago

This is not fixed. Citizens2 tracks the entities that were despawned and need to be respawned, that may be a possible solution.