From f510083e7e53e3b79fd29fc8b42748d282f486ca Mon Sep 17 00:00:00 2001 From: Chiss Date: Tue, 24 Dec 2013 19:26:30 +1100 Subject: [PATCH] formatting --- .../hub/gadget/gadgets/BlazeHelmet.java | 20 ++++++++++++++++--- .../src/mineplex/hub/mount/types/Dragon.java | 17 +++++++++++++++- 2 files changed, 33 insertions(+), 4 deletions(-) diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/gadgets/BlazeHelmet.java b/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/gadgets/BlazeHelmet.java index ea3312173..c92925c72 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/gadgets/BlazeHelmet.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/gadgets/BlazeHelmet.java @@ -1,16 +1,19 @@ package mineplex.hub.gadget.gadgets; +import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.entity.Horse; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; +import org.bukkit.event.player.PlayerJoinEvent; +import mineplex.core.common.Rank; import mineplex.core.common.util.C; import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilParticle; -import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilParticle.ParticleType; import mineplex.core.disguise.disguises.DisguiseBlaze; +import mineplex.core.itemstack.ItemStackFactory; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; import mineplex.hub.gadget.GadgetManager; @@ -20,13 +23,13 @@ public class BlazeHelmet extends ArmorGadget { public BlazeHelmet(GadgetManager manager) { - super(manager, "Blaze", new String[] + super(manager, "Blaze Helmet", new String[] { C.cWhite + "Transforms the wearer into a fiery Blaze!", " ", C.cYellow + "Crouch" + C.cGray + " to use " + C.cGreen + "Firefly", " ", - C.cDPurple + "Unlocked with Hero Rank", + C.cPurple + "Unlocked with Hero Rank", }, -1, ArmorSlot.Helmet, Material.FIRE, (byte)0); @@ -69,4 +72,15 @@ public class BlazeHelmet extends ArmorGadget } } } + + @EventHandler + public void HeroOwner(PlayerJoinEvent event) + { + event.getPlayer().getInventory().setItem(5, ItemStackFactory.Instance.CreateStack(Material.CHEST, (byte)0, 1, ChatColor.RESET + C.cGreen + "Gadget Menu")); + + if (Manager.Manager.GetClients().Get(event.getPlayer()).GetRank().Has(Rank.HERO)) + { + Manager.Manager.GetDonation().Get(event.getPlayer().getName()).AddUnknownSalesPackagesOwned(GetName()); + } + } } diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/mount/types/Dragon.java b/Plugins/Mineplex.Hub/src/mineplex/hub/mount/types/Dragon.java index 5c2ba3e75..9b0f1ecbb 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/mount/types/Dragon.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/mount/types/Dragon.java @@ -2,16 +2,20 @@ package mineplex.hub.mount.types; import java.util.HashSet; +import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.entity.Horse; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.entity.EntityTargetEvent; +import org.bukkit.event.player.PlayerJoinEvent; +import mineplex.core.common.Rank; import mineplex.core.common.util.C; import mineplex.core.common.util.UtilParticle; import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilParticle.ParticleType; +import mineplex.core.itemstack.ItemStackFactory; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; import mineplex.hub.mount.DragonData; @@ -29,7 +33,7 @@ public class Dragon extends DragonMount C.cWhite + "this prized dragon is said to", C.cWhite + "obey only true Heroes!", " ", - C.cDPurple + "Unlocked with Hero Rank", + C.cPurple + "Unlocked with Hero Rank", }, Material.DRAGON_EGG, (byte)0, @@ -99,4 +103,15 @@ public class Dragon extends DragonMount for (DragonData dragon : GetActive().values()) dragon.Dragon.setCustomName(news); } + + @EventHandler + public void HeroOwner(PlayerJoinEvent event) + { + event.getPlayer().getInventory().setItem(5, ItemStackFactory.Instance.CreateStack(Material.CHEST, (byte)0, 1, ChatColor.RESET + C.cGreen + "Gadget Menu")); + + if (Manager.Manager.GetClients().Get(event.getPlayer()).GetRank().Has(Rank.HERO)) + { + Manager.Manager.GetDonation().Get(event.getPlayer().getName()).AddUnknownSalesPackagesOwned(GetName()); + } + } }