Fix World#isChunkGenerated calls (#2186)
* Fix World#isChunkGenerated calls Optimize World#loadChunk() too This patch also adds a chunk status cache on region files (note that its only purpose is to cache the status on DISK) * Ensure correct regionfile usage This also bumps the minimum region file cache to 4 files given readChunkData can load potentially 4 files. * Fix closed check * Better checks for invalid regionfile usage
This commit is contained in:
@@ -11,7 +11,7 @@ The implementation uses a LinkedHashMap as an LRU cache (modified from HashMap).
|
||||
The maximum size of the RegionFileCache is also made configurable.
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
||||
index 6cc99ffe43..4424f7ef18 100644
|
||||
index 6cc99ffe43..0cef1853f5 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
||||
@@ -0,0 +0,0 @@ public class PaperConfig {
|
||||
@@ -21,7 +21,7 @@ index 6cc99ffe43..4424f7ef18 100644
|
||||
+
|
||||
+ public static int regionFileCacheSize = 256;
|
||||
+ private static void regionFileCacheSize() {
|
||||
+ regionFileCacheSize = getInt("settings.region-file-cache-size", 256);
|
||||
+ regionFileCacheSize = Math.max(getInt("settings.region-file-cache-size", 256), 4);
|
||||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/RegionFileCache.java b/src/main/java/net/minecraft/server/RegionFileCache.java
|
||||
|
||||
Reference in New Issue
Block a user