PaperMC/patches/server-remapped/Make-schedule-command-per-world.patch
MiniDigger | Martin 95d25d98e8 Move patches around
2021-06-11 14:02:28 +02:00

37 lines
2.5 KiB
Diff

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", new Object[]{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) ((CommandSourceStack) commandcontext.getSource()).getLevel().worldDataServer.overworldData().getScheduledEvents().getEventsIds(), suggestionsbuilder); // Paper
};
public static void register(CommandDispatcher<CommandSourceStack> dispatcher) {
@@ -0,0 +0,0 @@ public class ScheduleCommand {
} else {
long j = source.getLevel().getGameTime() + (long) i;
ResourceLocation minecraftkey = (ResourceLocation) pair.getFirst();
- TimerQueue<MinecraftServer> customfunctioncallbacktimerqueue = source.getServer().getWorldData().overworldData().getScheduledEvents();
+ TimerQueue<MinecraftServer> customfunctioncallbacktimerqueue = source.getLevel().worldDataServer.overworldData().getScheduledEvents(); // Paper
((Either) pair.getSecond()).ifLeft((customfunction) -> {
String s = minecraftkey.toString();
@@ -0,0 +0,0 @@ public class ScheduleCommand {
}
private static int remove(CommandSourceStack commandlistenerwrapper, String s) throws CommandSyntaxException {
- int i = commandlistenerwrapper.getServer().getWorldData().overworldData().getScheduledEvents().remove(s);
+ int i = commandlistenerwrapper.getLevel().worldDataServer.overworldData().getScheduledEvents().remove(s); // Paper
if (i == 0) {
throw ScheduleCommand.ERROR_CANT_REMOVE.create(s);