2021-06-14 21:58:32 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Jake Potrebic <jake.m.potrebic@gmail.com>
|
|
|
|
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
|
2024-01-19 22:13:42 +01:00
|
|
|
index 569b645c6d795401c974069d0be7195590cd354a..7b4ee914fb7681760446f864cf3f2f8cab180dd6 100644
|
2021-06-14 21:58:32 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/commands/ScheduleCommand.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/commands/ScheduleCommand.java
|
2023-12-06 04:00:14 +01:00
|
|
|
@@ -30,7 +30,7 @@ public class ScheduleCommand {
|
|
|
|
return Component.translatableEscape("commands.schedule.cleared.failure", object);
|
2021-06-14 21:58:32 +02:00
|
|
|
});
|
2021-07-24 04:33:05 +02:00
|
|
|
private static final SuggestionProvider<CommandSourceStack> SUGGEST_SCHEDULE = (commandcontext, suggestionsbuilder) -> {
|
|
|
|
- return SharedSuggestionProvider.suggest((Iterable) ((CommandSourceStack) commandcontext.getSource()).getServer().getWorldData().overworldData().getScheduledEvents().getEventsIds(), suggestionsbuilder);
|
2024-01-19 22:13:42 +01:00
|
|
|
+ return SharedSuggestionProvider.suggest((Iterable) ((net.minecraft.commands.CommandSourceStack) commandcontext.getSource()).getLevel().serverLevelData.getScheduledEvents().getEventsIds(), suggestionsbuilder); // Paper - Make schedule command per-world
|
2021-06-14 21:58:32 +02:00
|
|
|
};
|
|
|
|
|
2021-07-24 04:33:05 +02:00
|
|
|
public ScheduleCommand() {}
|
2023-12-06 04:00:14 +01:00
|
|
|
@@ -85,7 +85,7 @@ public class ScheduleCommand {
|
2021-06-14 21:58:32 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
private static int remove(CommandSourceStack source, String eventName) throws CommandSyntaxException {
|
|
|
|
- int i = source.getServer().getWorldData().overworldData().getScheduledEvents().remove(eventName);
|
2024-01-19 22:13:42 +01:00
|
|
|
+ int i = source.getLevel().serverLevelData.getScheduledEvents().remove(eventName); // Paper - Make schedule command per-world
|
2021-07-24 04:33:05 +02:00
|
|
|
|
2021-06-14 21:58:32 +02:00
|
|
|
if (i == 0) {
|
2021-07-24 04:33:05 +02:00
|
|
|
throw ScheduleCommand.ERROR_CANT_REMOVE.create(eventName);
|