mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-08-03 19:15:44 +00:00
Some fixes to the time code by me
This commit is contained in:
parent
a117080b32
commit
a8f6014a42
2 changed files with 4 additions and 4 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue