aboutsummaryrefslogtreecommitdiffhomepage
path: root/paper-server/patches/unapplied/net/minecraft/server/commands/ReloadCommand.java.patch
diff options
context:
space:
mode:
Diffstat (limited to 'paper-server/patches/unapplied/net/minecraft/server/commands/ReloadCommand.java.patch')
-rw-r--r--paper-server/patches/unapplied/net/minecraft/server/commands/ReloadCommand.java.patch28
1 files changed, 28 insertions, 0 deletions
diff --git a/paper-server/patches/unapplied/net/minecraft/server/commands/ReloadCommand.java.patch b/paper-server/patches/unapplied/net/minecraft/server/commands/ReloadCommand.java.patch
new file mode 100644
index 0000000000..f0b9cdfcce
--- /dev/null
+++ b/paper-server/patches/unapplied/net/minecraft/server/commands/ReloadCommand.java.patch
@@ -0,0 +1,28 @@
+--- a/net/minecraft/server/commands/ReloadCommand.java
++++ b/net/minecraft/server/commands/ReloadCommand.java
+@@ -20,7 +20,7 @@
+ public ReloadCommand() {}
+
+ public static void reloadPacks(Collection<String> dataPacks, CommandSourceStack source) {
+- source.getServer().reloadResources(dataPacks).exceptionally((throwable) -> {
++ source.getServer().reloadResources(dataPacks, io.papermc.paper.event.server.ServerResourcesReloadedEvent.Cause.COMMAND).exceptionally((throwable) -> { // Paper - Add ServerResourcesReloadedEvent
+ ReloadCommand.LOGGER.warn("Failed to execute reload", throwable);
+ source.sendFailure(Component.translatable("commands.reload.failure"));
+ return null;
+@@ -44,6 +44,16 @@
+ return collection1;
+ }
+
++ // CraftBukkit start
++ public static void reload(MinecraftServer minecraftserver) {
++ PackRepository resourcepackrepository = minecraftserver.getPackRepository();
++ WorldData savedata = minecraftserver.getWorldData();
++ Collection<String> collection = resourcepackrepository.getSelectedIds();
++ Collection<String> collection1 = ReloadCommand.discoverNewPacks(resourcepackrepository, savedata, collection);
++ minecraftserver.reloadResources(collection1, io.papermc.paper.event.server.ServerResourcesReloadedEvent.Cause.PLUGIN); // Paper - Add ServerResourcesReloadedEvent
++ }
++ // CraftBukkit end
++
+ public static void register(CommandDispatcher<CommandSourceStack> dispatcher) {
+ dispatcher.register((LiteralArgumentBuilder) ((LiteralArgumentBuilder) net.minecraft.commands.Commands.literal("reload").requires((commandlistenerwrapper) -> {
+ return commandlistenerwrapper.hasPermission(2);