From aed6eff863801ca1921af9d2b0ff9263942434a9 Mon Sep 17 00:00:00 2001 From: Acrobot Date: Sun, 28 Oct 2012 23:53:46 +0100 Subject: [PATCH] Fixed enchantments -.- --- com/Acrobot/Breeze/Utils/NumberUtil.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/com/Acrobot/Breeze/Utils/NumberUtil.java b/com/Acrobot/Breeze/Utils/NumberUtil.java index 8953436..85fa692 100644 --- a/com/Acrobot/Breeze/Utils/NumberUtil.java +++ b/com/Acrobot/Breeze/Utils/NumberUtil.java @@ -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) *