mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-12 04:20:41 +00:00
[Feature] Add /socialspy other
This commit is contained in:
parent
865b581d06
commit
eb0c71984c
1 changed files with 26 additions and 1 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue