diff --git a/nms-patches/MinecraftServer.patch b/nms-patches/MinecraftServer.patch index 551c2ca4db..fee1d6563e 100644 --- a/nms-patches/MinecraftServer.patch +++ b/nms-patches/MinecraftServer.patch @@ -643,7 +643,7 @@ } public CrashReport b(CrashReport crashreport) { -@@ -1217,11 +1472,11 @@ +@@ -1217,16 +1472,17 @@ public CompletableFuture a(Collection collection) { CompletableFuture completablefuture = CompletableFuture.supplyAsync(() -> { @@ -657,7 +657,13 @@ }, this).thenCompose((immutablelist) -> { return DataPackResources.a(immutablelist, this.j() ? CommandDispatcher.ServerType.DEDICATED : CommandDispatcher.ServerType.INTEGRATED, this.h(), this.executorService, this); }).thenAcceptAsync((datapackresources) -> { -@@ -1592,6 +1847,22 @@ + this.dataPackResources.close(); + this.dataPackResources = datapackresources; ++ this.server.syncCommands(); // SPIGOT-5884: Lost on reload + this.resourcePackRepository.a(collection); + this.saveData.a(a(this.resourcePackRepository)); + datapackresources.i(); +@@ -1592,6 +1848,22 @@ } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java index d01f3d600a..aa2dd95694 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -429,7 +429,7 @@ public final class CraftServer implements Server { } } - private void syncCommands() { + public void syncCommands() { // Clear existing commands CommandDispatcher dispatcher = console.dataPackResources.commandDispatcher = new CommandDispatcher();