From 69548ae4ec56773105bc25a7bdf4cfee4375bf92 Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Sun, 2 Jan 2022 22:34:51 -0800 Subject: [PATCH] Add config option for worlds affected by time cmd --- .../net/minecraft/server/commands/TimeCommand.java.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/paper-server/patches/sources/net/minecraft/server/commands/TimeCommand.java.patch b/paper-server/patches/sources/net/minecraft/server/commands/TimeCommand.java.patch index ea80723824..52c7c73aa7 100644 --- a/paper-server/patches/sources/net/minecraft/server/commands/TimeCommand.java.patch +++ b/paper-server/patches/sources/net/minecraft/server/commands/TimeCommand.java.patch @@ -16,7 +16,7 @@ public static int setTime(CommandSourceStack source, int time) { - Iterator iterator = source.getServer().getAllLevels().iterator(); -+ Iterator iterator = com.google.common.collect.Iterators.singletonIterator(source.getLevel()); // CraftBukkit - SPIGOT-6496: Only set the time for the world the command originates in ++ Iterator iterator = io.papermc.paper.configuration.GlobalConfiguration.get().commands.timeCommandAffectsAllWorlds ? source.getServer().getAllLevels().iterator() : com.google.common.collect.Iterators.singletonIterator(source.getLevel()); // CraftBukkit - SPIGOT-6496: Only set the time for the world the command originates in // Paper - add config option for spigot's change while (iterator.hasNext()) { ServerLevel worldserver = (ServerLevel) iterator.next(); @@ -37,7 +37,7 @@ public static int addTime(CommandSourceStack source, int time) { - Iterator iterator = source.getServer().getAllLevels().iterator(); -+ Iterator iterator = com.google.common.collect.Iterators.singletonIterator(source.getLevel()); // CraftBukkit - SPIGOT-6496: Only set the time for the world the command originates in ++ Iterator iterator = io.papermc.paper.configuration.GlobalConfiguration.get().commands.timeCommandAffectsAllWorlds ? source.getServer().getAllLevels().iterator() : com.google.common.collect.Iterators.singletonIterator(source.getLevel()); // CraftBukkit - SPIGOT-6496: Only set the time for the world the command originates in // Paper - add config option for spigot's change while (iterator.hasNext()) { ServerLevel worldserver = (ServerLevel) iterator.next();