mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-06 10:44:39 +01:00
7caf863b52
And remove a dumb log change in PacketEncoder
28 lines
1.6 KiB
Diff
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 -> {
|