From a6f664006f2f1c379331d4714a9ad55865bd1964 Mon Sep 17 00:00:00 2001 From: Cheese Date: Fri, 11 Dec 2015 20:01:54 +1100 Subject: [PATCH] set display in gui --- .../core/cosmetic/ui/page/GadgetPage.java | 100 ++++--- .../core/cosmetic/ui/page/MountPage.java | 245 +++++++++--------- .../core/cosmetic/ui/page/PetPage.java | 93 +++---- .../mineplex/core/gadget/GadgetManager.java | 4 + .../core/gadget/gadgets/hat/HatGrinch.java | 2 +- .../core/gadget/set/SetCandyCane.java | 38 +++ .../mineplex/core/gadget/set/SetTitan.java | 38 +++ .../mineplex/core/gadget/types/Gadget.java | 15 +- .../mineplex/core/gadget/types/GadgetSet.java | 5 + 9 files changed, 330 insertions(+), 210 deletions(-) create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/gadget/set/SetCandyCane.java create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/gadget/set/SetTitan.java diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/GadgetPage.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/GadgetPage.java index 595ab5a17..3746ce66d 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/GadgetPage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/GadgetPage.java @@ -81,51 +81,67 @@ public class GadgetPage extends ShopPageBase itemLore.add(C.cBlack); itemLore.addAll(Arrays.asList(gadget.GetDescription())); - if (gadget.GetCost(CurrencyType.Coins) == -1) + if (!gadget.ownsGadget(getPlayer())) { - //Nothing + if (gadget.GetCost(CurrencyType.Coins) == -1) + { + //Nothing + } + //Chest Unlocks + else if (gadget.GetCost(CurrencyType.Coins) == -2 || gadget.GetCost(CurrencyType.Coins) > 0) + { + itemLore.add(C.cBlack); + itemLore.add(C.cBlue + "Found in Treasure Chests"); + } + else if (gadget.GetCost(CurrencyType.Coins) == -3) + { + itemLore.add(C.cBlack); + itemLore.add(C.cBlue + "Found in Winter Holiday Treasure"); + } + else if (gadget.GetCost(CurrencyType.Coins) == -4) + { + itemLore.add(C.cBlack); + itemLore.add(C.cBlue + "Found in Halloween Pumpkin Treasure"); + } + else if (gadget.GetCost(CurrencyType.Coins) == -5) + { + itemLore.add(C.cBlack); + itemLore.add(C.cBlue + "Found in Easter Holiday Treasure"); + } + //Rank Unlocks + else if (gadget.GetCost(CurrencyType.Coins) == -10) + { + itemLore.add(C.cBlack); + itemLore.add(C.cAqua + "Unlocked with Ultra Rank"); + } + else if (gadget.GetCost(CurrencyType.Coins) == -11) + { + itemLore.add(C.cBlack); + itemLore.add(C.cPurple + "Unlocked with Hero Rank"); + } + else if (gadget.GetCost(CurrencyType.Coins) == -12) + { + itemLore.add(C.cBlack); + itemLore.add(C.cGreen + "Unlocked with Legend Rank"); + } + else if (gadget.GetCost(CurrencyType.Coins) == -13) + { + itemLore.add(C.cBlack); + itemLore.add(C.cRed + "Unlocked with Titan Rank"); + } } - //Chest Unlocks - else if (gadget.GetCost(CurrencyType.Coins) == -2) + else { - itemLore.add(C.cBlack); - itemLore.add(C.cBlue + "Found in Treasure Chests"); - } - else if (gadget.GetCost(CurrencyType.Coins) == -3) - { - itemLore.add(C.cBlack); - itemLore.add(C.cBlue + "Found in Winter Holiday Treasure"); - } - else if (gadget.GetCost(CurrencyType.Coins) == -4) - { - itemLore.add(C.cBlack); - itemLore.add(C.cBlue + "Found in Halloween Pumpkin Treasure"); - } - else if (gadget.GetCost(CurrencyType.Coins) == -5) - { - itemLore.add(C.cBlack); - itemLore.add(C.cBlue + "Found in Easter Holiday Treasure"); - } - //Rank Unlocks - else if (gadget.GetCost(CurrencyType.Coins) == -10) - { - itemLore.add(C.cBlack); - itemLore.add(C.cAqua + "Unlocked with Ultra Rank"); - } - else if (gadget.GetCost(CurrencyType.Coins) == -11) - { - itemLore.add(C.cBlack); - itemLore.add(C.cPurple + "Unlocked with Hero Rank"); - } - else if (gadget.GetCost(CurrencyType.Coins) == -12) - { - itemLore.add(C.cBlack); - itemLore.add(C.cGreen + "Unlocked with Legend Rank"); - } - else if (gadget.GetCost(CurrencyType.Coins) == -13) - { - itemLore.add(C.cBlack); - itemLore.add(C.cRed + "Unlocked with Titan Rank"); + if (gadget.getSet() != null) + { + itemLore.add(C.cBlack); + itemLore.add(C.cGray + "Set Cosmetics;"); + + for (Gadget cur : gadget.getSet()) + { + itemLore.add(" "+ (cur.IsActive(getPlayer()) ? C.cGreen : C.cGray) + cur.GetName()); + } + } } if (gadget instanceof ItemGadget) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/MountPage.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/MountPage.java index fa7b1c76a..356635962 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/MountPage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/MountPage.java @@ -24,134 +24,137 @@ import mineplex.core.shop.page.ShopPageBase; public class MountPage extends ShopPageBase { - public MountPage(CosmeticManager plugin, CosmeticShop shop, CoreClientManager clientManager, DonationManager donationManager, String name, Player player) - { - super(plugin, shop, clientManager, donationManager, name, player, 54); - - buildPage(); - } - - protected void buildPage() - { - int slot = 19; - - for (Mount mount : getPlugin().getMountManager().getMounts()) - { - addMount(mount, slot); - slot++; - - if (slot == 26) - slot = 28; - } - - addButton(4, new ShopItem(Material.BED, C.cGray + " \u21FD Go Back", new String[]{}, 1, false), new IButton() + public MountPage(CosmeticManager plugin, CosmeticShop shop, CoreClientManager clientManager, DonationManager donationManager, String name, Player player) + { + super(plugin, shop, clientManager, donationManager, name, player, 54); + + buildPage(); + } + + protected void buildPage() + { + int slot = 19; + + for (Mount mount : getPlugin().getMountManager().getMounts()) + { + addMount(mount, slot); + slot++; + + if (slot == 26) + slot = 28; + } + + addButton(4, new ShopItem(Material.BED, C.cGray + " \u21FD Go Back", new String[]{}, 1, false), new IButton() { public void onClick(Player player, ClickType clickType) { getShop().openPageForPlayer(getPlayer(), new Menu(getPlugin(), getShop(), getClientManager(), getDonationManager(), player)); } }); - } - - protected void addMount(Mount mount, int slot) - { - List itemLore = new ArrayList(); - - itemLore.add(C.cBlack); - itemLore.addAll(Arrays.asList(mount.GetDescription())); - - if (mount.GetCost(CurrencyType.Coins) == -1) - { - //Nothing - } - //Chest Unlocks - else if (mount.GetCost(CurrencyType.Coins) == -2) - { - itemLore.add(C.cBlack); - itemLore.add(C.cBlue + "Found in Treasure Chests"); - } - else if (mount.GetCost(CurrencyType.Coins) == -3) - { - itemLore.add(C.cBlack); - itemLore.add(C.cBlue + "Found in Winter Holiday Treasure"); - } - else if (mount.GetCost(CurrencyType.Coins) == -4) - { - itemLore.add(C.cBlack); - itemLore.add(C.cBlue + "Found in Halloween Pumpkin Treasure"); - } - else if (mount.GetCost(CurrencyType.Coins) == -5) - { - itemLore.add(C.cBlack); - itemLore.add(C.cBlue + "Found in Easter Holiday Treasure"); - } - //Rank Unlocks - else if (mount.GetCost(CurrencyType.Coins) == -10) - { - itemLore.add(C.cBlack); - itemLore.add(C.cAqua + "Unlocked with Ultra Rank"); - } - else if (mount.GetCost(CurrencyType.Coins) == -11) - { - itemLore.add(C.cBlack); - itemLore.add(C.cPurple + "Unlocked with Hero Rank"); - } - else if (mount.GetCost(CurrencyType.Coins) == -12) - { - itemLore.add(C.cBlack); - itemLore.add(C.cGreen + "Unlocked with Legend Rank"); - } - else if (mount.GetCost(CurrencyType.Coins) == -13) - { - itemLore.add(C.cBlack); - itemLore.add(C.cRed + "Unlocked with Titan Rank"); - } - + } - if (getDonationManager().Get(getPlayer().getName()).OwnsUnknownPackage(mount.GetName())) - { - if (mount.GetActive().containsKey(getPlayer())) - { - itemLore.add(C.cBlack); - itemLore.add(C.cGreen + "Click to Disable"); - - addButton(slot, new ShopItem(mount.GetDisplayMaterial(), mount.GetDisplayData(), mount.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, false, false), new DeactivateMountButton(mount, this)); - } - else - { - itemLore.add(C.cBlack); - itemLore.add(C.cGreen + "Click to Enable"); - - addButton(slot, new ShopItem(mount.GetDisplayMaterial(), mount.GetDisplayData(), mount.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, false, false), new ActivateMountButton(mount, this)); - } - } - else - { - if (mount.GetCost(CurrencyType.Coins) > 0) + protected void addMount(Mount mount, int slot) + { + List itemLore = new ArrayList(); + + itemLore.add(C.cBlack); + itemLore.addAll(Arrays.asList(mount.GetDescription())); + + if (!getDonationManager().Get(getPlayer().getName()).OwnsUnknownPackage(mount.GetName())) + { + if (mount.GetCost(CurrencyType.Coins) == -1) { - itemLore.add(C.cBlack); - itemLore.add(C.cWhiteB + "Cost: " + C.cAqua + mount.GetCost(CurrencyType.Coins) + " Treasure Shards"); + //Nothing } - - if (mount.GetCost(CurrencyType.Coins) > 0 && getDonationManager().Get(getPlayer().getName()).GetBalance(CurrencyType.Coins) >= mount.GetCost(CurrencyType.Coins)) - { - itemLore.add(C.cBlack); - itemLore.add(C.cGreen + "Click to Purchase"); - - addButton(slot, new ShopItem(mount.GetDisplayMaterial(), mount.GetDisplayData(), mount.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false), new MountButton(mount, this)); - } - else if (mount.GetCost(CurrencyType.Coins) > 0) - { - itemLore.add(C.cBlack); - itemLore.add(C.cRed + "Not enough Treasure Shards."); - - setItem(slot, new ShopItem(mount.GetDisplayMaterial(), mount.GetDisplayData(), mount.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false)); - } - else - { - setItem(slot, new ShopItem(mount.GetDisplayMaterial(), mount.GetDisplayData(), mount.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false)); - } - } - - } + //Chest Unlocks + else if (mount.GetCost(CurrencyType.Coins) == -2 || mount.GetCost(CurrencyType.Coins) > 0) + { + itemLore.add(C.cBlack); + itemLore.add(C.cBlue + "Found in Treasure Chests"); + } + else if (mount.GetCost(CurrencyType.Coins) == -3) + { + itemLore.add(C.cBlack); + itemLore.add(C.cBlue + "Found in Winter Holiday Treasure"); + } + else if (mount.GetCost(CurrencyType.Coins) == -4) + { + itemLore.add(C.cBlack); + itemLore.add(C.cBlue + "Found in Halloween Pumpkin Treasure"); + } + else if (mount.GetCost(CurrencyType.Coins) == -5) + { + itemLore.add(C.cBlack); + itemLore.add(C.cBlue + "Found in Easter Holiday Treasure"); + } + //Rank Unlocks + else if (mount.GetCost(CurrencyType.Coins) == -10) + { + itemLore.add(C.cBlack); + itemLore.add(C.cAqua + "Unlocked with Ultra Rank"); + } + else if (mount.GetCost(CurrencyType.Coins) == -11) + { + itemLore.add(C.cBlack); + itemLore.add(C.cPurple + "Unlocked with Hero Rank"); + } + else if (mount.GetCost(CurrencyType.Coins) == -12) + { + itemLore.add(C.cBlack); + itemLore.add(C.cGreen + "Unlocked with Legend Rank"); + } + else if (mount.GetCost(CurrencyType.Coins) == -13) + { + itemLore.add(C.cBlack); + itemLore.add(C.cRed + "Unlocked with Titan Rank"); + } + } + + + if (getDonationManager().Get(getPlayer().getName()).OwnsUnknownPackage(mount.GetName())) + { + if (mount.GetActive().containsKey(getPlayer())) + { + itemLore.add(C.cBlack); + itemLore.add(C.cGreen + "Click to Disable"); + + addButton(slot, new ShopItem(mount.GetDisplayMaterial(), mount.GetDisplayData(), mount.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, false, false), new DeactivateMountButton(mount, this)); + } + else + { + itemLore.add(C.cBlack); + itemLore.add(C.cGreen + "Click to Enable"); + + addButton(slot, new ShopItem(mount.GetDisplayMaterial(), mount.GetDisplayData(), mount.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, false, false), new ActivateMountButton(mount, this)); + } + } + else + { + if (mount.GetCost(CurrencyType.Coins) > 0) + { + itemLore.add(C.cBlack); + itemLore.add(C.cWhiteB + "Cost: " + C.cAqua + mount.GetCost(CurrencyType.Coins) + " Treasure Shards"); + } + + if (mount.GetCost(CurrencyType.Coins) > 0 && getDonationManager().Get(getPlayer().getName()).GetBalance(CurrencyType.Coins) >= mount.GetCost(CurrencyType.Coins)) + { + itemLore.add(C.cBlack); + itemLore.add(C.cGreen + "Click to Purchase"); + + addButton(slot, new ShopItem(mount.GetDisplayMaterial(), mount.GetDisplayData(), mount.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false), new MountButton(mount, this)); + } + else if (mount.GetCost(CurrencyType.Coins) > 0) + { + itemLore.add(C.cBlack); + itemLore.add(C.cRed + "Not enough Treasure Shards."); + + setItem(slot, new ShopItem(mount.GetDisplayMaterial(), mount.GetDisplayData(), mount.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false)); + } + else + { + setItem(slot, new ShopItem(mount.GetDisplayMaterial(), mount.GetDisplayData(), mount.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false)); + } + } + + } } \ No newline at end of file diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/PetPage.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/PetPage.java index 0d3ac5bf6..4e796c47e 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/PetPage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/PetPage.java @@ -64,52 +64,57 @@ public class PetPage extends ShopPageBase itemLore.add(C.cBlack); itemLore.add(C.cGray + "Your very own " + pet.GetName() + "!"); - if (pet.GetCost(CurrencyType.Coins) == -1) - { - //Nothing - } //Chest Unlocks - else if (pet.GetCost(CurrencyType.Coins) == -2) + if (!getPlugin().getPetManager().Get(getPlayer()).GetPets().containsKey(pet.GetPetType())) { - itemLore.add(C.cBlack); - itemLore.add(C.cBlue + "Found in Treasure Chests"); - } - else if (pet.GetCost(CurrencyType.Coins) == -3) - { - itemLore.add(C.cBlack); - itemLore.add(C.cBlue + "Found in Winter Holiday Treasure"); - } - else if (pet.GetCost(CurrencyType.Coins) == -4) - { - itemLore.add(C.cBlack); - itemLore.add(C.cBlue + "Found in Halloween Pumpkin Treasure"); - } - else if (pet.GetCost(CurrencyType.Coins) == -5) - { - itemLore.add(C.cBlack); - itemLore.add(C.cBlue + "Found in Easter Holiday Treasure"); - } - //Rank Unlocks - else if (pet.GetCost(CurrencyType.Coins) == -10) - { - itemLore.add(C.cBlack); - itemLore.add(C.cAqua + "Unlocked with Ultra Rank"); - } - else if (pet.GetCost(CurrencyType.Coins) == -11) - { - itemLore.add(C.cBlack); - itemLore.add(C.cPurple + "Unlocked with Hero Rank"); - } - else if (pet.GetCost(CurrencyType.Coins) == -12) - { - itemLore.add(C.cBlack); - itemLore.add(C.cGreen + "Unlocked with Legend Rank"); - } - else if (pet.GetCost(CurrencyType.Coins) == -13) - { - itemLore.add(C.cBlack); - itemLore.add(C.cRed + "Unlocked with Titan Rank"); - } + if (pet.GetCost(CurrencyType.Coins) == -1) + { + //Nothing + } + + else if (pet.GetCost(CurrencyType.Coins) == -2 || pet.GetCost(CurrencyType.Coins) > 0) + { + itemLore.add(C.cBlack); + itemLore.add(C.cBlue + "Found in Treasure Chests"); + } + else if (pet.GetCost(CurrencyType.Coins) == -3) + { + itemLore.add(C.cBlack); + itemLore.add(C.cBlue + "Found in Winter Holiday Treasure"); + } + else if (pet.GetCost(CurrencyType.Coins) == -4) + { + itemLore.add(C.cBlack); + itemLore.add(C.cBlue + "Found in Halloween Pumpkin Treasure"); + } + else if (pet.GetCost(CurrencyType.Coins) == -5) + { + itemLore.add(C.cBlack); + itemLore.add(C.cBlue + "Found in Easter Holiday Treasure"); + } + + //Rank Unlocks + else if (pet.GetCost(CurrencyType.Coins) == -10) + { + itemLore.add(C.cBlack); + itemLore.add(C.cAqua + "Unlocked with Ultra Rank"); + } + else if (pet.GetCost(CurrencyType.Coins) == -11) + { + itemLore.add(C.cBlack); + itemLore.add(C.cPurple + "Unlocked with Hero Rank"); + } + else if (pet.GetCost(CurrencyType.Coins) == -12) + { + itemLore.add(C.cBlack); + itemLore.add(C.cGreen + "Unlocked with Legend Rank"); + } + else if (pet.GetCost(CurrencyType.Coins) == -13) + { + itemLore.add(C.cBlack); + itemLore.add(C.cRed + "Unlocked with Titan Rank"); + } + } //Owned if (getPlugin().getPetManager().Get(getPlayer()).GetPets().containsKey(pet.GetPetType())) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java index 4f1852000..c817ad7c5 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java @@ -90,7 +90,9 @@ import mineplex.core.gadget.gadgets.particle.ParticleHelix; import mineplex.core.gadget.gadgets.particle.ParticleLegend; import mineplex.core.gadget.gadgets.particle.ParticleRain; import mineplex.core.gadget.gadgets.particle.ParticleTitan; +import mineplex.core.gadget.set.SetCandyCane; import mineplex.core.gadget.set.SetFrostLord; +import mineplex.core.gadget.set.SetTitan; import mineplex.core.gadget.types.Gadget; import mineplex.core.gadget.types.GadgetSet; import mineplex.core.gadget.types.GadgetType; @@ -154,6 +156,8 @@ public class GadgetManager extends MiniPlugin private void createSets() { addSet(new SetFrostLord(this)); + addSet(new SetCandyCane(this)); + addSet(new SetTitan(this)); } private void CreateGadgets() diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatGrinch.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatGrinch.java index d48320d58..aee21df5b 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatGrinch.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatGrinch.java @@ -12,7 +12,7 @@ public class HatGrinch extends HatGadget public HatGrinch(GadgetManager manager) { super(manager, "The Grinch", - UtilText.splitLineToArray(C.cGray + "Grinchtastic", LineFormat.LORE), + UtilText.splitLineToArray(C.cGray + "Great! Now where’s the Roast Beast?!", LineFormat.LORE), -3, "christmasgift"); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/set/SetCandyCane.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/set/SetCandyCane.java new file mode 100644 index 000000000..ef898899a --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/set/SetCandyCane.java @@ -0,0 +1,38 @@ +package mineplex.core.gadget.set; + +import org.bukkit.entity.Player; + +import mineplex.core.common.util.F; +import mineplex.core.gadget.GadgetManager; +import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailCandyCane; +import mineplex.core.gadget.gadgets.death.DeathCandyCane; +import mineplex.core.gadget.gadgets.doublejump.DoubleJumpCandyCane; +import mineplex.core.gadget.gadgets.particle.ParticleCandyCane; +import mineplex.core.gadget.types.GadgetSet; + +public class SetCandyCane extends GadgetSet +{ + + public SetCandyCane(GadgetManager manager) + { + super(manager, + manager.getGadget(ArrowTrailCandyCane.class), + manager.getGadget(DeathCandyCane.class), + manager.getGadget(DoubleJumpCandyCane.class), + manager.getGadget(ParticleCandyCane.class)); + } + + @Override + public void customEnable(Player player) + { + player.sendMessage(F.main("GadgetSet", "Enabled full set of " + F.elem("Candy Cane"))); + } + + @Override + public void customDisable(Player player) + { + player.sendMessage(F.main("GadgetSet", "Disabled full set of " + F.elem("Candy Cane"))); + + } + +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/set/SetTitan.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/set/SetTitan.java new file mode 100644 index 000000000..f2d6b86df --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/set/SetTitan.java @@ -0,0 +1,38 @@ +package mineplex.core.gadget.set; + +import org.bukkit.entity.Player; + +import mineplex.core.common.util.F; +import mineplex.core.gadget.GadgetManager; +import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailTitan; +import mineplex.core.gadget.gadgets.death.DeathTitan; +import mineplex.core.gadget.gadgets.doublejump.DoubleJumpTitan; +import mineplex.core.gadget.gadgets.particle.ParticleTitan; +import mineplex.core.gadget.types.GadgetSet; + +public class SetTitan extends GadgetSet +{ + + public SetTitan(GadgetManager manager) + { + super(manager, + manager.getGadget(ArrowTrailTitan.class), + manager.getGadget(DeathTitan.class), + manager.getGadget(DoubleJumpTitan.class), + manager.getGadget(ParticleTitan.class)); + } + + @Override + public void customEnable(Player player) + { + player.sendMessage(F.main("GadgetSet", "Enabled full set of " + F.elem("Titan"))); + } + + @Override + public void customDisable(Player player) + { + player.sendMessage(F.main("GadgetSet", "Disabled full set of " + F.elem("Titan"))); + + } + +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/Gadget.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/Gadget.java index fae816a3f..e5b0667a1 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/Gadget.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/Gadget.java @@ -1,5 +1,6 @@ package mineplex.core.gadget.types; +import java.util.ArrayList; import java.util.HashSet; import mineplex.core.common.CurrencyType; @@ -26,6 +27,8 @@ public abstract class Gadget extends SalesPackageBase implements Listener protected HashSet _active = new HashSet(); + protected Gadget[] _set = null; + private String[] _alternativePackageNames; public Gadget(GadgetManager manager, GadgetType gadgetType, String name, String[] desc, int cost, Material mat, byte data) @@ -36,7 +39,7 @@ public abstract class Gadget extends SalesPackageBase implements Listener public Gadget(GadgetManager manager, GadgetType gadgetType, String name, String[] desc, int cost, Material mat, byte data, int quantity, String... alternativesalepackageNames) { super(name, mat, data, desc, cost, quantity); - + _gadgetType = gadgetType; KnownPackage = false; @@ -128,5 +131,13 @@ public abstract class Gadget extends SalesPackageBase implements Listener return false; } - + public void setSet(Gadget[] gadgets) + { + _set = gadgets; + } + + public Gadget[] getSet() + { + return _set; + } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/GadgetSet.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/GadgetSet.java index 94e7dde71..381c33660 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/GadgetSet.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/GadgetSet.java @@ -25,6 +25,11 @@ public abstract class GadgetSet implements Listener Manager = manager; _gadgets = gadgets; + for (Gadget gadget : gadgets) + { + gadget.setSet(gadgets); + } + Bukkit.getPluginManager().registerEvents(this, Manager.getPlugin()); }