--- a/net/minecraft/server/commands/ReloadCommand.java +++ b/net/minecraft/server/commands/ReloadCommand.java @@ -16,7 +_,7 @@ private static final Logger LOGGER = LogUtils.getLogger(); public static void reloadPacks(Collection selectedIds, CommandSourceStack source) { - source.getServer().reloadResources(selectedIds).exceptionally(throwable -> { + source.getServer().reloadResources(selectedIds, io.papermc.paper.event.server.ServerResourcesReloadedEvent.Cause.COMMAND).exceptionally(throwable -> { // Paper - Add ServerResourcesReloadedEvent LOGGER.warn("Failed to execute reload", throwable); source.sendFailure(Component.translatable("commands.reload.failure")); return null; @@ -36,6 +_,16 @@ return list; } + + // CraftBukkit start + public static void reload(MinecraftServer minecraftserver) { + PackRepository resourcepackrepository = minecraftserver.getPackRepository(); + WorldData savedata = minecraftserver.getWorldData(); + Collection collection = resourcepackrepository.getSelectedIds(); + Collection 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 dispatcher) { dispatcher.register(Commands.literal("reload").requires(source -> source.hasPermission(2)).executes(context -> {