From c4be1b989e85043e308187ad5e72a32864fec1d7 Mon Sep 17 00:00:00 2001 From: Andrew Date: Mon, 11 Nov 2013 03:29:42 +1300 Subject: [PATCH] Return the incorrect command usage with a .0 for float/double --- .../libraryaddict/disguise/BaseDisguiseCommand.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/me/libraryaddict/disguise/BaseDisguiseCommand.java b/src/me/libraryaddict/disguise/BaseDisguiseCommand.java index 6423c6a7..f59ba80c 100644 --- a/src/me/libraryaddict/disguise/BaseDisguiseCommand.java +++ b/src/me/libraryaddict/disguise/BaseDisguiseCommand.java @@ -157,7 +157,14 @@ public abstract class BaseDisguiseCommand implements CommandExecutor { if (types.length == 1) { Class param = types[0]; // Parse to number - if (float.class == param || double.class == param || int.class == param) { + if (int.class == param) { + if (isNumeric(valueString)) { + value = (int) Integer.parseInt(valueString); + } else { + throw parseToException("number", valueString, methodName); + } + // Parse to boolean + } else if (float.class == param || double.class == param) { if (isDouble(valueString)) { float obj = Float.parseFloat(valueString); if (param == float.class) { @@ -168,7 +175,7 @@ public abstract class BaseDisguiseCommand implements CommandExecutor { value = (double) obj; } } else { - throw parseToException("number", valueString, methodName); + throw parseToException("number.0", valueString, methodName); } // Parse to boolean } else if (boolean.class == param) {