From 0c8bc16c3d8433b1e3c1d40ac18f1a6044414120 Mon Sep 17 00:00:00 2001 From: Josh Roy <10731363+JRoy@users.noreply.github.com> Date: Thu, 27 Jul 2023 19:59:56 -0400 Subject: [PATCH] Fix time command --- .../earth2me/essentials/commands/Commandtime.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Essentials/src/main/java/com/earth2me/essentials/commands/Commandtime.java b/Essentials/src/main/java/com/earth2me/essentials/commands/Commandtime.java index 06c86b2da..3537d693c 100644 --- a/Essentials/src/main/java/com/earth2me/essentials/commands/Commandtime.java +++ b/Essentials/src/main/java/com/earth2me/essentials/commands/Commandtime.java @@ -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())); }