summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2012-04-04 00:40:58 +0100
committerKHobbits <rob@khobbits.co.uk>2012-04-04 00:40:58 +0100
commit932de333499132572983ff1cd3e05faff1cfa274 (patch)
treec9711535f39c4592c19794ac1357cff9c88a734b
parent195604997b6d069e11d843c891add65f23c8f794 (diff)
downloadEssentials-932de333499132572983ff1cd3e05faff1cfa274.tar
Essentials-932de333499132572983ff1cd3e05faff1cfa274.tar.gz
Essentials-932de333499132572983ff1cd3e05faff1cfa274.tar.lz
Essentials-932de333499132572983ff1cd3e05faff1cfa274.tar.xz
Essentials-932de333499132572983ff1cd3e05faff1cfa274.zip
Little bit of powertools code cleanup.
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandpowertool.java26
1 files changed, 9 insertions, 17 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandpowertool.java b/Essentials/src/com/earth2me/essentials/commands/Commandpowertool.java
index 679937897..d1d0fb582 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandpowertool.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandpowertool.java
@@ -51,26 +51,18 @@ public class Commandpowertool extends EssentialsCommand
{
user.sendMessage(_("powerToolList", Util.joinList(powertools), itemName));
}
- return;
+ throw new NoChargeException();
}
if (command.startsWith("r:"))
{
- try
+ command = command.substring(2);
+ if (!powertools.contains(command))
{
- command = command.substring(2);
- if (!powertools.contains(command))
- {
- throw new Exception(_("powerToolNoSuchCommandAssigned", command, itemName));
- }
-
- powertools.remove(command);
- user.sendMessage(_("powerToolRemove", command, itemName));
- }
- catch (Exception e)
- {
- user.sendMessage(e.getMessage());
- return;
+ throw new Exception(_("powerToolNoSuchCommandAssigned", command, itemName));
}
+
+ powertools.remove(command);
+ user.sendMessage(_("powerToolRemove", command, itemName));
}
else
{
@@ -85,7 +77,6 @@ public class Commandpowertool extends EssentialsCommand
{
throw new Exception(_("powerToolAlreadySet", command, itemName));
}
-
}
else if (powertools != null && !powertools.isEmpty())
{
@@ -110,7 +101,8 @@ public class Commandpowertool extends EssentialsCommand
user.sendMessage(_("powerToolRemoveAll", itemName));
}
- if (!user.arePowerToolsEnabled()) {
+ if (!user.arePowerToolsEnabled())
+ {
user.setPowerToolsEnabled(true);
user.sendMessage(_("powerToolsEnabled"));
}