Paper/patches/server/0600-Make-schedule-command-per-world.patch
Jake Potrebic ea0ec8c5a0
Updated Upstream (Bukkit/CraftBukkit) & more patches
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
e9ce88b9 SPIGOT-6562: Add more specific sculk sensor event

CraftBukkit Changes:
d7ef1e91 SPIGOT-6558: Attempt to improve SkullMeta
e7a63287 SPIGOT-6562: Add more specific sculk sensor event
2021-06-15 21:12:14 -07:00

38 lines
2.3 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 018923e519544561747240618bce5df60475cdc6..7f5d249502e9b2fb9e5811cfeb43122b47f7b111 100644
--- a/src/main/java/net/minecraft/server/commands/ScheduleCommand.java
+++ b/src/main/java/net/minecraft/server/commands/ScheduleCommand.java
@@ -29,7 +29,7 @@ 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) {
@@ -52,7 +52,7 @@ 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) {
@@ -75,7 +75,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 ERROR_CANT_REMOVE.create(eventName);
} else {