Pushing changes to go help william

This commit is contained in:
Shaun Bennett 2015-12-10 20:51:34 -05:00
parent 4d8b8bd58b
commit 16f39c1e71
5 changed files with 55 additions and 28 deletions

View File

@ -106,6 +106,11 @@ public class F
return rank.getTag(false, false);
}
public static String value(String variable, int value)
{
return value(variable, "" + value);
}
public static String value(String variable, String value)
{
return value(0, variable, value);

View File

@ -65,8 +65,8 @@ public class Menu extends ShopPageBase<CosmeticManager, CosmeticShop>
addButton(37, new ShopItem(Material.GOLD_HELMET, "Hats", 1, false), new OpenHats(this));
addButton(39, new ShopItem(Material.DIAMOND_CHESTPLATE, "Costumes", 1, false), new OpenCostumes(this));
addButton(42, new ShopItem(Material.GREEN_RECORD, "Music", 1, false), new OpenMusic(this));
addButton(44, new ShopItem(Material.NAME_TAG, "Taunts", 1, false), new IButton()
addButton(41, new ShopItem(Material.GREEN_RECORD, "Music", 1, false), new OpenMusic(this));
addButton(43, new ShopItem(Material.NAME_TAG, "Taunts", 1, false), new IButton()
{
@Override
public void onClick(Player player, ClickType clickType)
@ -84,37 +84,37 @@ public class Menu extends ShopPageBase<CosmeticManager, CosmeticShop>
switch (type)
{
case Particle:
slot = 10;
slot = 1;
break;
case ArrowTrail:
slot = 12;
slot = 3;
break;
case DoubleJump:
slot = 14;
slot = 5;
break;
case Death:
slot = 16;
slot = 7;
break;
case Item:
slot = 28;
slot = 19;
break;
case Morph:
slot = 30;
slot = 21;
break;
case Hat:
slot = 46;
slot = 37;
break;
case Costume:
slot = 48;
slot = 39;
break;
case MusicDisc:
slot = 50;
slot = 41;
break;
case Taunt:
slot = 52;
slot = 43;
break;
default:
slot = 10;
slot = 1;
break;
}
slot += 9;
@ -134,7 +134,7 @@ public class Menu extends ShopPageBase<CosmeticManager, CosmeticShop>
{
final Mount<?> mount = getPlugin().getMountManager().getActive(getPlayer());
addButton(32 + 9,
addButton(23 + 9,
new ShopItem(mount.GetDisplayMaterial(), mount.GetDisplayData(), C.mItem + mount.GetName(), new String[0], 1, false, false),
new IButton()
{
@ -151,7 +151,7 @@ public class Menu extends ShopPageBase<CosmeticManager, CosmeticShop>
{
Creature activePet = getPlugin().getPetManager().getActivePet(getPlayer().getName());
String petName = activePet.getType() == EntityType.WITHER ? "Widder" : activePet.getCustomName();
addButton(34 + 9, new ShopItem(Material.MONSTER_EGG, (byte) getPlugin().getPetManager().getActivePet(getPlayer().getName()).getType().getTypeId(), C.mItem + petName, new String[0], 1, false, false),
addButton(25 + 9, new ShopItem(Material.MONSTER_EGG, (byte) getPlugin().getPetManager().getActivePet(getPlayer().getName()).getType().getTypeId(), C.mItem + petName, new String[0], 1, false, false),
new IButton()
{
public void onClick(Player player, ClickType clickType)

View File

@ -29,6 +29,7 @@ import mineplex.core.status.ServerStatusManager;
*/
public class TreasureManager extends MiniPlugin
{
private CoreClientManager _clientManager;
private RewardManager _rewardManager;
private InventoryManager _inventoryManager;
private BlockRestore _blockRestore;
@ -40,6 +41,7 @@ public class TreasureManager extends MiniPlugin
{
super("Treasure", plugin);
_clientManager = clientManager;
_inventoryManager = inventoryManager;
_blockRestore = blockRestore;
_hologramManager = hologramManager;
@ -155,4 +157,9 @@ public class TreasureManager extends MiniPlugin
{
return _blockRestore;
}
public CoreClientManager getClientManager()
{
return _clientManager;
}
}

View File

@ -13,7 +13,7 @@ public enum TreasureType
MYTHICAL(C.cRed + "Mythical Chest", "Mythical Chest", "Mythical", RewardType.MythicalChest, Material.ENDER_CHEST, TreasureStyle.MYTHICAL),
CHRISTMAS(C.cAqua + "Christmas Chest", "Christmas Chest", "Christmas", RewardType.MythicalChest, Material.CHEST, TreasureStyle.CHRISTMAS);
CHRISTMAS(C.cDGreen + "Winter Holiday Chest", "Winter Chest", "Christmas", RewardType.MythicalChest, Material.CHEST, TreasureStyle.CHRISTMAS);
private final String _name;
private final RewardType _rewardType;

View File

@ -6,10 +6,12 @@ import java.util.List;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import mineplex.core.account.CoreClientManager;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilSkull;
import mineplex.core.donation.DonationManager;
import mineplex.core.inventory.InventoryManager;
import mineplex.core.shop.item.ShopItem;
@ -25,7 +27,7 @@ public class TreasurePage extends ShopPageBase<TreasureManager, TreasureShop>
public TreasurePage(TreasureManager plugin, TreasureShop shop, TreasureLocation treasureLocation, CoreClientManager clientManager, DonationManager donationManager, InventoryManager inventoryManager, Player player)
{
super(plugin, shop, clientManager, donationManager, "Open Treasure", player, 9);
super(plugin, shop, clientManager, donationManager, "Open Treasure", player, 54);
_treasureLocation = treasureLocation;
_inventoryManager = inventoryManager;
@ -36,11 +38,21 @@ public class TreasurePage extends ShopPageBase<TreasureManager, TreasureShop>
@Override
protected void buildPage()
{
int treasureShards = getDonationManager().Get(getPlayer()).getCoins();
int basicCount = _inventoryManager.Get(getPlayer()).getItemCount(TreasureType.OLD.getItemName());
int heroicCount = _inventoryManager.Get(getPlayer()).getItemCount(TreasureType.ANCIENT.getItemName());
int legendaryCount = _inventoryManager.Get(getPlayer()).getItemCount(TreasureType.MYTHICAL.getItemName());
int christmasCount = _inventoryManager.Get(getPlayer()).getItemCount(TreasureType.CHRISTMAS.getItemName());
List<String> shardLore = new ArrayList<String>();
shardLore.add(" ");
shardLore.add(F.value("Treasure Shards", "" + treasureShards));
shardLore.add(" ");
shardLore.add(C.cGray + "Useless by itself, Treasure Shards");
shardLore.add(C.cGray + "can be combined to forge new");
shardLore.add(C.cGray + "and undiscovered treasures.");
List<String> basicLore = new ArrayList<String>();
basicLore.add(" ");
basicLore.add(F.value("Old Chests Owned", "" + basicCount));
@ -118,21 +130,24 @@ public class TreasurePage extends ShopPageBase<TreasureManager, TreasureShop>
christmasLore.add(ChatColor.RESET + "or Purchase at: " + C.cYellow + "www.mineplex.com/shop");
}
ShopItem shards = new ShopItem(Material.PRISMARINE_SHARD, C.cAqua + C.Bold + "Treasure Shards", shardLore.toArray(new String[0]), 0, false);
ShopItem basic = new ShopItem(Material.CHEST, C.cGreen + C.Bold + "Old Chest", basicLore.toArray(new String[0]), 0, false, false);
ShopItem heroic = new ShopItem(Material.TRAPPED_CHEST, C.cGold + C.Bold + "Ancient Chest", heroicLore.toArray(new String[0]), 0, false, false);
ShopItem legendary = new ShopItem(Material.ENDER_CHEST, C.cRed + C.Bold + "Mythical Chest", legendaryLore.toArray(new String[0]), 0, false, false);
ShopItem christmas = new ShopItem(Material.SNOW_BALL, C.cAqua + C.Bold + "Christmas Chest", christmasLore.toArray(new String[0]), 0, false, false);
ItemStack christmas = UtilSkull.getPlayerHead("MHF_Present2", C.cDGreen + C.Bold + "Winter Holiday Chest", christmasLore);
if (basicCount > 0) addButton(1, basic, new OpenTreasureButton(getPlayer(), _treasureLocation, TreasureType.OLD));
else addButton(1, basic, new BuyChestButton(getPlayer(), _inventoryManager, this, "Old Chest", Material.CHEST, 1000));
if (heroicCount > 0) addButton(3, heroic, new OpenTreasureButton(getPlayer(), _treasureLocation, TreasureType.ANCIENT));
else addButton(3, heroic, new BuyChestButton(getPlayer(), _inventoryManager, this, "Ancient Chest", Material.CHEST, 5000));
if (legendaryCount > 0) addButton(5, legendary, new OpenTreasureButton(getPlayer(), _treasureLocation, TreasureType.MYTHICAL));
else addButton(5, legendary, new BuyChestButton(getPlayer(), _inventoryManager, this, "Mythical Chest", Material.ENDER_CHEST, 10000));
addItem(40, shards);
if (christmasCount > 0) addButton(6, christmas, new OpenTreasureButton(getPlayer(), _treasureLocation, TreasureType.CHRISTMAS));
else addButton(6, christmas, new BuyChestButton(getPlayer(), _inventoryManager, this, "Christmas Chest", Material.SNOW_BALL, 10000));
if (basicCount > 0) addButton(20, basic, new OpenTreasureButton(getPlayer(), _treasureLocation, TreasureType.OLD));
else addButton(20, basic, new BuyChestButton(getPlayer(), _inventoryManager, this, "Old Chest", Material.CHEST, 1000));
if (heroicCount > 0) addButton(22, heroic, new OpenTreasureButton(getPlayer(), _treasureLocation, TreasureType.ANCIENT));
else addButton(22, heroic, new BuyChestButton(getPlayer(), _inventoryManager, this, "Ancient Chest", Material.CHEST, 5000));
if (legendaryCount > 0) addButton(24, legendary, new OpenTreasureButton(getPlayer(), _treasureLocation, TreasureType.MYTHICAL));
else addButton(24, legendary, new BuyChestButton(getPlayer(), _inventoryManager, this, "Mythical Chest", Material.ENDER_CHEST, 10000));
if (christmasCount > 0) addButton(4, christmas, new OpenTreasureButton(getPlayer(), _treasureLocation, TreasureType.CHRISTMAS));
else addButton(4, christmas, new BuyChestButton(getPlayer(), _inventoryManager, this, "Winter Holiday Chest", Material.SNOW_BALL, 10000));
}
}