summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2012-04-05 23:35:56 +0100
committerKHobbits <rob@khobbits.co.uk>2012-04-05 23:36:57 +0100
commit04b8702c5fb4c19e9b90aacff99acb89399f6579 (patch)
treeec8c300130d7fc98e0147c6a13fef98fe3ae0c2d
parent4823712f47bfb7f64e22b8633b05e3f6801919c5 (diff)
downloadEssentials-04b8702c5fb4c19e9b90aacff99acb89399f6579.tar
Essentials-04b8702c5fb4c19e9b90aacff99acb89399f6579.tar.gz
Essentials-04b8702c5fb4c19e9b90aacff99acb89399f6579.tar.lz
Essentials-04b8702c5fb4c19e9b90aacff99acb89399f6579.tar.xz
Essentials-04b8702c5fb4c19e9b90aacff99acb89399f6579.zip
Fix /time not working with the '##pm' syntax.
-rw-r--r--Essentials/src/com/earth2me/essentials/DescParseTickFormat.java34
1 files changed, 17 insertions, 17 deletions
diff --git a/Essentials/src/com/earth2me/essentials/DescParseTickFormat.java b/Essentials/src/com/earth2me/essentials/DescParseTickFormat.java
index bf3037e59..9c40acacc 100644
--- a/Essentials/src/com/earth2me/essentials/DescParseTickFormat.java
+++ b/Essentials/src/com/earth2me/essentials/DescParseTickFormat.java
@@ -6,12 +6,11 @@ import java.util.*;
/**
- * This utility class is used for converting between the ingame
- * time in ticks to ingame time as a friendly string.
- * Note that the time is INGAME.
- *
+ * This utility class is used for converting between the ingame time in ticks to ingame time as a friendly string. Note
+ * that the time is INGAME.
+ *
* http://www.minecraftwiki.net/wiki/Day/night_cycle
- *
+ *
* @author Olof Larsson
*/
public final class DescParseTickFormat
@@ -156,30 +155,31 @@ public final class DescParseTickFormat
int hours = 0;
int minutes = 0;
- desc = desc.toLowerCase(Locale.ENGLISH).replaceAll("[^0-9]", "");
+ desc = desc.toLowerCase(Locale.ENGLISH);
+ String parsetime = desc.replaceAll("[^0-9]", "");
- if (desc.length() > 4)
+ if (parsetime.length() > 4)
{
throw new NumberFormatException();
}
- if (desc.length() == 4)
+ if (parsetime.length() == 4)
{
- hours += Integer.parseInt(desc.substring(0, 2));
- minutes += Integer.parseInt(desc.substring(2, 4));
+ hours += Integer.parseInt(parsetime.substring(0, 2));
+ minutes += Integer.parseInt(parsetime.substring(2, 4));
}
- else if (desc.length() == 3)
+ else if (parsetime.length() == 3)
{
- hours += Integer.parseInt(desc.substring(0, 1));
- minutes += Integer.parseInt(desc.substring(1, 3));
+ hours += Integer.parseInt(parsetime.substring(0, 1));
+ minutes += Integer.parseInt(parsetime.substring(1, 3));
}
- else if (desc.length() == 2)
+ else if (parsetime.length() == 2)
{
- hours += Integer.parseInt(desc.substring(0, 2));
+ hours += Integer.parseInt(parsetime.substring(0, 2));
}
- else if (desc.length() == 1)
+ else if (parsetime.length() == 1)
{
- hours += Integer.parseInt(desc.substring(0, 1));
+ hours += Integer.parseInt(parsetime.substring(0, 1));
}
else
{