1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-02-25 00:42:48 +01:00

Some fixes to the time code by me

This commit is contained in:
snowleo 2011-08-08 17:51:16 +02:00
parent 178d89ce5f
commit 1d89353cf1
2 changed files with 4 additions and 4 deletions

View File

@ -71,8 +71,6 @@ public final class DescParseTickFormat
// -------------------------------------------- // --------------------------------------------
public static long parse(String desc) throws NumberFormatException public static long parse(String desc) throws NumberFormatException
{ {
Long ret;
// Only look at alphanumeric and lowercase and : for 24:00 // Only look at alphanumeric and lowercase and : for 24:00
desc = desc.toLowerCase().replaceAll("[^A-Za-z0-9:]", ""); desc = desc.toLowerCase().replaceAll("[^A-Za-z0-9:]", "");
@ -275,7 +273,7 @@ public final class DescParseTickFormat
ticks = ticks - ticksAtMidnight + ticksPerDay; ticks = ticks - ticksAtMidnight + ticksPerDay;
// How many ingame days have passed since the server start? // How many ingame days have passed since the server start?
long days = ticks / ticksPerDay; final long days = ticks / ticksPerDay;
ticks = ticks - days * ticksPerDay; ticks = ticks - days * ticksPerDay;
// How many hours on the last day? // How many hours on the last day?

View File

@ -94,7 +94,9 @@ public class Commandtime extends EssentialsCommand
// Update the time // Update the time
for (World world : worlds) 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 // Inform the sender of the change