PaperMC/paper-server/patches/sources/net/minecraft/server/commands/ReloadCommand.java.patch
Nassim Jahnke 7caf863b52
Small diff cleanups from patch updating
And remove a dumb log change in PacketEncoder
2024-12-17 16:50:59 +01:00

28 lines
1.6 KiB
Diff

--- 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<String> 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 server) {
+ PackRepository packRepository = server.getPackRepository();
+ WorldData worldData = server.getWorldData();
+ Collection<String> selectedIds = packRepository.getSelectedIds();
+ Collection<String> collection = discoverNewPacks(packRepository, worldData, selectedIds);
+ server.reloadResources(collection, io.papermc.paper.event.server.ServerResourcesReloadedEvent.Cause.PLUGIN); // Paper - Add ServerResourcesReloadedEvent
+ }
+ // CraftBukkit end
public static void register(CommandDispatcher<CommandSourceStack> dispatcher) {
dispatcher.register(Commands.literal("reload").requires(source -> source.hasPermission(2)).executes(context -> {