mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-01-29 11:31:55 +01:00
Some fixes to the time code by me
This commit is contained in:
parent
a117080b32
commit
a8f6014a42
@ -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?
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user