From a8f6014a425d9fa1c26d796a1676f6661134f254 Mon Sep 17 00:00:00 2001 From: snowleo Date: Mon, 8 Aug 2011 17:51:16 +0200 Subject: Some fixes to the time code by me --- Essentials/src/com/earth2me/essentials/DescParseTickFormat.java | 4 +--- Essentials/src/com/earth2me/essentials/commands/Commandtime.java | 4 +++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/DescParseTickFormat.java b/Essentials/src/com/earth2me/essentials/DescParseTickFormat.java index d4bae34c1..95aacccb4 100755 --- a/Essentials/src/com/earth2me/essentials/DescParseTickFormat.java +++ b/Essentials/src/com/earth2me/essentials/DescParseTickFormat.java @@ -71,8 +71,6 @@ public final class DescParseTickFormat // -------------------------------------------- public static long parse(String desc) throws NumberFormatException { - Long ret; - // Only look at alphanumeric and lowercase and : for 24:00 desc = desc.toLowerCase().replaceAll("[^A-Za-z0-9:]", ""); @@ -275,7 +273,7 @@ public final class DescParseTickFormat ticks = ticks - ticksAtMidnight + ticksPerDay; // How many ingame days have passed since the server start? - long days = ticks / ticksPerDay; + final long days = ticks / ticksPerDay; ticks = ticks - days * ticksPerDay; // How many hours on the last day? diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtime.java b/Essentials/src/com/earth2me/essentials/commands/Commandtime.java index 604ca14a4..d7a339b9e 100755 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtime.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtime.java @@ -94,7 +94,9 @@ public class Commandtime extends EssentialsCommand // Update the time for (World world : worlds) { - world.setTime(ticks); + long time = world.getTime(); + time -= time % 24000; + world.setTime(time + 24000 + ticks); } // Inform the sender of the change -- cgit v1.2.3