More 1.14 patches
now we can rebase
This commit is contained in:
@@ -14,54 +14,47 @@ 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 8d51af2867..e86d382c8d 100644
|
||||
index 47a4ea9985..62081349f1 100644
|
||||
--- a/src/main/java/net/minecraft/server/WorldPersistentData.java
|
||||
+++ b/src/main/java/net/minecraft/server/WorldPersistentData.java
|
||||
@@ -0,0 +0,0 @@ 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");
|
||||
@@ -0,0 +0,0 @@ public class WorldPersistentData {
|
||||
|
||||
@Nullable
|
||||
public <T extends PersistentBase> T a(Function<String, T> function, String s) {
|
||||
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
|
||||
PersistentBase persistentbase = (PersistentBase) this.data.get(s);
|
||||
|
||||
if (persistentbase == null && this.e != null) {
|
||||
if (persistentbase == null) {
|
||||
@@ -0,0 +0,0 @@ public class WorldPersistentData {
|
||||
persistentbase = function.apply(s); // Paper - decompile fix
|
||||
persistentbase.a(a(this.e, this.b, s, 1631).getCompound("data"));
|
||||
|
||||
persistentbase.a(nbttagcompound.getCompound("data"));
|
||||
this.data.put(s, persistentbase);
|
||||
- }
|
||||
+ } else this.data.put(s, NO_RESULT); // Paper
|
||||
} catch (Exception exception) {
|
||||
WorldPersistentData.a.error("Error loading saved data: {}", s, exception);
|
||||
WorldPersistentData.LOGGER.error("Error loading saved data: {}", s, exception);
|
||||
}
|
||||
}
|
||||
|
||||
- return persistentbase;
|
||||
+ return persistentbase == NO_RESULT ? null : persistentbase; // Paper
|
||||
- return (T) persistentbase; // Paper - decompile fix
|
||||
+ return (T) persistentbase == NO_RESULT ? null : (T) persistentbase; // Paper - decompile fix // Paper
|
||||
}
|
||||
+ private static final PersistentBase NO_RESULT = new ForcedChunk("chunks"); // Paper
|
||||
|
||||
public void a(String s, PersistentBase persistentbase) {
|
||||
this.data.put(s, persistentbase);
|
||||
public void a(PersistentBase persistentbase) {
|
||||
@@ -0,0 +0,0 @@ public class WorldPersistentData {
|
||||
}
|
||||
|
||||
public static NBTTagCompound a(IDataManager idatamanager, DimensionManager dimensionmanager, String s, int i) throws IOException {
|
||||
public NBTTagCompound a(String s, int i) throws IOException {
|
||||
+ if ("Mineshaft".equals(s) || "Mineshaft_index".equals(s)) return new NBTTagCompound(); // Paper
|
||||
File file = idatamanager.getDataFile(dimensionmanager, s);
|
||||
FileInputStream fileinputstream = new FileInputStream(file);
|
||||
File file = this.a(s);
|
||||
PushbackInputStream pushbackinputstream = new PushbackInputStream(new FileInputStream(file), 2);
|
||||
Throwable throwable = null;
|
||||
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
index 5c2421ac38..ee071ba2f6 100644
|
||||
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
@@ -0,0 +0,0 @@ public class WorldServer extends World implements IAsyncTaskHandler {
|
||||
this.P();
|
||||
this.Q();
|
||||
this.getWorldBorder().a(minecraftserver.au());
|
||||
- MCUtil.scheduleAsyncTask(() -> this.getChunkProvider().chunkLoader.getPersistentStructureLegacy(dimensionmanager, worldMaps)); // Paper
|
||||
+ MCUtil.scheduleAsyncTask(() -> this.getChunkProvider().chunkLoader.getPersistentStructureLegacy(worldProvider.getDimensionManager(), worldMaps)); // Paper
|
||||
}
|
||||
|
||||
public WorldServer i_() {
|
||||
--
|
||||
Reference in New Issue
Block a user