use of net.minecraft.world.gen.ChunkProviderServer in project CatServer by Luohuayu.
the class CraftWorld method processChunkGC.
public void processChunkGC() {
chunkGCTickCount++;
if (chunkLoadCount >= server.chunkGCLoadThresh && server.chunkGCLoadThresh > 0) {
chunkLoadCount = 0;
} else if (chunkGCTickCount >= server.chunkGCPeriod && server.chunkGCPeriod > 0) {
chunkGCTickCount = 0;
} else {
return;
}
ChunkProviderServer cps = world.getChunkProvider();
for (net.minecraft.world.chunk.Chunk chunk : cps.id2ChunkMap.values()) {
// If in use, skip it
if (isChunkInUse(chunk.x, chunk.z)) {
continue;
}
// Already unloading?
if (cps.droppedChunksSet.contains(ChunkPos.asLong(chunk.x, chunk.z))) {
// CatServer
if (!chunk.unloadQueued)
chunk.unloadQueued = true;
continue;
}
// Add unload request
cps.queueUnload(chunk);
}
}
use of net.minecraft.world.gen.ChunkProviderServer in project Magma by magmafoundation.
the class CraftWorld method processChunkGC.
public void processChunkGC() {
chunkGCTickCount++;
if (chunkLoadCount >= server.chunkGCLoadThresh && server.chunkGCLoadThresh > 0) {
chunkLoadCount = 0;
} else if (chunkGCTickCount >= server.chunkGCPeriod && server.chunkGCPeriod > 0) {
chunkGCTickCount = 0;
} else {
return;
}
ChunkProviderServer cps = world.getChunkProvider();
for (net.minecraft.world.chunk.Chunk chunk : cps.id2ChunkMap.values()) {
// If in use, skip it
if (isChunkInUse(chunk.x, chunk.z)) {
continue;
}
// Already unloading?
if (cps.droppedChunksSet.contains(ChunkPos.asLong(chunk.x, chunk.z))) {
continue;
}
// Add unload request
cps.queueUnload(chunk);
}
}
Aggregations