1
0
mirror of https://github.com/mcMMO-Dev/mcMMO.git synced 2026-02-20 02:33:15 +01:00

Added '/hardcore' and '/vampirism' commands for toggling these modes on

or off, along with the necessary permissions nodes.
This commit is contained in:
GJ
2013-02-13 08:15:38 -05:00
parent 7350fdb99c
commit 0319e2cbff
12 changed files with 309 additions and 19 deletions

View File

@@ -166,6 +166,21 @@ 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 double getDouble(String string) {
if (isDouble(string)) {
return Double.parseDouble(string);
}
return 0;
}
/**
* Checks to see if an entity is currently invincible.
*
@@ -300,6 +315,22 @@ public final class Misc {
}
}
/**
* Determine if a string represents a Double
*
* @param string String to check
* @return true if the string is a Double, false otherwise
*/
public static boolean isDouble(String string) {
try {
Double.parseDouble(string);
return true;
}
catch (NumberFormatException nFE) {
return false;
}
}
/**
* Drop items at a given location.
*