Optimize Spare Chunk loads to be removed faster

this has technically been a longer standing problem, but if an async
chunk loads after a chunk has been removed from the chunk map, it would
be treated as any other spare chunk and kept loaded until Chunk GC kicks in.

This fixes that, but also obsoletes ChunkGC in that anytime we load a spare
chunk (a chunk outside of any players view distance), we will immediately
mark it for unload.

This should reduce the amount of spare chunks loaded on a server.
This commit is contained in:
Aikar
2018-09-30 20:34:05 -04:00
parent 424d794178
commit 065868036c
5 changed files with 58 additions and 11 deletions

View File

@@ -1418,7 +1418,7 @@ index 22a262bb60..40ec398eef 100644
if (flag) {
packetdataserializer.writeBytes(chunksection.getSkyLightArray().asBytes());
diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java
index f8d8a44a88..e7d465fb8a 100644
index 84896d6f6b..2a889dc20a 100644
--- a/src/main/java/net/minecraft/server/PlayerChunk.java
+++ b/src/main/java/net/minecraft/server/PlayerChunk.java
@@ -0,0 +0,0 @@ public class PlayerChunk {