Manually open clans ui

This commit is contained in:
Sam 2017-10-13 23:26:30 +01:00 committed by cnr
parent 6f4d68087f
commit 6bc167fca7

View File

@ -3,6 +3,7 @@ package mineplex.hub.server.ui.clans;
import mineplex.core.account.CoreClientManager;
import mineplex.core.common.util.F;
import mineplex.core.donation.DonationManager;
import mineplex.core.newnpc.event.NPCInteractEvent;
import mineplex.core.party.Party;
import mineplex.core.shop.ShopBase;
import mineplex.core.shop.page.ShopPageBase;
@ -10,9 +11,13 @@ import mineplex.hub.server.ServerManager;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
public class ClansServerShop extends ShopBase<ServerManager>
{
private static final String NPC_METADATA = "GAME_Clans";
public ClansServerShop(ServerManager plugin, CoreClientManager clientManager, DonationManager donationManager)
{
super(plugin, clientManager, donationManager, "Clans");
@ -48,4 +53,13 @@ public class ClansServerShop extends ShopBase<ServerManager>
{
getPlugin().getHubManager().GetVisibility().removeHiddenPlayer(player);
}
@EventHandler
public void npcInteract(NPCInteractEvent event)
{
if (event.getNpc().getMetadata().equals(NPC_METADATA))
{
attemptShopOpen(event.getPlayer());
}
}
}