mirror of
https://github.com/TotalFreedomMC/TFGuilds.git
synced 2024-06-26 07:40:37 +00:00
![Nathan Curran](/assets/img/avatar_default.png)
* TFGuilds rewrite almost completed (FS-164 FS-133 FS-244) The rewrite is nearing completion - few modifications to TFGuilds and TFM and it will be ready for production * Finalise few things * Code cleanup * Use empty list instead and true instead of false
41 lines
1.2 KiB
Java
41 lines
1.2 KiB
Java
package me.totalfreedom.tfguilds.command;
|
|
|
|
import me.totalfreedom.tfguilds.Common;
|
|
import org.bukkit.ChatColor;
|
|
import org.bukkit.command.Command;
|
|
import org.bukkit.command.CommandExecutor;
|
|
import org.bukkit.command.CommandSender;
|
|
import org.bukkit.entity.Player;
|
|
|
|
public class GuildChatSpyCommand extends Common implements CommandExecutor
|
|
{
|
|
|
|
@Override
|
|
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args)
|
|
{
|
|
if (!(sender instanceof Player))
|
|
{
|
|
sender.sendMessage(PREFIX + "Console can already view guild chat.");
|
|
return true;
|
|
}
|
|
|
|
if (!tfmBridge.isAdmin(sender))
|
|
{
|
|
sender.sendMessage(PREFIX + "You do not have the permission.");
|
|
return true;
|
|
}
|
|
|
|
Player player = (Player)sender;
|
|
if (GUILD_CHAT_SPY.contains(player))
|
|
{
|
|
GUILD_CHAT_SPY.remove(player);
|
|
sender.sendMessage(PREFIX + ChatColor.GOLD + "Disabled " + ChatColor.GRAY + "guild chat spy.");
|
|
return true;
|
|
}
|
|
|
|
GUILD_CHAT_SPY.add(player);
|
|
sender.sendMessage(PREFIX + ChatColor.GOLD + "Enabled " + ChatColor.GRAY + "guild chat spy.");
|
|
return true;
|
|
}
|
|
}
|