mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-07 19:12:22 +01:00
30 lines
1.9 KiB
Diff
30 lines
1.9 KiB
Diff
|
--- a/net/minecraft/server/commands/ScheduleCommand.java
|
||
|
+++ b/net/minecraft/server/commands/ScheduleCommand.java
|
||
|
@@ -32,7 +_,7 @@
|
||
|
);
|
||
|
private static final SimpleCommandExceptionType ERROR_MACRO = new SimpleCommandExceptionType(Component.translatableEscape("commands.schedule.macro"));
|
||
|
private static final SuggestionProvider<CommandSourceStack> SUGGEST_SCHEDULE = (context, builder) -> SharedSuggestionProvider.suggest(
|
||
|
- context.getSource().getServer().getWorldData().overworldData().getScheduledEvents().getEventsIds(), builder
|
||
|
+ context.getSource().getLevel().serverLevelData.getScheduledEvents().getEventsIds(), builder // Paper - Make schedule command per-world
|
||
|
);
|
||
|
|
||
|
public static void register(CommandDispatcher<CommandSourceStack> dispatcher) {
|
||
|
@@ -101,7 +_,7 @@
|
||
|
} else {
|
||
|
long l = source.getLevel().getGameTime() + time;
|
||
|
ResourceLocation resourceLocation = function.getFirst();
|
||
|
- TimerQueue<MinecraftServer> scheduledEvents = source.getServer().getWorldData().overworldData().getScheduledEvents();
|
||
|
+ TimerQueue<MinecraftServer> scheduledEvents = source.getLevel().serverLevelData.overworldData().getScheduledEvents(); // CraftBukkit - SPIGOT-6667: Use world specific function timer
|
||
|
Optional<CommandFunction<CommandSourceStack>> optional = function.getSecond().left();
|
||
|
if (optional.isPresent()) {
|
||
|
if (optional.get() instanceof MacroFunction) {
|
||
|
@@ -132,7 +_,7 @@
|
||
|
}
|
||
|
|
||
|
private static int remove(CommandSourceStack source, String function) throws CommandSyntaxException {
|
||
|
- int i = source.getServer().getWorldData().overworldData().getScheduledEvents().remove(function);
|
||
|
+ int i = source.getLevel().serverLevelData.overworldData().getScheduledEvents().remove(function); // Paper - Make schedule command per-world
|
||
|
if (i == 0) {
|
||
|
throw ERROR_CANT_REMOVE.create(function);
|
||
|
} else {
|