summaryrefslogtreecommitdiffhomepage
path: root/patches/server/0486-Make-schedule-command-per-world.patch
diff options
context:
space:
mode:
authorJake Potrebic <[email protected]>2024-05-29 13:58:57 -0700
committerGitHub <[email protected]>2024-05-29 22:58:57 +0200
commita31dc90741ed9c121a13a3c124c9ebf5bafd0da7 (patch)
tree81963bd94fe7772ee08bd21710230de21b6b25da /patches/server/0486-Make-schedule-command-per-world.patch
parented85aac53cfd93d29fa24e6071dbdddd0e49624b (diff)
downloadPaper-a31dc90741ed9c121a13a3c124c9ebf5bafd0da7.tar.gz
Paper-a31dc90741ed9c121a13a3c124c9ebf5bafd0da7.zip
Several fixes and new api for experience merging/stacking (#9242)
Diffstat (limited to 'patches/server/0486-Make-schedule-command-per-world.patch')
-rw-r--r--patches/server/0486-Make-schedule-command-per-world.patch28
1 files changed, 28 insertions, 0 deletions
diff --git a/patches/server/0486-Make-schedule-command-per-world.patch b/patches/server/0486-Make-schedule-command-per-world.patch
new file mode 100644
index 0000000000..2d8f63ad1e
--- /dev/null
+++ b/patches/server/0486-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 f2d1430d714debc9e9b53eef0cbcda0d8cdcd459..d090f94a9a8a314df01e83a031dd18d5c6f1caf9 100644
+--- a/src/main/java/net/minecraft/server/commands/ScheduleCommand.java
++++ b/src/main/java/net/minecraft/server/commands/ScheduleCommand.java
+@@ -30,7 +30,7 @@ public class ScheduleCommand {
+ return Component.translatableEscape("commands.schedule.cleared.failure", object);
+ });
+ 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() {}
+@@ -85,7 +85,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);