diff --git a/Spigot-Server-Patches/0448-Improved-Watchdog-Support.patch b/Spigot-Server-Patches/0448-Improved-Watchdog-Support.patch index ece2bbb42f..28af7ad00f 100644 --- a/Spigot-Server-Patches/0448-Improved-Watchdog-Support.patch +++ b/Spigot-Server-Patches/0448-Improved-Watchdog-Support.patch @@ -331,7 +331,7 @@ index b1cf9fac28031b7f8051a0d1d5d7ce63b06d5f2d..3a46076a125bbfa19ca8a22dc5ab71fd @Override diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index 438e86595760be233e89c49224963e5e8ce335e3..43a763746f6eb72ae93c9b376e458edf6d86be36 100644 +index 438e86595760be233e89c49224963e5e8ce335e3..894552adf119037e97c7de27d783920db580f62b 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -150,6 +150,37 @@ public class Main { @@ -372,7 +372,7 @@ index 438e86595760be233e89c49224963e5e8ce335e3..43a763746f6eb72ae93c9b376e458edf try { options = parser.parse(args); } catch (joptsimple.OptionException ex) { -@@ -245,8 +276,62 @@ public class Main { +@@ -245,8 +276,63 @@ public class Main { } catch (Throwable t) { t.printStackTrace(); } @@ -412,6 +412,7 @@ index 438e86595760be233e89c49224963e5e8ce335e3..43a763746f6eb72ae93c9b376e458edf + tryPreloadClass("org.slf4j.helpers.BasicMarker"); + tryPreloadClass("org.slf4j.helpers.Util"); + tryPreloadClass("com.destroystokyo.paper.event.player.PlayerConnectionCloseEvent"); ++ tryPreloadClass("com.destroystokyo.paper.event.entity.EntityRemoveFromWorldEvent"); + // Minecraft, seen during saving + tryPreloadClass("net.minecraft.server.LightEngineLayerEventListener$Void"); + tryPreloadClass("net.minecraft.server.LightEngineLayerEventListener"); diff --git a/Spigot-Server-Patches/0524-Fix-Per-World-Difficulty-Remembering-Difficulty.patch b/Spigot-Server-Patches/0524-Fix-Per-World-Difficulty-Remembering-Difficulty.patch new file mode 100644 index 0000000000..dd71609645 --- /dev/null +++ b/Spigot-Server-Patches/0524-Fix-Per-World-Difficulty-Remembering-Difficulty.patch @@ -0,0 +1,77 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Aikar +Date: Sun, 28 Jun 2020 03:59:10 -0400 +Subject: [PATCH] Fix Per World Difficulty / Remembering Difficulty + +Fixes per world difficulty with /difficulty command and also +makes it so that the server keeps the last difficulty used instead +of restoring the server.properties every single load. + +diff --git a/src/main/java/net/minecraft/server/CommandDifficulty.java b/src/main/java/net/minecraft/server/CommandDifficulty.java +index bc71070c670d1a64c60b9f19711a5e8a50ace56e..9efc743e028650ccc9cda5a2c9deb1836253b91d 100644 +--- a/src/main/java/net/minecraft/server/CommandDifficulty.java ++++ b/src/main/java/net/minecraft/server/CommandDifficulty.java +@@ -36,10 +36,11 @@ public class CommandDifficulty { + public static int a(CommandListenerWrapper commandlistenerwrapper, EnumDifficulty enumdifficulty) throws CommandSyntaxException { + MinecraftServer minecraftserver = commandlistenerwrapper.getServer(); + +- if (minecraftserver.getSaveData().getDifficulty() == enumdifficulty) { ++ WorldServer world = commandlistenerwrapper.getWorld(); // Paper ++ if (world.worldDataServer.getDifficulty() == enumdifficulty) { // Paper + throw CommandDifficulty.a.create(enumdifficulty.c()); + } else { +- minecraftserver.a(enumdifficulty, true); ++ minecraftserver.a(world, enumdifficulty, true); // Paper + commandlistenerwrapper.sendMessage(new ChatMessage("commands.difficulty.success", new Object[]{enumdifficulty.b()}), true); + return 0; + } +diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java +index 4c561181a977fd0244325880bb6a8cd6a54dcacc..8b2755a3b95e472e884976195d1d3551fc260e39 100644 +--- a/src/main/java/net/minecraft/server/DedicatedServer.java ++++ b/src/main/java/net/minecraft/server/DedicatedServer.java +@@ -327,7 +327,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer + + @Override + public void updateWorldSettings() { +- this.a(this.getDedicatedServerProperties().difficulty, true); ++ //this.a(this.getDedicatedServerProperties().difficulty, true); // Paper - Don't overwrite level.dat's difficulty, keep current + } + + @Override +diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java +index b474f45b6d551e45f8894b3971baade33b6ccd0f..5c862de2f240a241153d90a01042664b4f05cb91 100644 +--- a/src/main/java/net/minecraft/server/MinecraftServer.java ++++ b/src/main/java/net/minecraft/server/MinecraftServer.java +@@ -1519,11 +1519,14 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant