mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-24 17:21:37 +01:00
SPIGOT-6496: /time functions affect entire server, not just the origin world
By: DerFrZocker <derrieple@gmail.com>
This commit is contained in:
parent
c0b8deb846
commit
cc34358a3e
@ -12,7 +12,13 @@
|
|||||||
public class CommandTime {
|
public class CommandTime {
|
||||||
|
|
||||||
public CommandTime() {}
|
public CommandTime() {}
|
||||||
@@ -52,7 +57,13 @@
|
@@ -47,12 +52,18 @@
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int setTime(CommandListenerWrapper commandlistenerwrapper, int i) {
|
||||||
|
- Iterator iterator = commandlistenerwrapper.getServer().getAllLevels().iterator();
|
||||||
|
+ Iterator iterator = com.google.common.collect.Iterators.singletonIterator(commandlistenerwrapper.getLevel()); // CraftBukkit - SPIGOT-6496: Only set the time for the world the command originates in
|
||||||
|
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
WorldServer worldserver = (WorldServer) iterator.next();
|
WorldServer worldserver = (WorldServer) iterator.next();
|
||||||
|
|
||||||
@ -27,7 +33,13 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
commandlistenerwrapper.sendSuccess(new ChatMessage("commands.time.set", new Object[]{i}), true);
|
commandlistenerwrapper.sendSuccess(new ChatMessage("commands.time.set", new Object[]{i}), true);
|
||||||
@@ -65,7 +76,13 @@
|
@@ -60,12 +71,18 @@
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int addTime(CommandListenerWrapper commandlistenerwrapper, int i) {
|
||||||
|
- Iterator iterator = commandlistenerwrapper.getServer().getAllLevels().iterator();
|
||||||
|
+ Iterator iterator = com.google.common.collect.Iterators.singletonIterator(commandlistenerwrapper.getLevel()); // CraftBukkit - SPIGOT-6496: Only set the time for the world the command originates in
|
||||||
|
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
WorldServer worldserver = (WorldServer) iterator.next();
|
WorldServer worldserver = (WorldServer) iterator.next();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user