mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2025-07-02 04:56:40 +00:00
1.16, overhaul of player data
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import me.totalfreedom.totalfreedommod.admin.Admin;
|
||||
import me.totalfreedom.totalfreedommod.player.PlayerData;
|
||||
import me.totalfreedom.totalfreedommod.rank.Displayable;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FLog;
|
||||
@ -11,8 +11,6 @@ import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.potion.PotionEffect;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
import static me.totalfreedom.totalfreedommod.util.FUtil.playerMsg;
|
||||
|
||||
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.ONLY_IN_GAME)
|
||||
@ -23,7 +21,6 @@ public class Command_vanish extends FreedomCommand
|
||||
public boolean run(final CommandSender sender, final Player playerSender, final Command cmd, final String commandLabel, final String[] args, final boolean senderIsConsole)
|
||||
{
|
||||
Displayable display = plugin.rm.getDisplay(playerSender);
|
||||
String loginMsg = display.getColoredLoginMessage();
|
||||
String displayName = display.getColor() + playerSender.getName();
|
||||
String tag = display.getColoredTag();
|
||||
Admin admin = plugin.al.getAdmin(playerSender);
|
||||
@ -38,21 +35,18 @@ public class Command_vanish extends FreedomCommand
|
||||
if (plugin.al.vanished.contains(playerSender))
|
||||
{
|
||||
msg(ChatColor.GOLD + "You have been unvanished.");
|
||||
if (admin.hasLoginMessage())
|
||||
{
|
||||
loginMsg = FUtil.colorize(admin.getLoginMessage()).replace("%rank%", plugin.rm.getDisplay(admin).getName()).replace("%coloredrank%", plugin.rm.getDisplay(admin).getColoredName()).replace("%name%", admin.getName());
|
||||
}
|
||||
if (!silent)
|
||||
{
|
||||
FUtil.bcastMsg(plugin.rm.craftLoginMessage(playerSender, null));
|
||||
FUtil.bcastMsg(playerSender.getName() + " joined the game.", ChatColor.YELLOW);
|
||||
plugin.dc.messageChatChannel("**" + playerSender.getName() + " joined the server" + "**");
|
||||
}
|
||||
if (admin.getTag() != null)
|
||||
PlayerData playerData = plugin.pl.getData(playerSender);
|
||||
if (playerData.getTag() != null)
|
||||
{
|
||||
tag = FUtil.colorize(admin.getTag());
|
||||
tag = FUtil.colorize(playerData.getTag());
|
||||
}
|
||||
plugin.pl.getPlayer(playerSender).setTag(tag);
|
||||
plugin.pl.getData(playerSender).setTag(tag);
|
||||
FLog.info(playerSender.getName() + " is no longer vanished.");
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
{
|
||||
@ -79,9 +73,13 @@ public class Command_vanish extends FreedomCommand
|
||||
{
|
||||
{
|
||||
if (plugin.al.isAdmin(player))
|
||||
playerMsg(player, ChatColor.YELLOW + sender.getName() + " has vanished and is now only visible to admins." );
|
||||
{
|
||||
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);
|
||||
|
Reference in New Issue
Block a user