Paper/patch-remap/mache-spigotflower-stripped/net/minecraft/server/commands/ReloadCommand.java.patch

26 lines
1.5 KiB
Diff

--- a/net/minecraft/server/commands/ReloadCommand.java
+++ b/net/minecraft/server/commands/ReloadCommand.java
@@ -45,9 +44,19 @@
return collection1;
}
- public static void register(CommandDispatcher<CommandSourceStack> commanddispatcher) {
- commanddispatcher.register((LiteralArgumentBuilder) ((LiteralArgumentBuilder) Commands.literal("reload").requires((commandsourcestack) -> {
- return commandsourcestack.hasPermission(2);
+ // CraftBukkit start
+ public static void reload(MinecraftServer minecraftserver) {
+ PackRepository resourcepackrepository = minecraftserver.getPackRepository();
+ WorldData savedata = minecraftserver.getWorldData();
+ Collection<String> collection = resourcepackrepository.getSelectedIds();
+ Collection<String> collection1 = discoverNewPacks(resourcepackrepository, savedata, collection);
+ minecraftserver.reloadResources(collection1);
+ }
+ // 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);
})).executes((commandcontext) -> {
CommandSourceStack commandsourcestack = (CommandSourceStack) commandcontext.getSource();
MinecraftServer minecraftserver = commandsourcestack.getServer();