mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2025-06-11 13:33:54 +00:00
fuck intellij
This commit is contained in:
@ -3,11 +3,7 @@ package me.totalfreedom.totalfreedommod.command;
|
||||
import de.myzelyam.api.vanish.VanishAPI;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
<<<<<<< HEAD
|
||||
import me.totalfreedom.totalfreedommod.admin.Admin;
|
||||
=======
|
||||
import me.totalfreedom.totalfreedommod.staff.StaffMember;
|
||||
>>>>>>> parent of da80f1b6... Revert "Merge branch 'development' of https://github.com/TFPatches/TotalFreedomMod into development"
|
||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||
import me.totalfreedom.totalfreedommod.rank.Displayable;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
@ -113,19 +109,11 @@ public class Command_list extends FreedomCommand
|
||||
{
|
||||
continue;
|
||||
}
|
||||
<<<<<<< HEAD
|
||||
if (listFilter == ListFilter.ADMINS && plugin.al.isVanished(p))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (listFilter == ListFilter.VANISHED_ADMINS && !plugin.al.isVanished(p))
|
||||
=======
|
||||
if (listFilter == ListFilter.STAFF && plugin.sl.isVanished(p))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (listFilter == ListFilter.VANISHED_STAFF && !plugin.sl.isVanished(p))
|
||||
>>>>>>> parent of da80f1b6... Revert "Merge branch 'development' of https://github.com/TFPatches/TotalFreedomMod into development"
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
@ -1,47 +1,119 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import de.myzelyam.api.vanish.VanishAPI;
|
||||
import me.totalfreedom.totalfreedommod.player.PlayerData;
|
||||
import me.totalfreedom.totalfreedommod.rank.Displayable;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FLog;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import net.md_5.bungee.api.ChatMessageType;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
import static me.totalfreedom.totalfreedommod.util.FUtil.playerMsg;
|
||||
|
||||
<<<<<<< HEAD
|
||||
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.ONLY_IN_GAME)
|
||||
=======
|
||||
@CommandPermissions(level = Rank.TRIAL_MOD, source = SourceType.ONLY_IN_GAME)
|
||||
>>>>>>> parent of da80f1b6... Revert "Merge branch 'development' of https://github.com/TFPatches/TotalFreedomMod into development"
|
||||
@CommandParameters(description = "Hide yourself from other players", usage = "/<command> [-s]", aliases = "v,ev,evanish")
|
||||
@CommandParameters(description = "Vanish/unvanish yourself.", usage = "/<command> [-s[ilent]]", aliases = "v")
|
||||
public class Command_vanish extends FreedomCommand
|
||||
{
|
||||
@Override
|
||||
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
||||
|
||||
public boolean run(final CommandSender sender, final Player playerSender, final Command cmd, final String commandLabel, final String[] args, final boolean senderIsConsole)
|
||||
{
|
||||
if (args.length == 0)
|
||||
Displayable display = plugin.rm.getDisplay(playerSender);
|
||||
String displayName = display.getColor() + playerSender.getName();
|
||||
String tag = display.getColoredTag();
|
||||
boolean silent = false;
|
||||
if (args.length > 0)
|
||||
{
|
||||
if (!VanishAPI.isInvisible(playerSender))
|
||||
if (args[0].equalsIgnoreCase("-s") || args[0].equalsIgnoreCase("-silent"))
|
||||
{
|
||||
VanishAPI.hidePlayer(playerSender);
|
||||
}
|
||||
else
|
||||
{
|
||||
VanishAPI.showPlayer(playerSender);
|
||||
silent = true;
|
||||
}
|
||||
}
|
||||
else if (args[0].equalsIgnoreCase("-s") || args[0].equalsIgnoreCase("-v"))
|
||||
|
||||
if (plugin.al.isVanished(playerSender.getName()))
|
||||
{
|
||||
if (!VanishAPI.isInvisible(playerSender))
|
||||
if (silent)
|
||||
{
|
||||
VanishAPI.getPlugin().getVisibilityChanger().hidePlayer(playerSender, null, true);
|
||||
msg(ChatColor.GOLD + "Silently unvanished.");
|
||||
}
|
||||
else
|
||||
{
|
||||
VanishAPI.getPlugin().getVisibilityChanger().showPlayer(playerSender, null, true);
|
||||
msg("You have unvanished.", ChatColor.GOLD);
|
||||
FUtil.bcastMsg(plugin.rm.craftLoginMessage(playerSender, null));
|
||||
FUtil.bcastMsg(playerSender.getName() + " joined the game.", ChatColor.YELLOW);
|
||||
plugin.dc.messageChatChannel("**" + playerSender.getName() + " joined the server" + "**");
|
||||
}
|
||||
|
||||
PlayerData playerData = plugin.pl.getData(playerSender);
|
||||
if (playerData.getTag() != null)
|
||||
{
|
||||
tag = FUtil.colorize(playerData.getTag());
|
||||
}
|
||||
|
||||
plugin.pl.getData(playerSender).setTag(tag);
|
||||
FLog.info(playerSender.getName() + " is no longer vanished.");
|
||||
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
{
|
||||
if (plugin.al.isAdmin(player))
|
||||
{
|
||||
playerMsg(player, ChatColor.YELLOW + sender.getName() + " has unvanished and is now visible to everyone.");
|
||||
}
|
||||
if (!plugin.al.isAdmin(player))
|
||||
{
|
||||
player.showPlayer(plugin, playerSender);
|
||||
}
|
||||
}
|
||||
plugin.esb.setVanished(playerSender.getName(), false);
|
||||
playerSender.setPlayerListName(StringUtils.substring(displayName, 0, 16));
|
||||
plugin.al.vanished.remove(playerSender.getName());
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
new BukkitRunnable()
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
if (plugin.al.isVanished(playerSender.getName()))
|
||||
{
|
||||
playerSender.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(ChatColor.GOLD + "You are hidden from other players."));
|
||||
}
|
||||
}
|
||||
}.runTaskTimer(plugin, 0L, 4L);
|
||||
|
||||
if (silent)
|
||||
{
|
||||
msg("Silently vanished.", ChatColor.GOLD);
|
||||
}
|
||||
else
|
||||
{
|
||||
msg ("You have vanished.", ChatColor.GOLD);
|
||||
FUtil.bcastMsg(playerSender.getName() + " left the game.", ChatColor.YELLOW);
|
||||
plugin.dc.messageChatChannel("**" + playerSender.getName() + " left the server" + "**");
|
||||
}
|
||||
|
||||
FLog.info(playerSender.getName() + " is now vanished.");
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
{
|
||||
{
|
||||
if (plugin.al.isAdmin(player))
|
||||
{
|
||||
playerMsg(player, ChatColor.YELLOW + sender.getName() + " has vanished and is now only visible to admins.");
|
||||
}
|
||||
if (!plugin.al.isAdmin(player))
|
||||
{
|
||||
player.hidePlayer(plugin, playerSender);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
plugin.esb.setVanished(playerSender.getName(), true);
|
||||
plugin.sl.vanished.add(playerSender.getName());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user