Only show 5 open servers on Server Gui
This commit is contained in:
parent
0b942e5180
commit
04487fae3e
@ -187,9 +187,10 @@ public class ServerNpcPage extends ShopPageBase<ServerManager, ServerNpcShop> im
|
||||
|
||||
private void buildAvailableServerPage(List<ServerInfo> serverList, int slotsNeeded)
|
||||
{
|
||||
int serversToShow = 5;
|
||||
int greenCount = 0;
|
||||
int yellowCount = 0;
|
||||
int greenStartSlot = 19;
|
||||
int greenStartSlot = 18 + ((9 - serversToShow) / 2);
|
||||
boolean showGreen = true;
|
||||
|
||||
long portalTime = Plugin.getMillisecondsUntilPortal(Player);
|
||||
@ -203,7 +204,7 @@ public class ServerNpcPage extends ShopPageBase<ServerManager, ServerNpcShop> im
|
||||
{
|
||||
int slot = greenCount + greenStartSlot;
|
||||
|
||||
if (isStarting(serverInfo) && hasEnoughSlots(serverInfo, slotsNeeded) && greenCount < 7)
|
||||
if (isStarting(serverInfo) && hasEnoughSlots(serverInfo, slotsNeeded) && greenCount < serversToShow)
|
||||
{
|
||||
if (showGreen)
|
||||
{
|
||||
@ -232,7 +233,7 @@ public class ServerNpcPage extends ShopPageBase<ServerManager, ServerNpcShop> im
|
||||
// Clear empty slots
|
||||
if (showGreen)
|
||||
{
|
||||
for (int i = greenCount + greenStartSlot; i < greenStartSlot + 7; i++)
|
||||
for (int i = greenCount + greenStartSlot; i < greenStartSlot + serversToShow; i++)
|
||||
{
|
||||
setItem(i, null);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user