mirror of
https://github.com/Minestom/Minestom.git
synced 2024-11-18 00:25:30 +01:00
Entity with scheduled removal still execute tick until complete removal, added some comments
This commit is contained in:
parent
8966cc7ec8
commit
3f487f4f4f
@ -384,21 +384,23 @@ public abstract class Entity implements Viewable, EventHandler, DataContainer, P
|
||||
if (instance == null)
|
||||
return;
|
||||
|
||||
if (scheduledRemoveTime != 0) { // Any entity with scheduled remove does not update
|
||||
// Scheduled remove
|
||||
if (scheduledRemoveTime != 0) {
|
||||
final boolean finished = time >= scheduledRemoveTime;
|
||||
if (finished) {
|
||||
remove();
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Instant remove
|
||||
if (shouldRemove()) {
|
||||
remove();
|
||||
return;
|
||||
}
|
||||
|
||||
final Chunk currentChunk = getChunk(); // current entity chunk
|
||||
|
||||
// Check if the entity chunk is loaded
|
||||
final Chunk currentChunk = getChunk();
|
||||
if (!ChunkUtils.isLoaded(currentChunk)) {
|
||||
// No update for entities in unloaded chunk
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user