Fixed enchantments -.-

This commit is contained in:
Acrobot 2012-10-28 23:53:46 +01:00
parent b0a04c42cc
commit aed6eff863
1 changed files with 15 additions and 0 deletions

View File

@ -79,6 +79,21 @@ public class NumberUtil {
}
}
/**
* Checks if the string is an enchantment
*
* @param string String to check
* @return Is the string an enchantment?
*/
public static boolean isEnchantment(String string) {
try {
Long.parseLong(string, 32);
return true;
} catch (NumberFormatException e) {
return false;
}
}
/**
* Rounds the number up to two decimal points (Can be inaccurate due to using decimal-points)
*