Updated Upstream (Bukkit/CraftBukkit/Spigot)
Developers!: You will need to clean up your work/Minecraft/1.13.2 folder for this Upstream has released updates that appears to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Bukkit Changes: b850a822 SPIGOT-4526: Add conversion time API for Zombie & subclasses CraftBukkit Changes: 38cf676e SPIGOT-4534: CreatureSpawnEvent not being called for CHUNK_GEN b446cb5d SPIGOT-4527: Fix sponges with waterlogged blocks 6ec8ea5c SPIGOT-4526: Add conversion time API for Zombie & subclasses c64fe508 Mappings Update a3c2ec03 Fix missing ServerListPingEvent call for legacy pings Spigot Changes: 1dc156ce Rebuild patches 140f654d Mappings Update
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 dccd00127..b4dba7247 100644
|
||||
index 492df2c8e..0778f53e2 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 {
|
||||
@@ -25,7 +25,7 @@ index dccd00127..b4dba7247 100644
|
||||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/RegionFileCache.java b/src/main/java/net/minecraft/server/RegionFileCache.java
|
||||
index 2217adf99..c0ab543b9 100644
|
||||
index 5dbd1d517..964996976 100644
|
||||
--- a/src/main/java/net/minecraft/server/RegionFileCache.java
|
||||
+++ b/src/main/java/net/minecraft/server/RegionFileCache.java
|
||||
@@ -0,0 +0,0 @@ import java.io.IOException;
|
||||
@@ -37,19 +37,17 @@ index 2217adf99..c0ab543b9 100644
|
||||
|
||||
public class RegionFileCache {
|
||||
|
||||
- public static final Map<File, RegionFile> a = Maps.newHashMap(); // Spigot - private -> public
|
||||
+ public static final Map<File, RegionFile> a = new LinkedHashMap(PaperConfig.regionFileCacheSize, 0.75f, true); // Spigot - private -> public, Paper - HashMap -> LinkedHashMap
|
||||
- public static final Map<File, RegionFile> cache = Maps.newHashMap();
|
||||
+ public static final Map<File, RegionFile> cache = new LinkedHashMap(PaperConfig.regionFileCacheSize, 0.75f, true); // Paper - HashMap -> LinkedHashMap
|
||||
|
||||
public static synchronized RegionFile a(File file, int i, int j) {
|
||||
File file1 = new File(file, "region");
|
||||
@@ -0,0 +0,0 @@ public class RegionFileCache {
|
||||
file1.mkdirs();
|
||||
}
|
||||
|
||||
- if (RegionFileCache.a.size() >= 256) {
|
||||
if (RegionFileCache.cache.size() >= 256) {
|
||||
- a();
|
||||
+ if (RegionFileCache.a.size() >= PaperConfig.regionFileCacheSize) { // Paper
|
||||
+ trimCache(); // Paper
|
||||
+ trimCache();
|
||||
}
|
||||
|
||||
RegionFile regionfile1 = new RegionFile(file2);
|
||||
@@ -59,11 +57,11 @@ index 2217adf99..c0ab543b9 100644
|
||||
|
||||
+ // Paper Start
|
||||
+ private static synchronized void trimCache() {
|
||||
+ Iterator<Map.Entry<File, RegionFile>> itr = RegionFileCache.a.entrySet().iterator();
|
||||
+ int count = RegionFileCache.a.size() - PaperConfig.regionFileCacheSize;
|
||||
+ Iterator<Map.Entry<File, RegionFile>> itr = RegionFileCache.cache.entrySet().iterator();
|
||||
+ int count = RegionFileCache.cache.size() - PaperConfig.regionFileCacheSize;
|
||||
+ while (count-- >= 0 && itr.hasNext()) {
|
||||
+ try {
|
||||
+ itr.next().getValue().c();
|
||||
+ itr.next().getValue().close();
|
||||
+ } catch (IOException ioexception) {
|
||||
+ ioexception.printStackTrace();
|
||||
+ ServerInternalException.reportInternalException(ioexception);
|
||||
@@ -74,6 +72,6 @@ index 2217adf99..c0ab543b9 100644
|
||||
+ // Paper End
|
||||
+
|
||||
public static synchronized void a() {
|
||||
Iterator iterator = RegionFileCache.a.values().iterator();
|
||||
Iterator iterator = RegionFileCache.cache.values().iterator();
|
||||
|
||||
--
|
||||
Reference in New Issue
Block a user