mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-24 17:03:51 -07:00
@@ -8,18 +8,18 @@
|
||||
+ public static synchronized RegionFile b(File file, int i, int j) {
|
||||
+ File file1 = new File(file, "region");
|
||||
+ File file2 = new File(file1, "r." + (i >> 5) + "." + (j >> 5) + ".mca");
|
||||
+ RegionFile regionfile = (RegionFile) RegionFileCache.a.get(file2);
|
||||
+ RegionFile regionfile = (RegionFile) RegionFileCache.cache.get(file2);
|
||||
+
|
||||
+ if (regionfile != null) {
|
||||
+ return regionfile;
|
||||
+ } else if (file1.exists() && file2.exists()) {
|
||||
+ if (RegionFileCache.a.size() >= 256) {
|
||||
+ if (RegionFileCache.cache.size() >= 256) {
|
||||
+ a();
|
||||
+ }
|
||||
+
|
||||
+ RegionFile regionfile1 = new RegionFile(file2);
|
||||
+
|
||||
+ RegionFileCache.a.put(file2, regionfile1);
|
||||
+ RegionFileCache.cache.put(file2, regionfile1);
|
||||
+ return regionfile1;
|
||||
+ } else {
|
||||
+ return null;
|
||||
@@ -28,7 +28,7 @@
|
||||
+ // CraftBukkit end
|
||||
+
|
||||
public static synchronized void a() {
|
||||
Iterator iterator = RegionFileCache.a.values().iterator();
|
||||
Iterator iterator = RegionFileCache.cache.values().iterator();
|
||||
|
||||
@@ -55,16 +78,32 @@
|
||||
}
|
||||
|
Reference in New Issue
Block a user