mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-30 10:05:59 +00:00
Merge pull request #175 from Wild1145/master
Added Telent check along with Auto Prefix and Auto color tab
This commit is contained in:
commit
d9e0791a3b
@ -775,4 +775,32 @@ public class TFM_PlayerListener implements Listener
|
|||||||
{
|
{
|
||||||
TFM_ServerInterface.handlePlayerLogin(event);
|
TFM_ServerInterface.handlePlayerLogin(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Player Tab and auto Tags
|
||||||
|
|
||||||
|
@EventHandler(priority = EventPriority.HIGH)
|
||||||
|
public static void onPlayerJoinEvent(PlayerJoinEvent event)
|
||||||
|
{
|
||||||
|
Player player = event.getPlayer();
|
||||||
|
if (TFM_Util.DEVELOPERS.contains(player.getName()))
|
||||||
|
{
|
||||||
|
player.setPlayerListName(ChatColor.DARK_PURPLE + player.getName());
|
||||||
|
TFM_PlayerData.getPlayerData(player).setTag("&8[&5Developer&8]");
|
||||||
|
}
|
||||||
|
else if (TFM_AdminList.isSeniorAdmin(player))
|
||||||
|
{
|
||||||
|
player.setPlayerListName(ChatColor.LIGHT_PURPLE + player.getName());
|
||||||
|
TFM_PlayerData.getPlayerData(player).setTag("&8[&dSenior Admin&8]");
|
||||||
|
}
|
||||||
|
else if (TFM_AdminList.isTelnetAdmin(player, true))
|
||||||
|
{
|
||||||
|
player.setPlayerListName(ChatColor.GREEN + player.getName());
|
||||||
|
TFM_PlayerData.getPlayerData(player).setTag("&8[&2Telnet Admin&8]");
|
||||||
|
}
|
||||||
|
else if (TFM_AdminList.isSuperAdmin(player))
|
||||||
|
{
|
||||||
|
player.setPlayerListName(ChatColor.AQUA + player.getName());
|
||||||
|
TFM_PlayerData.getPlayerData(player).setTag("&8[&BSuper Admin&8]");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -405,6 +405,25 @@ public class TFM_AdminList
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean isTelnetAdmin(CommandSender sender, boolean verifySuperadmin)
|
||||||
|
{
|
||||||
|
if (verifySuperadmin)
|
||||||
|
{
|
||||||
|
if (!isSuperAdmin(sender))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
final TFM_Admin entry = getEntry((Player) sender);
|
||||||
|
if (entry != null)
|
||||||
|
{
|
||||||
|
return entry.isTelnetAdmin();
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public static boolean isIdentityMatched(Player player)
|
public static boolean isIdentityMatched(Player player)
|
||||||
{
|
{
|
||||||
if (!isSuperAdmin(player))
|
if (!isSuperAdmin(player))
|
||||||
|
Loading…
Reference in New Issue
Block a user