mirror of
https://github.com/Minestom/Minestom.git
synced 2025-02-07 16:01:55 +01:00
Fast exit when no chunk should be unloaded
This commit is contained in:
parent
52732ed4cd
commit
a33234d886
@ -793,6 +793,10 @@ public class InstanceContainer extends Instance {
|
||||
* Unsafe because it has to be done on the same thread as the instance/chunks tick update.
|
||||
*/
|
||||
protected void UNSAFE_unloadChunks() {
|
||||
if (scheduledChunksToRemove.isEmpty()) {
|
||||
// Fast exit
|
||||
return;
|
||||
}
|
||||
synchronized (scheduledChunksToRemove) {
|
||||
for (Chunk chunk : scheduledChunksToRemove) {
|
||||
final int chunkX = chunk.getChunkX();
|
||||
|
Loading…
Reference in New Issue
Block a user