aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0647-Add-config-option-for-worlds-affected-by-time-cmd.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/server/0647-Add-config-option-for-worlds-affected-by-time-cmd.patch')
-rw-r--r--patches/server/0647-Add-config-option-for-worlds-affected-by-time-cmd.patch28
1 files changed, 28 insertions, 0 deletions
diff --git a/patches/server/0647-Add-config-option-for-worlds-affected-by-time-cmd.patch b/patches/server/0647-Add-config-option-for-worlds-affected-by-time-cmd.patch
new file mode 100644
index 0000000000..156eacada9
--- /dev/null
+++ b/patches/server/0647-Add-config-option-for-worlds-affected-by-time-cmd.patch
@@ -0,0 +1,28 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Jake Potrebic <[email protected]>
+Date: Sun, 2 Jan 2022 22:34:51 -0800
+Subject: [PATCH] Add config option for worlds affected by time cmd
+
+
+diff --git a/src/main/java/net/minecraft/server/commands/TimeCommand.java b/src/main/java/net/minecraft/server/commands/TimeCommand.java
+index db9317f813244c3cd895bdf9c4eb2218f68c4f1d..44fcd43a466fb47d31ab05e44bafbef3c4cae63f 100644
+--- a/src/main/java/net/minecraft/server/commands/TimeCommand.java
++++ b/src/main/java/net/minecraft/server/commands/TimeCommand.java
+@@ -53,7 +53,7 @@ public class TimeCommand {
+ }
+
+ public static int setTime(CommandSourceStack source, int time) {
+- 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();
+@@ -74,7 +74,7 @@ public class TimeCommand {
+ }
+
+ public static int addTime(CommandSourceStack source, int time) {
+- 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();