Move tablist stuff to portal, show current server on tablist

This commit is contained in:
Shaun Bennett 2015-02-05 23:20:39 -05:00
parent 2f64b5f401
commit fcb3d20778
2 changed files with 16 additions and 6 deletions

View File

@ -6,7 +6,10 @@ import java.io.IOException;
import java.util.HashSet;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.plugin.java.JavaPlugin;
import mineplex.core.MiniPlugin;
@ -16,7 +19,9 @@ import mineplex.core.common.util.C;
import mineplex.core.common.util.Callback;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.portal.Commands.*;
import mineplex.core.common.util.UtilTabTitle;
import mineplex.core.portal.Commands.SendCommand;
import mineplex.core.portal.Commands.ServerCommand;
import mineplex.serverdata.MinecraftServer;
import mineplex.serverdata.Region;
import mineplex.serverdata.ServerCommandManager;
@ -52,6 +57,15 @@ public class Portal extends MiniPlugin
// Register the server command type for future use
ServerCommandManager.getInstance().registerCommandType("TransferCommand", TransferCommand.class, new TransferHandler());
}
@EventHandler
public void join(PlayerJoinEvent event)
{
Player player = event.getPlayer();
//Player List
String serverName = _plugin.getConfig().getString("serverstatus.name");
UtilTabTitle.setHeaderAndFooter(player, C.Bold + "Mineplex Network " + C.cGreen + serverName, "Visit " + C.cGreen + "www.mineplex.com" + ChatColor.RESET + " for News, Forums and Shop");
}
public void sendAllPlayers(String serverName)
{

View File

@ -56,7 +56,6 @@ import mineplex.core.common.util.UtilInv;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilTabTitle;
import mineplex.core.common.util.UtilTime;
import mineplex.core.common.util.UtilWorld;
import mineplex.core.cosmetic.CosmeticManager;
@ -513,10 +512,7 @@ public class HubManager extends MiniClientPlugin<HubClient>
public void PlayerJoin(PlayerJoinEvent event)
{
Player player = event.getPlayer();
//Player List
UtilTabTitle.setHeaderAndFooter(player, " ", "Visit " + C.cGreen + "www.mineplex.com" + ChatColor.RESET + " for News, Forums and Shop");
//Public Message
if (_clientManager.Get(player).GetRank() != Rank.LEGEND)
event.setJoinMessage(null);