diff options
author | Necrodoom <doomed.war@gmail.com> | 2013-03-25 16:18:09 +0200 |
---|---|---|
committer | KHobbits <rob@khobbits.co.uk> | 2013-04-28 03:44:24 +0100 |
commit | a9052b5d40e78d043f836bca3c3e1ad81aae672c (patch) | |
tree | 0f8bddc015ff66953ffc88d96e38c7fa5c07bc7c | |
parent | 376955e1cc3e47146a5cc160bbc643fbd1c98b6a (diff) | |
download | Essentials-a9052b5d40e78d043f836bca3c3e1ad81aae672c.tar Essentials-a9052b5d40e78d043f836bca3c3e1ad81aae672c.tar.gz Essentials-a9052b5d40e78d043f836bca3c3e1ad81aae672c.tar.lz Essentials-a9052b5d40e78d043f836bca3c3e1ad81aae672c.tar.xz Essentials-a9052b5d40e78d043f836bca3c3e1ad81aae672c.zip |
[Feature] Add /socialspy other
-rw-r--r-- | Essentials/src/com/earth2me/essentials/commands/Commandsocialspy.java | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsocialspy.java b/Essentials/src/com/earth2me/essentials/commands/Commandsocialspy.java index 6080642a1..a321fcf04 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandsocialspy.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandsocialspy.java @@ -2,6 +2,7 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.User; +import org.bukkit.command.CommandSender; import org.bukkit.Server; @@ -15,6 +16,30 @@ public class Commandsocialspy extends EssentialsCommand @Override public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception { - user.sendMessage("§7SocialSpy " + (user.toggleSocialSpy() ? _("enabled") : _("disabled"))); + if (args.length > 1 && user.isAuthorized("essentials.socialspy.others")) + { + User target = getPlayer(server, user, args, 0); + user.sendMessage("§7SocialSpy " + (target.toggleSocialSpy() ? _("enabled") : _("disabled"))); + + } + else + { + user.sendMessage("§7SocialSpy " + (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) + { + User target = getPlayer(server, args, 0, true, false); + sender.sendMessage("§7SocialSpy " + (target.toggleSocialSpy() ? _("enabled") : _("disabled"))); + + } + else + { + throw new NotEnoughArgumentsException(); + } } } |