mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-12-22 09:08:01 +01:00
Fix time command
This commit is contained in:
parent
d4ebaf61d4
commit
0c8bc16c3d
@ -81,15 +81,17 @@ public class Commandtime extends EssentialsCommand {
|
||||
}
|
||||
|
||||
final StringJoiner joiner = new StringJoiner(", ");
|
||||
final boolean timeAdd = add;
|
||||
for (final World world : worlds) {
|
||||
long time = world.getTime();
|
||||
if (!add) {
|
||||
time -= time % 24000;
|
||||
}
|
||||
world.setTime(time + (add ? 0 : 24000) + timeTick);
|
||||
joiner.add(world.getName());
|
||||
ess.scheduleLocationDelayedTask(world.getSpawnLocation(), () -> {
|
||||
long time = world.getTime();
|
||||
if (!timeAdd) {
|
||||
time -= time % 24000;
|
||||
}
|
||||
world.setTime(time + (timeAdd ? 0 : 24000) + timeTick);
|
||||
});
|
||||
}
|
||||
|
||||
sender.sendMessage(tl(add ? "timeWorldAdd" : "timeWorldSet", DescParseTickFormat.formatTicks(timeTick), joiner.toString()));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user