mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-28 03:34:43 +02:00
Updated /mcpurge for Bukkit CommandAPI, also made it work with Flatfile
This commit is contained in:
@ -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.
|
||||
*
|
||||
|
Reference in New Issue
Block a user