mirror of
https://github.com/PaperMC/Paper.git
synced 2025-03-13 11:18:23 +01:00
Revert "Optimize Persistent Data loading" (Fixes #2229)
This commit is contained in:
parent
dd553fa4e2
commit
da6d8e9da9
7 changed files with 7 additions and 71 deletions
|
@ -5,7 +5,7 @@ Subject: [PATCH] Fix CB call to changed postToMainThread method
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
index 4e8b8f49c4..a0b644801a 100644
|
||||
index dda8196702..6d6e50313e 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
@@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
||||
|
|
|
@ -18,7 +18,7 @@ index 6aa0ca3959..ed9b5c63f0 100644
|
|||
private final MinecraftServer d;
|
||||
private final java.nio.file.Path e;
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index 78bae25255..1defbd9747 100644
|
||||
index 0acdb527d9..a7a35d6a6f 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
|
|
|
@ -6,7 +6,7 @@ Subject: [PATCH] Fix sounds when item frames are modified (MC-123450)
|
|||
This also fixes the adding sound playing when the item frame direction is changed.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityItemFrame.java b/src/main/java/net/minecraft/server/EntityItemFrame.java
|
||||
index 3ecdd00a12..aac28bfa32 100644
|
||||
index 9eaf57d2c9..50ca7b9d26 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityItemFrame.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityItemFrame.java
|
||||
@@ -0,0 +0,0 @@ public class EntityItemFrame extends EntityHanging {
|
||||
|
@ -19,7 +19,7 @@ index 3ecdd00a12..aac28bfa32 100644
|
|||
}
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftItemFrame.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftItemFrame.java
|
||||
index 70127520a2..712ec431f0 100644
|
||||
index 799036f268..9ad180d946 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftItemFrame.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftItemFrame.java
|
||||
@@ -0,0 +0,0 @@ public class CraftItemFrame extends CraftHanging implements ItemFrame {
|
||||
|
|
|
@ -6,7 +6,7 @@ Subject: [PATCH] MC-114618 - Fix EntityAreaEffectCloud from going negative
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityAreaEffectCloud.java b/src/main/java/net/minecraft/server/EntityAreaEffectCloud.java
|
||||
index 418c638d3..315ba7a22 100644
|
||||
index 70c2820463..8bbbe8505f 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityAreaEffectCloud.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityAreaEffectCloud.java
|
||||
@@ -0,0 +0,0 @@ public class EntityAreaEffectCloud extends Entity {
|
||||
|
|
|
@ -10,7 +10,7 @@ Optimize to check if the captured list even has values in it, and also to
|
|||
just do a get call since the value can never be null.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index 0f04860bc..a9c5ded5b 100644
|
||||
index f1552f23ea..ef080f9571 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
|
|
|
@ -1,64 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 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
|
||||
@@ -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 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
|
||||
@@ -0,0 +0,0 @@ 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);
|
||||
@@ -0,0 +0,0 @@ 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;
|
||||
--
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Show blockstate location if we failed to read it
|
|||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java
|
||||
index 7cb4c3e503..a593882988 100644
|
||||
index 7cb4c3e503..44e0556277 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java
|
||||
@@ -0,0 +0,0 @@ public class CraftBlockEntityState<T extends TileEntity> extends CraftBlockState
|
||||
|
|
Loading…
Add table
Reference in a new issue