More improvements. (#15)

* This is rediculous

* Forgot some final and this

* Fixed and improved skull caging

* Windows wanted this yeah
This commit is contained in:
Seth
2017-12-31 20:43:10 -07:00
committed by Lemon
parent d9d1d4fa9b
commit 059bf14d90
16 changed files with 381 additions and 278 deletions

View File

@ -1,5 +1,3 @@
package me.totalfreedom.totalfreedommod.command;
import java.util.Iterator;
@ -18,51 +16,50 @@ import org.bukkit.entity.Player;
import java.util.ArrayList;
import me.totalfreedom.totalfreedommod.rank.Rank;
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.ONLY_IN_GAME, blockHostConsole = true)
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.ONLY_IN_GAME)
@CommandParameters(description = "Vanish/unvanish yourself.", usage = "/<command>", aliases = "v")
public class Command_vanish extends FreedomCommand
{
public static ArrayList<Player> vanished;
public static ArrayList<Player> VANISHED = new ArrayList<Player>();
public boolean run(final CommandSender sender, final Player playerSender, final Command cmd, final String commandLabel, final String[] args, final boolean senderIsConsole) {
final Displayable display = ((TotalFreedomMod)this.plugin).rm.getDisplay((CommandSender)playerSender);
Displayable display = plugin.rm.getDisplay(playerSender);
String loginMsg = display.getColoredLoginMessage();
final String displayName = display.getColor() + playerSender.getName();
final Admin admin = ((TotalFreedomMod)this.plugin).al.getAdmin(playerSender);
if (Command_vanish.vanished.contains(playerSender)) {
this.msg(ChatColor.GOLD + "You have been unvanished.");
if (admin.hasLoginMessage()) {
String displayName = display.getColor() + playerSender.getName();
Admin admin = plugin.al.getAdmin(playerSender);
if (VANISHED.contains(playerSender))
{
msg(ChatColor.GOLD + "You have been unvanished.");
if (admin.hasLoginMessage())
{
loginMsg = FUtil.colorize(admin.getLoginMessage());
}
FUtil.bcastMsg(ChatColor.AQUA + playerSender.getName() + " is " + loginMsg);
FUtil.bcastMsg(playerSender.getName() + " joined the game", ChatColor.YELLOW);
((TotalFreedomMod)this.plugin).pl.getPlayer(playerSender).setTag(display.getColoredTag());
plugin.pl.getPlayer(playerSender).setTag(display.getColoredTag());
FLog.info(playerSender.getName() + " is no longer vanished.");
for (final Player player : this.server.getOnlinePlayers()) {
for (Player player : server.getOnlinePlayers())
{
player.showPlayer(playerSender);
}
((TotalFreedomMod)this.plugin).esb.setVanished(playerSender.getName(), false);
plugin.esb.setVanished(playerSender.getName(), false);
playerSender.removePotionEffect(PotionEffectType.INVISIBILITY);
playerSender.setPlayerListName(StringUtils.substring(displayName, 0, 16));
Command_vanish.vanished.remove(playerSender);
return true;
VANISHED.remove(playerSender);
}
if (!Command_vanish.vanished.contains(playerSender)) {
this.msg(ChatColor.GOLD + "You have been vanished.");
else
{
msg("You have been vanished.", ChatColor.GOLD);
FUtil.bcastMsg(playerSender.getName() + " left the game", ChatColor.YELLOW);
FLog.info(playerSender.getName() + " is now vanished.");
for (final Player player : this.server.getOnlinePlayers()) {
for (Player player : server.getOnlinePlayers())
{
player.hidePlayer(playerSender);
}
((TotalFreedomMod)this.plugin).esb.setVanished(playerSender.getName(), true);
plugin.esb.setVanished(playerSender.getName(), true);
playerSender.addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, 1000000, 1000000, true, false));
Command_vanish.vanished.add(playerSender);
return true;
VANISHED.add(playerSender);
}
return true;
}
static {
Command_vanish.vanished = new ArrayList<Player>();
}
}