Updated /mcpurge for Bukkit CommandAPI, also made it work with Flatfile

This commit is contained in:
GJ
2013-02-05 15:29:57 -05:00
parent 419937f62e
commit 3f6c07ba6a
8 changed files with 193 additions and 64 deletions

View File

@ -169,6 +169,19 @@ public final class Misc {
return 0;
}
/**
* Gets the long represented by this string.
*
* @param string The string to parse
* @return the long represented by this string
*/
public static long getLong(String string) {
if (isLong(string)) {
return Long.parseLong(string);
}
return 0;
}
/**
* Checks to see if an entity is currently invincible.
*
@ -287,6 +300,22 @@ public final class Misc {
}
}
/**
* Determine if a string represents a Long
*
* @param string String to check
* @return true if the string is a Long, false otherwise
*/
public static boolean isLong(String string) {
try {
Long.parseLong(string);
return true;
}
catch (NumberFormatException nFE) {
return false;
}
}
/**
* Drop items at a given location.
*