summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2011-11-28 02:54:19 +0000
committerKHobbits <rob@khobbits.co.uk>2011-11-28 02:54:19 +0000
commit05c90af1ee9b6717da97e14caf7a908f9da12e6f (patch)
treed613762e72cb4e9d3ac07d384834eb09c2909445
parent6603d0997e9af60e80fa426e8acb40557c8b6b9d (diff)
downloadEssentials-05c90af1ee9b6717da97e14caf7a908f9da12e6f.tar
Essentials-05c90af1ee9b6717da97e14caf7a908f9da12e6f.tar.gz
Essentials-05c90af1ee9b6717da97e14caf7a908f9da12e6f.tar.lz
Essentials-05c90af1ee9b6717da97e14caf7a908f9da12e6f.tar.xz
Essentials-05c90af1ee9b6717da97e14caf7a908f9da12e6f.zip
Fix empty argument in delhome.
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commanddelhome.java30
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandtp.java1
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandweather.java1
3 files changed, 20 insertions, 12 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commanddelhome.java b/Essentials/src/com/earth2me/essentials/commands/Commanddelhome.java
index 0e8918d9e..ce891985e 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commanddelhome.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commanddelhome.java
@@ -17,28 +17,34 @@ public class Commanddelhome extends EssentialsCommand
@Override
public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
{
- //Allowing both formats /delhome khobbits house | /delhome khobbits:house
- final String[] expandedArgs = args[0].split(":");
+ if (args.length < 1)
+ {
+ throw new NotEnoughArgumentsException();
+ }
User user = ess.getUser(sender);
String name;
- if (expandedArgs.length < 1)
+ final String[] expandedArg = args[0].split(":");
+
+ if (expandedArg.length > 1 && (user == null || user.isAuthorized("essentials.delhome.others")))
{
- throw new NotEnoughArgumentsException();
+ user = getPlayer(server, expandedArg, 0, true);
+ name = expandedArg[1];
}
- else if (expandedArgs.length > 1 && (user == null || user.isAuthorized("essentials.delhome.others")))
+ else if (user == null)
{
- user = getPlayer(server, expandedArgs, 0, true);
- name = expandedArgs[1];
+ throw new NotEnoughArgumentsException();
}
else
{
- if (user == null)
- {
- throw new NotEnoughArgumentsException();
- }
- name = expandedArgs[0];
+ name = expandedArg[0];
}
+ //TODO: Think up a nice error message
+ /*
+ * if (name.equalsIgnoreCase("bed")) {
+ * throw new Exception("You cannot remove the vanilla home point");
+ * }
+ */
user.delHome(name.toLowerCase(Locale.ENGLISH));
sender.sendMessage(_("deleteHome", name));
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtp.java b/Essentials/src/com/earth2me/essentials/commands/Commandtp.java
index ac3991060..10c381b2e 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandtp.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandtp.java
@@ -38,6 +38,7 @@ public class Commandtp extends EssentialsCommand
default:
if (!user.isAuthorized("essentials.tpohere"))
{
+ //TODO: Translate this
throw new Exception("You need access to /tpohere to teleport other players.");
}
user.sendMessage(_("teleporting"));
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandweather.java b/Essentials/src/com/earth2me/essentials/commands/Commandweather.java
index bb1fc0927..1229c9ee4 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandweather.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandweather.java
@@ -43,6 +43,7 @@ public class Commandweather extends EssentialsCommand
}
}
+ //TODO: Translate these
@Override
protected void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
{