From 3052fe18f60fc422b0b5ed50c774e1c6c8642dbe Mon Sep 17 00:00:00 2001 From: Mariell Hoversholm <proximyst@proximyst.com> Date: Tue, 16 Mar 2021 17:47:15 +0100 Subject: [PATCH] Fix class preloading --- .../Asynchronous-chunk-IO-and-loading.patch | 10 +++++++++- .../Improved-Watchdog-Support.patch | 15 ++++++++++++--- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/Spigot-Server-Patches/Asynchronous-chunk-IO-and-loading.patch b/Spigot-Server-Patches/Asynchronous-chunk-IO-and-loading.patch index e4032b2ad8..5c8db02554 100644 --- a/Spigot-Server-Patches/Asynchronous-chunk-IO-and-loading.patch +++ b/Spigot-Server-Patches/Asynchronous-chunk-IO-and-loading.patch @@ -2331,11 +2331,19 @@ diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/mi index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/Main.java +++ b/src/main/java/net/minecraft/server/Main.java +@@ -0,0 +0,0 @@ import net.minecraft.server.players.UserCache; + import net.minecraft.util.MathHelper; + import net.minecraft.util.datafix.DataConverterRegistry; + import net.minecraft.util.worldupdate.WorldUpgrader; ++import net.minecraft.world.entity.npc.VillagerTrades; + import net.minecraft.world.level.DataPackConfiguration; + import net.minecraft.world.level.GameRules; + import net.minecraft.world.level.World; @@ -0,0 +0,0 @@ public class Main { convertable_conversionsession.a((IRegistryCustom) iregistrycustom_dimension, (SaveData) object); */ -+ Class.forName("net.minecraft.server.VillagerTrades");// Paper - load this sync so it won't fail later async ++ Class.forName(VillagerTrades.class.getSimpleName());// Paper - load this sync so it won't fail later async final DedicatedServer dedicatedserver = (DedicatedServer) MinecraftServer.a((thread) -> { DedicatedServer dedicatedserver1 = new DedicatedServer(optionset, datapackconfiguration1, thread, iregistrycustom_dimension, convertable_conversionsession, resourcepackrepository, datapackresources, null, dedicatedserversettings, DataConverterRegistry.a(), minecraftsessionservice, gameprofilerepository, usercache, WorldLoadListenerLogger::new); diff --git a/Spigot-Server-Patches/Improved-Watchdog-Support.patch b/Spigot-Server-Patches/Improved-Watchdog-Support.patch index 34cd7273c6..cf17296f71 100644 --- a/Spigot-Server-Patches/Improved-Watchdog-Support.patch +++ b/Spigot-Server-Patches/Improved-Watchdog-Support.patch @@ -361,6 +361,15 @@ diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/ index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java +@@ -0,0 +0,0 @@ import java.util.logging.Level; + import java.util.logging.Logger; + import joptsimple.OptionParser; + import joptsimple.OptionSet; ++import net.minecraft.util.ExceptionSuppressor; ++import net.minecraft.world.level.lighting.LightEngineLayerEventListener; + import net.minecrell.terminalconsole.TerminalConsoleAppender; // Paper + + public class Main { @@ -0,0 +0,0 @@ public class Main { OptionSet options = null; @@ -442,9 +451,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + tryPreloadClass("com.destroystokyo.paper.event.player.PlayerConnectionCloseEvent"); + tryPreloadClass("com.destroystokyo.paper.event.entity.EntityRemoveFromWorldEvent"); + // Minecraft, seen during saving -+ tryPreloadClass("net.minecraft.world.level.lighting.LightEngineLayerEventListener$Void"); -+ tryPreloadClass("net.minecraft.world.level.lighting.LightEngineLayerEventListener"); -+ tryPreloadClass("net.minecraft.util.ExceptionSuppressor"); ++ tryPreloadClass(LightEngineLayerEventListener.Void.class.getSimpleName()); ++ tryPreloadClass(LightEngineLayerEventListener.class.getSimpleName()); ++ tryPreloadClass(ExceptionSuppressor.class.getSimpleName()); + // Paper end + } + }