summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2013-04-28 04:26:39 +0100
committerKHobbits <rob@khobbits.co.uk>2013-04-28 04:26:39 +0100
commit3396cf6e023e2ec12adbc0a8ed84a6715e227935 (patch)
tree8aa9ebec28e5be9dac095450b4410fbcdc54b68b
parente60f17bb5389d0108b767f7d6f783f4c192cba23 (diff)
downloadEssentials-3396cf6e023e2ec12adbc0a8ed84a6715e227935.tar
Essentials-3396cf6e023e2ec12adbc0a8ed84a6715e227935.tar.gz
Essentials-3396cf6e023e2ec12adbc0a8ed84a6715e227935.tar.lz
Essentials-3396cf6e023e2ec12adbc0a8ed84a6715e227935.tar.xz
Essentials-3396cf6e023e2ec12adbc0a8ed84a6715e227935.zip
[Fix] Try singular and plural entity names in /remove.
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandremove.java20
1 files changed, 17 insertions, 3 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandremove.java b/Essentials/src/com/earth2me/essentials/commands/Commandremove.java
index 2e7394c90..dc1119242 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandremove.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandremove.java
@@ -51,7 +51,7 @@ public class Commandremove extends EssentialsCommand
throw new Exception(_("numberRequired"), e);
}
}
-
+
if (args.length >= 3)
{
world = ess.getWorld(args[2]);
@@ -63,7 +63,14 @@ public class Commandremove extends EssentialsCommand
}
catch (IllegalArgumentException e)
{
- throw new NotEnoughArgumentsException(e); //TODO: translate and list types
+ try
+ {
+ toRemove = ToRemove.valueOf(args[0].concat("S").toUpperCase(Locale.ENGLISH));
+ }
+ catch (IllegalArgumentException ee)
+ {
+ throw new NotEnoughArgumentsException(ee); //TODO: translate and list types
+ }
}
removeEntities(user, world, toRemove, radius);
@@ -85,7 +92,14 @@ public class Commandremove extends EssentialsCommand
}
catch (IllegalArgumentException e)
{
- throw new NotEnoughArgumentsException(e); //TODO: translate and list types
+ try
+ {
+ toRemove = ToRemove.valueOf(args[0].concat("S").toUpperCase(Locale.ENGLISH));
+ }
+ catch (IllegalArgumentException ee)
+ {
+ throw new NotEnoughArgumentsException(ee); //TODO: translate and list types
+ }
}
removeEntities(sender, world, toRemove, 0);
}