From 31c4a95da5f4f6ec4a770849991371a2f1ba265a Mon Sep 17 00:00:00 2001 From: Chiss Date: Sat, 13 Sep 2014 16:43:18 +1000 Subject: [PATCH] Disabled Treasure Chests --- .../mineplex/core/cosmetic/ui/page/Menu.java | 20 ++++++++++++------- .../core/treasure/TreasureManager.java | 6 +++--- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/Menu.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/Menu.java index 9965f06fa..23ead2fae 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/Menu.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/Menu.java @@ -18,6 +18,7 @@ import mineplex.core.cosmetic.ui.button.OpenMorphs; import mineplex.core.cosmetic.ui.button.OpenMounts; import mineplex.core.cosmetic.ui.button.OpenParticles; import mineplex.core.cosmetic.ui.button.OpenPets; +import mineplex.core.cosmetic.ui.button.TreasureButton; import mineplex.core.donation.DonationManager; import mineplex.core.gadget.types.Gadget; import mineplex.core.gadget.types.GadgetType; @@ -44,15 +45,20 @@ public class Menu extends ShopPageBase AddItem(11, new ShopItem(175, DonationManager.Get(Player.getName()).getCoins() + " Coins", 1, false)); int treasureChestCount = Plugin.getInventoryManager().Get(Player).getItemCount("Treasure Chest"); -/* - if (treasureChestCount >= 0) + + if (treasureChestCount <= 0 && Player.getName().equals("Chiss")) { - AddButton(13, new ShopItem(Material.CHEST, C.cGold + treasureChestCount + " Treasure Chests", new String[] { ChatColor.RESET + "Click to Open Treasure Chest" }, 1, false), new TreasureButton(this)); + Plugin.getInventoryManager().addItemToInventory(Player, "Utility", "Treasure Chest", 1); + treasureChestCount = Plugin.getInventoryManager().Get(Player).getItemCount("Treasure Chest"); } - else - { - */ - AddItem(13, new ShopItem(Material.CHEST, ChatColor.RESET + C.cGold + treasureChestCount + " Treasure Chests (COMING SOON!)" + ChatColor.RESET, 1, false)); + +// if (treasureChestCount > 0) +// { +// AddButton(13, new ShopItem(Material.CHEST, C.cGold + treasureChestCount + " Treasure Chests", new String[] { ChatColor.RESET + "Click to Open Treasure Chest" }, 1, false), new TreasureButton(this)); +// } +// else +// { + AddItem(13, new ShopItem(Material.CHEST, ChatColor.RESET + C.cGold + treasureChestCount + " Treasure Chests" + ChatColor.RESET, new String[] { ChatColor.RESET + "Coming soon..." }, 1, false)); //} final GemBooster gemBoosterItem = new GemBooster(Shop.getBoosterEnabled(), Plugin.getInventoryManager().Get(Player).getItemCount("Gem Booster")); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/treasure/TreasureManager.java b/Plugins/Mineplex.Core/src/mineplex/core/treasure/TreasureManager.java index 562f8c5a4..d4ad9f3b0 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/treasure/TreasureManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/treasure/TreasureManager.java @@ -114,8 +114,8 @@ public class TreasureManager extends MiniPlugin new ItemStack(Material.TNT), RewardRarity.COMMON, 1000)); _rewardManager.addReward(new InventoryReward(inventoryManager, "Melons", "Melon Launcher", 50, 150, new ItemStack(Material.MELON_BLOCK), RewardRarity.COMMON, 1000)); - - } + + } @Override public void Disable() @@ -292,7 +292,7 @@ public class TreasureManager extends MiniPlugin _playerTreasureMap.remove(event.getPlayer()); } - @EventHandler + //@EventHandler public void command(PlayerCommandPreprocessEvent event) { //TODO Remove