summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsnowleo <schneeleo@gmail.com>2011-08-08 17:51:16 +0200
committersnowleo <schneeleo@gmail.com>2011-08-08 17:51:16 +0200
commita8f6014a425d9fa1c26d796a1676f6661134f254 (patch)
tree6a4b7fc8397cb85b699012e9a485b27c4068e5fe
parenta117080b32fd3cf06b93696532bafe4275bda6ba (diff)
downloadEssentials-a8f6014a425d9fa1c26d796a1676f6661134f254.tar
Essentials-a8f6014a425d9fa1c26d796a1676f6661134f254.tar.gz
Essentials-a8f6014a425d9fa1c26d796a1676f6661134f254.tar.lz
Essentials-a8f6014a425d9fa1c26d796a1676f6661134f254.tar.xz
Essentials-a8f6014a425d9fa1c26d796a1676f6661134f254.zip
Some fixes to the time code by me
-rwxr-xr-xEssentials/src/com/earth2me/essentials/DescParseTickFormat.java4
-rwxr-xr-xEssentials/src/com/earth2me/essentials/commands/Commandtime.java4
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