From e60f17bb5389d0108b767f7d6f783f4c192cba23 Mon Sep 17 00:00:00 2001 From: Necrodoom Date: Mon, 25 Mar 2013 16:05:35 +0200 Subject: Fix radius in /remove and add world. Fix SocialSpy Fix /killall world argument. --- .../com/earth2me/essentials/commands/Commandkillall.java | 4 ++++ .../com/earth2me/essentials/commands/Commandremove.java | 16 ++++++++-------- .../earth2me/essentials/commands/Commandsocialspy.java | 14 ++++++-------- Essentials/src/messages.properties | 1 + Essentials/src/messages_cs.properties | 1 + Essentials/src/messages_da.properties | 1 + Essentials/src/messages_de.properties | 1 + Essentials/src/messages_en.properties | 1 + Essentials/src/messages_es.properties | 1 + Essentials/src/messages_fi.properties | 1 + Essentials/src/messages_fr.properties | 1 + Essentials/src/messages_it.properties | 1 + Essentials/src/messages_nl.properties | 1 + Essentials/src/messages_pl.properties | 1 + Essentials/src/messages_pt.properties | 1 + Essentials/src/messages_ro.properties | 1 + Essentials/src/messages_se.properties | 1 + Essentials/src/plugin.yml | 6 +++--- 18 files changed, 35 insertions(+), 19 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandkillall.java b/Essentials/src/com/earth2me/essentials/commands/Commandkillall.java index 5ed76956d..854ed252c 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandkillall.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandkillall.java @@ -53,6 +53,10 @@ public class Commandkillall extends EssentialsCommand throw new Exception(_("numberRequired"), e); } } + if (args.length > 2) + { + world = ess.getWorld(args[2]); + } } else { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandremove.java b/Essentials/src/com/earth2me/essentials/commands/Commandremove.java index 67517b7c8..2e7394c90 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandremove.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandremove.java @@ -37,10 +37,10 @@ public class Commandremove extends EssentialsCommand throw new NotEnoughArgumentsException(); } ToRemove toRemove; - final World world = user.getWorld(); + World world = user.getWorld(); int radius = 0; - if (args.length < 2) + if (args.length >= 2) { try { @@ -51,6 +51,11 @@ public class Commandremove extends EssentialsCommand throw new Exception(_("numberRequired"), e); } } + + if (args.length >= 3) + { + world = ess.getWorld(args[2]); + } try { @@ -71,13 +76,8 @@ public class Commandremove extends EssentialsCommand { throw new NotEnoughArgumentsException(); } - World world; - world = ess.getWorld(args[1]); + World world = ess.getWorld(args[1]); - if (world == null) - { - throw new Exception(_("invalidWorld")); - } ToRemove toRemove; try { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsocialspy.java b/Essentials/src/com/earth2me/essentials/commands/Commandsocialspy.java index a321fcf04..e5985a2fa 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandsocialspy.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandsocialspy.java @@ -16,26 +16,24 @@ public class Commandsocialspy extends EssentialsCommand @Override public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception { - if (args.length > 1 && user.isAuthorized("essentials.socialspy.others")) + if (args.length > 0 && user.isAuthorized("essentials.socialspy.others")) { User target = getPlayer(server, user, args, 0); - user.sendMessage("§7SocialSpy " + (target.toggleSocialSpy() ? _("enabled") : _("disabled"))); - + user.sendMessage(_("socialSpy", target.getDisplayName(), target.toggleSocialSpy() ? _("enabled") : _("disabled"))); } else { - user.sendMessage("§7SocialSpy " + (user.toggleSocialSpy() ? _("enabled") : _("disabled"))); + user.sendMessage(_("socialSpy", user.getDisplayName(), user.toggleSocialSpy() ? _("enabled") : _("disabled"))); } } - + @Override public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception { - if (args.length > 1) + if (args.length > 0) { User target = getPlayer(server, args, 0, true, false); - sender.sendMessage("§7SocialSpy " + (target.toggleSocialSpy() ? _("enabled") : _("disabled"))); - + sender.sendMessage(_("socialSpy", target.getDisplayName(), target.toggleSocialSpy() ? _("enabled") : _("disabled"))); } else { diff --git a/Essentials/src/messages.properties b/Essentials/src/messages.properties index b8a181842..d0165fa6b 100644 --- a/Essentials/src/messages.properties +++ b/Essentials/src/messages.properties @@ -534,3 +534,4 @@ pWeatherSet=\u00a76Player weather is set to \u00a7c{0}\u00a76 for: \u00a7c{1}. pWeatherInvalidAlias=\u00a74Invalid weather type cannotStackMob=\u00a74You do not have permission to stack multiple mobs. kitNotFound=\u00a74That kit does not exist. +socialSpy=\u00a76SocialSpy for {0}\u00a76: {1} diff --git a/Essentials/src/messages_cs.properties b/Essentials/src/messages_cs.properties index bfa66df1f..0bb449ca6 100644 --- a/Essentials/src/messages_cs.properties +++ b/Essentials/src/messages_cs.properties @@ -537,3 +537,4 @@ pWeatherSet=\u00a76Player weather is set to \u00a7c{0}\u00a76 for: \u00a7c{1}. pWeatherInvalidAlias=\u00a74Invalid weather type cannotStackMob=\u00a74You do not have permission to stack multiple mobs kitNotFound=\u00a74That kit does not exist. +socialSpy=\u00a76SocialSpy for {0}\u00a76: {1} diff --git a/Essentials/src/messages_da.properties b/Essentials/src/messages_da.properties index 0872db8cd..b103b23fc 100644 --- a/Essentials/src/messages_da.properties +++ b/Essentials/src/messages_da.properties @@ -534,3 +534,4 @@ pWeatherSet=\u00a76Player weather is set to \u00a7c{0}\u00a76 for: \u00a7c{1}. pWeatherInvalidAlias=\u00a74Invalid weather type cannotStackMob=\u00a74You do not have permission to stack multiple mobs kitNotFound=\u00a74That kit does not exist. +socialSpy=\u00a76SocialSpy for {0}\u00a76: {1} diff --git a/Essentials/src/messages_de.properties b/Essentials/src/messages_de.properties index b7bd1978a..8c4cdd10e 100644 --- a/Essentials/src/messages_de.properties +++ b/Essentials/src/messages_de.properties @@ -534,3 +534,4 @@ pWeatherSet=\u00a76Player weather is set to \u00a7c{0}\u00a76 for: \u00a7c{1}. pWeatherInvalidAlias=\u00a74Invalid weather type cannotStackMob=\u00a74You do not have permission to stack multiple mobs kitNotFound=\u00a74That kit does not exist. +socialSpy=\u00a76SocialSpy for {0}\u00a76: {1} diff --git a/Essentials/src/messages_en.properties b/Essentials/src/messages_en.properties index b8a181842..d0165fa6b 100644 --- a/Essentials/src/messages_en.properties +++ b/Essentials/src/messages_en.properties @@ -534,3 +534,4 @@ pWeatherSet=\u00a76Player weather is set to \u00a7c{0}\u00a76 for: \u00a7c{1}. pWeatherInvalidAlias=\u00a74Invalid weather type cannotStackMob=\u00a74You do not have permission to stack multiple mobs. kitNotFound=\u00a74That kit does not exist. +socialSpy=\u00a76SocialSpy for {0}\u00a76: {1} diff --git a/Essentials/src/messages_es.properties b/Essentials/src/messages_es.properties index fe5b97092..fccd18329 100644 --- a/Essentials/src/messages_es.properties +++ b/Essentials/src/messages_es.properties @@ -534,3 +534,4 @@ pWeatherSet=\u00a76Player weather is set to \u00a7c{0}\u00a76 for: \u00a7c{1}. pWeatherInvalidAlias=\u00a74Invalid weather type cannotStackMob=\u00a74You do not have permission to stack multiple mobs kitNotFound=\u00a74That kit does not exist. +socialSpy=\u00a76SocialSpy for {0}\u00a76: {1} diff --git a/Essentials/src/messages_fi.properties b/Essentials/src/messages_fi.properties index ded9440dc..246809d82 100644 --- a/Essentials/src/messages_fi.properties +++ b/Essentials/src/messages_fi.properties @@ -534,3 +534,4 @@ pWeatherSet=\u00a76Player weather is set to \u00a7c{0}\u00a76 for: \u00a7c{1}. pWeatherInvalidAlias=\u00a74Invalid weather type cannotStackMob=\u00a74You do not have permission to stack multiple mobs kitNotFound=\u00a74That kit does not exist. +socialSpy=\u00a76SocialSpy for {0}\u00a76: {1} diff --git a/Essentials/src/messages_fr.properties b/Essentials/src/messages_fr.properties index 384f239f5..2c6efe7cd 100644 --- a/Essentials/src/messages_fr.properties +++ b/Essentials/src/messages_fr.properties @@ -534,3 +534,4 @@ pWeatherSet=\u00a76Player weather is set to \u00a7c{0}\u00a76 for: \u00a7c{1}. pWeatherInvalidAlias=\u00a74Invalid weather type cannotStackMob=\u00a74You do not have permission to stack multiple mobs kitNotFound=\u00a74That kit does not exist. +socialSpy=\u00a76SocialSpy for {0}\u00a76: {1} diff --git a/Essentials/src/messages_it.properties b/Essentials/src/messages_it.properties index 3339ac2ec..ba415179f 100644 --- a/Essentials/src/messages_it.properties +++ b/Essentials/src/messages_it.properties @@ -534,3 +534,4 @@ pWeatherSet=\u00a76Player weather is set to \u00a7c{0}\u00a76 for: \u00a7c{1}. pWeatherInvalidAlias=\u00a74Invalid weather type cannotStackMob=\u00a74You do not have permission to stack multiple mobs kitNotFound=\u00a74That kit does not exist. +socialSpy=\u00a76SocialSpy for {0}\u00a76: {1} diff --git a/Essentials/src/messages_nl.properties b/Essentials/src/messages_nl.properties index 75b0c98bb..d349d5a80 100644 --- a/Essentials/src/messages_nl.properties +++ b/Essentials/src/messages_nl.properties @@ -534,3 +534,4 @@ pWeatherSet=\u00a76Player weather is set to \u00a7c{0}\u00a76 for: \u00a7c{1}. pWeatherInvalidAlias=\u00a74Invalid weather type cannotStackMob=\u00a74You do not have permission to stack multiple mobs kitNotFound=\u00a74That kit does not exist. +socialSpy=\u00a76SocialSpy for {0}\u00a76: {1} diff --git a/Essentials/src/messages_pl.properties b/Essentials/src/messages_pl.properties index 8625c64d8..8dc5095cf 100644 --- a/Essentials/src/messages_pl.properties +++ b/Essentials/src/messages_pl.properties @@ -534,3 +534,4 @@ pWeatherSet=\u00a77 Gracz ustawil pogode \u00a7c{0}\u00a77 dla: \u00a7c{1}. pWeatherInvalidAlias=\u00a74Niepoprawny typ pogody cannotStackMob=\u00a74Nie masz uprawnien by stackowac wiele mobow kitNotFound=\u00a74That kit does not exist. +socialSpy=\u00a76SocialSpy for {0}\u00a76: {1} diff --git a/Essentials/src/messages_pt.properties b/Essentials/src/messages_pt.properties index 01231eec4..a3af47fcf 100644 --- a/Essentials/src/messages_pt.properties +++ b/Essentials/src/messages_pt.properties @@ -534,3 +534,4 @@ pWeatherSet=\u00a76Player weather is set to \u00a7c{0}\u00a76 for: \u00a7c{1}. pWeatherInvalidAlias=\u00a74Invalid weather type cannotStackMob=\u00a74You do not have permission to stack multiple mobs kitNotFound=\u00a74That kit does not exist. +socialSpy=\u00a76SocialSpy for {0}\u00a76: {1} diff --git a/Essentials/src/messages_ro.properties b/Essentials/src/messages_ro.properties index 88de7070c..2f525eeec 100644 --- a/Essentials/src/messages_ro.properties +++ b/Essentials/src/messages_ro.properties @@ -534,3 +534,4 @@ pWeatherSet=\u00a76Player weather is set to \u00a7c{0}\u00a76 for: \u00a7c{1}. pWeatherInvalidAlias=\u00a74Invalid weather type cannotStackMob=\u00a74You do not have permission to stack multiple mobs kitNotFound=\u00a74That kit does not exist. +socialSpy=\u00a76SocialSpy for {0}\u00a76: {1} diff --git a/Essentials/src/messages_se.properties b/Essentials/src/messages_se.properties index f1b142b9f..e41278abd 100644 --- a/Essentials/src/messages_se.properties +++ b/Essentials/src/messages_se.properties @@ -534,3 +534,4 @@ pWeatherSet=\u00a76Player weather is set to \u00a7c{0}\u00a76 for: \u00a7c{1}. pWeatherInvalidAlias=\u00a74Invalid weather type cannotStackMob=\u00a74You do not have permission to stack multiple mobs kitNotFound=\u00a74That kit does not exist. +socialSpy=\u00a76SocialSpy for {0}\u00a76: {1} diff --git a/Essentials/src/plugin.yml b/Essentials/src/plugin.yml index 415e5f5a8..0a164234d 100644 --- a/Essentials/src/plugin.yml +++ b/Essentials/src/plugin.yml @@ -205,7 +205,7 @@ commands: aliases: [ekill] killall: description: Kill all mobs in a world. - usage: / [mobType] [radius] + usage: / [mobType] [radius] [world] aliases: [butcher,ebutcher,ekillall,mobkill,emobkill] kit: description: Obtains the specified kit or views all available kits. @@ -300,7 +300,7 @@ commands: aliases: [formula,eformula,method,emethod,erecipe,recipes,erecipes] remove: description: Removes entities in your world. - usage: / [radius] + usage: / [radius] [world] aliases: [eremove] repair: description: Repairs the durability of all or one item. @@ -336,7 +336,7 @@ commands: aliases: [esetworth] socialspy: description: Toggles if you can see msg/mail commands in chat. - usage: / + usage: / [player] aliases: [esocialspy] spawner: description: Change the mob type of a spawner. -- cgit v1.2.3