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
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/commands/ScheduleCommand.java
+++ b/src/main/java/net/minecraft/server/commands/ScheduleCommand.java
@@ -0,0 +0,0 @@ public class ScheduleCommand {
         return new TranslatableComponent("commands.schedule.cleared.failure", eventName);
     });
     private static final SuggestionProvider<CommandSourceStack> SUGGEST_SCHEDULE = (context, builder) -> {
-        return SharedSuggestionProvider.suggest(context.getSource().getServer().getWorldData().overworldData().getScheduledEvents().getEventsIds(), builder);
+        return SharedSuggestionProvider.suggest(context.getSource().getLevel().serverLevelData.overworldData().getScheduledEvents().getEventsIds(), builder); // Paper
     };
 
     public static void register(CommandDispatcher<CommandSourceStack> dispatcher) {
@@ -0,0 +0,0 @@ public class ScheduleCommand {
         } else {
             long l = source.getLevel().getGameTime() + (long)time;
             ResourceLocation resourceLocation = function.getFirst();
-            TimerQueue<MinecraftServer> timerQueue = source.getServer().getWorldData().overworldData().getScheduledEvents();
+            TimerQueue<MinecraftServer> timerQueue = source.getLevel().serverLevelData.getScheduledEvents(); // Paper
             function.getSecond().ifLeft((functionx) -> {
                 String string = resourceLocation.toString();
                 if (replace) {
@@ -0,0 +0,0 @@ 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
         if (i == 0) {
             throw ERROR_CANT_REMOVE.create(eventName);
         } else {
