Ensure VillagerTrades doesn't load async - fixes #3495

In rare cases, this class could potentially be loaded from
the chunk threads causing it to initialize async and cause errors.

This would then break the server and chunk saving.

So ensure its loaded at start of server to avoid this.
This commit is contained in:
Aikar 2020-06-03 00:00:17 -04:00
parent 5201efc608
commit 5be9ce08a4

View File

@ -2960,6 +2960,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
public String getServerIp() {
@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
dedicatedserver.setEraseCache(true);
}
+ Class.forName("net.minecraft.server.VillagerTrades");// Paper - load this sync so it won't fail later async
dedicatedserver.serverThread.setPriority(Thread.NORM_PRIORITY+2); // Paper - boost priority
dedicatedserver.serverThread.start();
// CraftBukkit end
diff --git a/src/main/java/net/minecraft/server/NextTickListEntry.java b/src/main/java/net/minecraft/server/NextTickListEntry.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/NextTickListEntry.java