Merge branch 'master' of ssh://184.154.0.242:7999/min/mineplex

This commit is contained in:
Chiss 2014-08-10 00:57:17 +10:00
commit 53221e267e
5 changed files with 20 additions and 6 deletions

View File

@ -70,7 +70,7 @@ public class PetTagPage extends ShopPageBase<CosmeticManager, CosmeticShop>
return; return;
} }
PetExtra tag = new PetExtra("Rename " + _pet.GetName() + " to " + _tagName, Material.NAME_TAG, 1000); PetExtra tag = new PetExtra("Rename " + _pet.GetName() + " to " + _tagName, Material.NAME_TAG, 100);
_pet.setDisplayName(C.cGreen + "Purchase " + _tagName); _pet.setDisplayName(C.cGreen + "Purchase " + _tagName);

View File

@ -110,9 +110,12 @@ public class GadgetManager extends MiniPlugin
{ {
for (GadgetType gadgetType : _gadgets.keySet()) for (GadgetType gadgetType : _gadgets.keySet())
{ {
for (Gadget gadget : _gadgets.get(gadgetType)) if (gadgetType == GadgetType.Particle && _clientManager.Get(event.getPlayer()).GetRank().Has(Rank.ADMIN))
{ {
_donationManager.Get(event.getPlayer().getName()).AddUnknownSalesPackagesOwned(gadget.GetName()); for (Gadget gadget : _gadgets.get(gadgetType))
{
_donationManager.Get(event.getPlayer().getName()).AddUnknownSalesPackagesOwned(gadget.GetName());
}
} }
} }
} }

View File

@ -20,7 +20,7 @@ public class PetExtra extends SalesPackageBase
_name = name; _name = name;
_material = material; _material = material;
CurrencyCostMap.put(CurrencyType.Gems, cost); CurrencyCostMap.put(CurrencyType.Coins, cost);
KnownPackage = false; KnownPackage = false;
OneTimePurchaseOnly = false; OneTimePurchaseOnly = false;

View File

@ -60,7 +60,7 @@ public class PetFactory
private void CreatePetExtras() private void CreatePetExtras()
{ {
_petExtras.put(Material.SIGN, new PetExtra("Name Tag", Material.NAME_TAG, 1000)); _petExtras.put(Material.SIGN, new PetExtra("Name Tag", Material.NAME_TAG, 100));
List<PetExtraToken> petExtraTokens = new ArrayList<PetExtraToken>(); List<PetExtraToken> petExtraTokens = new ArrayList<PetExtraToken>();

View File

@ -187,9 +187,10 @@ public class ServerNpcPage extends ShopPageBase<ServerManager, ServerNpcShop> im
private void buildAvailableServerPage(List<ServerInfo> serverList, int slotsNeeded) private void buildAvailableServerPage(List<ServerInfo> serverList, int slotsNeeded)
{ {
int serversToShow = 5; int serversToShow = 7;
int greenCount = 0; int greenCount = 0;
int yellowCount = 0; int yellowCount = 0;
int maxFull = 3;
int greenStartSlot = 18 + ((9 - serversToShow) / 2); int greenStartSlot = 18 + ((9 - serversToShow) / 2);
boolean showGreen = true; boolean showGreen = true;
@ -200,6 +201,8 @@ public class ServerNpcPage extends ShopPageBase<ServerManager, ServerNpcShop> im
showGreen = false; showGreen = false;
} }
int fullCount = 0;
for (ServerInfo serverInfo : serverList) for (ServerInfo serverInfo : serverList)
{ {
int slot = greenCount + greenStartSlot; int slot = greenCount + greenStartSlot;
@ -208,11 +211,19 @@ public class ServerNpcPage extends ShopPageBase<ServerManager, ServerNpcShop> im
{ {
if (showGreen) if (showGreen)
{ {
boolean full = serverInfo.MaxPlayers - serverInfo.CurrentPlayers <= 0;
if (full && fullCount >= maxFull)
continue;
ShopItem shopItem = buildShopItem(serverInfo, slotsNeeded); ShopItem shopItem = buildShopItem(serverInfo, slotsNeeded);
greenCount++; greenCount++;
AddButton(slot, shopItem, new JoinServerButton(this, serverInfo)); AddButton(slot, shopItem, new JoinServerButton(this, serverInfo));
if (full)
fullCount++;
} }
} }
else if (isInProgress(serverInfo)) else if (isInProgress(serverInfo))