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: 3dc4cdcd Update to Minecraft 1.14.3-pre4 88b25a8c SPIGOT-5098: Add a method to allow colored sign changes 6d913552 Update to Minecraft 1.14.3-pre4 CraftBukkit Changes: f1f33559 Update to Minecraft 1.14.3 8a3d3f49 SPIGOT-5098: Add a method to allow colored sign changes 533290e2 SPIGOT-5100: Console warning from pig zombie targeting 6dde4b9f SPIGOT-5094: Allow opening merchant for wandering traders and hide the xp bar for custom merchants 9af90077 SPIGOT-5097: Bukkit.clearRecipes() no longer working 38fa220f Fix setting game rules via the API fe3930ce Update to Minecraft 1.14.3-pre4 da071ec5 Remove outdated build delay. Spigot Changes: 4d2f30f1 Update to Minecraft 1.14.3 f16400e3 Update to Minecraft 1.14.3-pre4
67 lines
2.7 KiB
Diff
67 lines
2.7 KiB
Diff
From a576811cfbd84b86003b6d81569f8e4399447a10 Mon Sep 17 00:00:00 2001
|
|
From: Aikar <aikar@aikar.co>
|
|
Date: Fri, 29 Mar 2019 01:25:11 -0400
|
|
Subject: [PATCH] Optimize Persistent Data Loading
|
|
|
|
removes Mineshaft loading legacy as we had pre 1.13.2 to avoid managing
|
|
that very large data file from legacy systems.
|
|
|
|
Previous to 1.13.2 these data files were never loaded to begin with, so they
|
|
effectively do not contain valid/relevant data.
|
|
|
|
These files take a long time to convert on large worlds and crashes the server.
|
|
|
|
Additionally, cache the result of a file being missing so we don't keep spam checking it.
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/WorldPersistentData.java b/src/main/java/net/minecraft/server/WorldPersistentData.java
|
|
index 00e9a17355..153809432c 100644
|
|
--- a/src/main/java/net/minecraft/server/WorldPersistentData.java
|
|
+++ b/src/main/java/net/minecraft/server/WorldPersistentData.java
|
|
@@ -26,6 +26,7 @@ public class WorldPersistentData {
|
|
this.c = datafixer;
|
|
this.d = file;
|
|
}
|
|
+ private static final PersistentBase NO_RESULT = new ForcedChunk(); // Paper
|
|
|
|
private File a(String s) {
|
|
return new File(this.d, s + ".dat");
|
|
@@ -46,14 +47,17 @@ public class WorldPersistentData {
|
|
|
|
@Nullable
|
|
public <T extends PersistentBase> T b(Supplier<T> supplier, String s) {
|
|
+ if ("Mineshaft_index".equals(s) || "Mineshaft".equals(s)) return null; // Paper - mineshaft is useless data
|
|
T persistentbase = (T) this.data.get(s); // Paper - decompile fix
|
|
|
|
if (persistentbase == null && !this.data.containsKey(s)) {
|
|
persistentbase = this.c(supplier, s);
|
|
this.data.put(s, persistentbase);
|
|
+ } else { // Paper
|
|
+ this.data.put(s, NO_RESULT); // Paper
|
|
}
|
|
|
|
- return persistentbase;
|
|
+ return persistentbase == NO_RESULT ? null : persistentbase; // Paper
|
|
}
|
|
|
|
@Nullable
|
|
@@ -66,7 +70,7 @@ public class WorldPersistentData {
|
|
NBTTagCompound nbttagcompound = this.a(s, SharedConstants.a().getWorldVersion());
|
|
|
|
t0.a(nbttagcompound.getCompound("data"));
|
|
- return t0;
|
|
+ return t0 == NO_RESULT ? null : t0; // Paper
|
|
}
|
|
} catch (Exception exception) {
|
|
WorldPersistentData.LOGGER.error("Error loading saved data: {}", s, exception);
|
|
@@ -80,6 +84,7 @@ public class WorldPersistentData {
|
|
}
|
|
|
|
public NBTTagCompound a(String s, int i) throws IOException {
|
|
+ if ("Mineshaft".equals(s) || "Mineshaft_index".equals(s)) return new NBTTagCompound(); // Paper
|
|
File file = this.a(s);
|
|
PushbackInputStream pushbackinputstream = new PushbackInputStream(new FileInputStream(file), 2);
|
|
Throwable throwable = null;
|
|
--
|
|
2.22.0
|
|
|