From 48029b8849902edf59b9c795e089478f6d9ef216 Mon Sep 17 00:00:00 2001 From: Andrew Date: Wed, 6 Nov 2013 05:53:33 +1300 Subject: [PATCH] Don't remember committing this --- .../disguise/BaseDisguiseCommand.java | 28 ++++++++----------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/src/me/libraryaddict/disguise/BaseDisguiseCommand.java b/src/me/libraryaddict/disguise/BaseDisguiseCommand.java index c1413c83..828f5c4e 100644 --- a/src/me/libraryaddict/disguise/BaseDisguiseCommand.java +++ b/src/me/libraryaddict/disguise/BaseDisguiseCommand.java @@ -3,20 +3,14 @@ package me.libraryaddict.disguise; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.Collections; -import java.util.HashMap; - import me.libraryaddict.disguise.disguisetypes.Disguise; import me.libraryaddict.disguise.disguisetypes.DisguiseType; import me.libraryaddict.disguise.disguisetypes.MiscDisguise; import me.libraryaddict.disguise.disguisetypes.MobDisguise; import me.libraryaddict.disguise.disguisetypes.PlayerDisguise; -import net.minecraft.v1_6_R3.org.bouncycastle.util.Arrays; - -import org.apache.commons.lang3.ArrayUtils; import org.bukkit.ChatColor; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; public abstract class BaseDisguiseCommand implements CommandExecutor { protected ArrayList getAllowedDisguises(CommandSender sender, String permissionNode) { @@ -31,15 +25,6 @@ public abstract class BaseDisguiseCommand implements CommandExecutor { return names; } - protected boolean isNumeric(String string) { - try { - Integer.parseInt(string); - return true; - } catch (Exception ex) { - return false; - } - } - protected boolean isDouble(String string) { try { Float.parseFloat(string); @@ -49,7 +34,14 @@ public abstract class BaseDisguiseCommand implements CommandExecutor { } } - protected abstract void sendCommandUsage(CommandSender sender); + protected boolean isNumeric(String string) { + try { + Integer.parseInt(string); + return true; + } catch (Exception ex) { + return false; + } + } /** * Returns the disguise if it all parsed correctly. Returns a exception with a complete message if it didn't. The @@ -137,7 +129,7 @@ public abstract class BaseDisguiseCommand implements CommandExecutor { for (int i = 0; i < args.length; i += 2) { String methodName = args[i]; if (i + 1 >= args.length) { - throw new Exception(ChatColor.RED + "No value was given for " + methodName); + throw new Exception(ChatColor.RED + "No value was given for the option " + methodName); } String valueString = args[i + 1]; Method methodToUse = null; @@ -183,4 +175,6 @@ public abstract class BaseDisguiseCommand implements CommandExecutor { // Alright. We've constructed our disguise. return disguise; } + + protected abstract void sendCommandUsage(CommandSender sender); }