geforkt von Mirrors/Paper
20503beee5
Messing with game time sent to the client isn't worth the trouble whenever it may be used by the client now and in the future for such a small issue. Mojang, plz fix
29 Zeilen
1.8 KiB
Diff
29 Zeilen
1.8 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 2c6d5f22ef41601f863b11e2e626621d8047dd14..1eb93353766208f52e385ab445cfb754e42b7f3d 100644
|
|
--- a/src/main/java/net/minecraft/server/commands/ScheduleCommand.java
|
|
+++ b/src/main/java/net/minecraft/server/commands/ScheduleCommand.java
|
|
@@ -31,7 +31,7 @@ public class ScheduleCommand {
|
|
return Component.translatable("commands.schedule.cleared.failure", 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) ((net.minecraft.commands.CommandSourceStack) commandcontext.getSource()).getLevel().serverLevelData.getScheduledEvents().getEventsIds(), suggestionsbuilder); // Paper
|
|
};
|
|
|
|
public ScheduleCommand() {}
|
|
@@ -82,7 +82,7 @@ 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 ScheduleCommand.ERROR_CANT_REMOVE.create(eventName);
|