mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-27 01:05:38 +00:00
Add a silent option for the vanish command
This commit is contained in:
parent
bd44173a14
commit
92d63180f9
@ -15,7 +15,7 @@ import java.util.ArrayList;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
|
||||
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.ONLY_IN_GAME)
|
||||
@CommandParameters(description = "Vanish/unvanish yourself.", usage = "/<command>", aliases = "v")
|
||||
@CommandParameters(description = "Vanish/unvanish yourself.", usage = "/<command> [-s[ilent]]", aliases = "v")
|
||||
public class Command_vanish extends FreedomCommand
|
||||
{
|
||||
public static ArrayList<Player> VANISHED = new ArrayList<Player>();
|
||||
@ -26,6 +26,14 @@ public class Command_vanish extends FreedomCommand
|
||||
String displayName = display.getColor() + playerSender.getName();
|
||||
String tag = display.getColoredTag();
|
||||
Admin admin = plugin.al.getAdmin(playerSender);
|
||||
boolean silent = false;
|
||||
if (args.length > 0)
|
||||
{
|
||||
if (args[0].equalsIgnoreCase("-s") || args[0].equalsIgnoreCase("-silent"))
|
||||
{
|
||||
silent = true;
|
||||
}
|
||||
}
|
||||
if (VANISHED.contains(playerSender))
|
||||
{
|
||||
msg(ChatColor.GOLD + "You have been unvanished.");
|
||||
@ -33,8 +41,11 @@ public class Command_vanish extends FreedomCommand
|
||||
{
|
||||
loginMsg = FUtil.colorize(admin.getLoginMessage());
|
||||
}
|
||||
if (!silent)
|
||||
{
|
||||
FUtil.bcastMsg(ChatColor.AQUA + playerSender.getName() + " is " + loginMsg);
|
||||
FUtil.bcastMsg(playerSender.getName() + " joined the game", ChatColor.YELLOW);
|
||||
}
|
||||
if (admin.getTag() != null)
|
||||
{
|
||||
tag = FUtil.colorize(admin.getTag());
|
||||
@ -56,7 +67,10 @@ public class Command_vanish extends FreedomCommand
|
||||
else
|
||||
{
|
||||
msg("You have been vanished.", ChatColor.GOLD);
|
||||
if (!silent)
|
||||
{
|
||||
FUtil.bcastMsg(playerSender.getName() + " left the game", ChatColor.YELLOW);
|
||||
}
|
||||
FLog.info(playerSender.getName() + " is now vanished.");
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user