--- a/net/minecraft/server/commands/ScheduleCommand.java +++ b/net/minecraft/server/commands/ScheduleCommand.java @@ -33,7 +33,7 @@ }); private static final SimpleCommandExceptionType ERROR_MACRO = new SimpleCommandExceptionType(Component.translatableEscape("commands.schedule.macro")); private static final SuggestionProvider 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() {} @@ -58,7 +58,7 @@ } else { long j = source.getLevel().getGameTime() + (long) time; ResourceLocation minecraftkey = (ResourceLocation) function.getFirst(); - TimerQueue customfunctioncallbacktimerqueue = source.getServer().getWorldData().overworldData().getScheduledEvents(); + TimerQueue customfunctioncallbacktimerqueue = source.getLevel().serverLevelData.overworldData().getScheduledEvents(); // CraftBukkit - SPIGOT-6667: Use world specific function timer Optional> optional = ((Either) function.getSecond()).left(); String s; @@ -93,7 +93,7 @@ } 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);