diff options
author | Nassim Jahnke <[email protected]> | 2024-12-03 17:58:41 +0100 |
---|---|---|
committer | Nassim Jahnke <[email protected]> | 2024-12-03 17:58:41 +0100 |
commit | c0a3d51ab35930e410fcd9752ceaff6c3f581c24 (patch) | |
tree | f53076a8b0787d2f544f73f468df94619e5eb1a5 /patches/unapplied/server/0469-Make-schedule-command-per-world.patch | |
parent | da7138233f6392e791d790d1c3407414c855f9c2 (diff) | |
download | Paper-c0a3d51ab35930e410fcd9752ceaff6c3f581c24.tar.gz Paper-c0a3d51ab35930e410fcd9752ceaff6c3f581c24.zip |
Start update, apply API patches
Diffstat (limited to 'patches/unapplied/server/0469-Make-schedule-command-per-world.patch')
-rw-r--r-- | patches/unapplied/server/0469-Make-schedule-command-per-world.patch | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/patches/unapplied/server/0469-Make-schedule-command-per-world.patch b/patches/unapplied/server/0469-Make-schedule-command-per-world.patch new file mode 100644 index 0000000000..3ac2f8e3f4 --- /dev/null +++ b/patches/unapplied/server/0469-Make-schedule-command-per-world.patch @@ -0,0 +1,28 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jake Potrebic <[email protected]> +Date: Mon, 4 Jan 2021 19:52:44 -0800 +Subject: [PATCH] Make schedule command per-world + + +diff --git a/src/main/java/net/minecraft/server/commands/ScheduleCommand.java b/src/main/java/net/minecraft/server/commands/ScheduleCommand.java +index 10b059a93762d9711fb4aedff572edfaebcb8264..1090759025969c04267de8b96ad045b1da0cb246 100644 +--- a/src/main/java/net/minecraft/server/commands/ScheduleCommand.java ++++ b/src/main/java/net/minecraft/server/commands/ScheduleCommand.java +@@ -33,7 +33,7 @@ public class ScheduleCommand { + }); + private static final SimpleCommandExceptionType ERROR_MACRO = new SimpleCommandExceptionType(Component.translatableEscape("commands.schedule.macro")); + private static final SuggestionProvider<CommandSourceStack> SUGGEST_SCHEDULE = (commandcontext, suggestionsbuilder) -> { +- return SharedSuggestionProvider.suggest((Iterable) ((CommandSourceStack) commandcontext.getSource()).getServer().getWorldData().overworldData().getScheduledEvents().getEventsIds(), suggestionsbuilder); ++ return SharedSuggestionProvider.suggest((Iterable) ((net.minecraft.commands.CommandSourceStack) commandcontext.getSource()).getLevel().serverLevelData.getScheduledEvents().getEventsIds(), suggestionsbuilder); // Paper - Make schedule command per-world + }; + + public ScheduleCommand() {} +@@ -93,7 +93,7 @@ public class ScheduleCommand { + } + + private static int remove(CommandSourceStack source, String eventName) throws CommandSyntaxException { +- int i = source.getServer().getWorldData().overworldData().getScheduledEvents().remove(eventName); ++ int i = source.getLevel().serverLevelData.getScheduledEvents().remove(eventName); // Paper - Make schedule command per-world + + if (i == 0) { + throw ScheduleCommand.ERROR_CANT_REMOVE.create(eventName); |