mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-27 19:24:44 +02:00
Change ChunkletManager to a notify/demand system
Allowing NullChunkletManager to bypass the ChunkletUnloader as it is not needed.
This commit is contained in:
@ -6,6 +6,7 @@ import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import org.bukkit.Chunk;
|
||||
import org.bukkit.World;
|
||||
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
|
||||
@ -26,6 +27,10 @@ public class ChunkletUnloader implements Runnable {
|
||||
unloadedChunks.put(chunk, 0);
|
||||
}
|
||||
|
||||
public static void addToList(int cx, int cz, World world) {
|
||||
addToList(world.getChunkAt(cx, cz));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
for (Iterator<Entry<Chunk, Integer>> it = unloadedChunks.entrySet().iterator() ; it.hasNext() ; ) {
|
||||
@ -37,7 +42,7 @@ public class ChunkletUnloader implements Runnable {
|
||||
|
||||
//Chunklets are unloaded only if their chunk has been unloaded for minimumInactiveTime
|
||||
if (inactiveTime >= minimumInactiveTime) {
|
||||
mcMMO.placeStore.chunkUnloaded(chunk.getX(), chunk.getZ(), chunk.getWorld());
|
||||
mcMMO.placeStore.unloadChunk(chunk.getX(), chunk.getZ(), chunk.getWorld());
|
||||
it.remove();
|
||||
continue;
|
||||
}
|
||||
|
Reference in New Issue
Block a user