From 88eab4b1a323a03ed9a9e896ff4c5feeaab3dcba Mon Sep 17 00:00:00 2001 From: Jonathan Williams Date: Sat, 26 Oct 2013 11:01:01 -0500 Subject: [PATCH] Fixed gadget item slot. Fixed some desc on mounts --- .../mineplex/hub/gadget/types/ItemGadget.java | 4 ++-- .../src/mineplex/hub/gadget/ui/GadgetPage.java | 16 ++++++---------- .../src/mineplex/hub/mount/types/Mule.java | 3 ++- .../src/mineplex/hub/mount/types/Undead.java | 3 +-- 4 files changed, 11 insertions(+), 15 deletions(-) diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/types/ItemGadget.java b/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/types/ItemGadget.java index aae99dba7..334fe0457 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/types/ItemGadget.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/types/ItemGadget.java @@ -32,7 +32,7 @@ public abstract class ItemGadget extends Gadget { Manager.RemoveItem(player); - player.getInventory().setItem(3, ItemStackFactory.Instance.CreateStack(GetDisplayMaterial(), GetDisplayData(), 1, F.item(GetName()))); + player.getInventory().setItem(4, ItemStackFactory.Instance.CreateStack(GetDisplayMaterial(), GetDisplayData(), 1, F.item(GetName()))); _active.add(player); @@ -41,7 +41,7 @@ public abstract class ItemGadget extends Gadget public void RemoveItem(Player player) { - player.getInventory().setItem(3, null); + player.getInventory().setItem(4, null); _active.remove(player); diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/ui/GadgetPage.java b/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/ui/GadgetPage.java index c4611ebab..e73e9be00 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/ui/GadgetPage.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/ui/GadgetPage.java @@ -62,12 +62,12 @@ public class GadgetPage extends ShopPageBase meta.setColor(Color.BLACK); getItem(27).setItemMeta(meta); - setItem(36, new ShopItem(Material.LEATHER_BOOTS, (byte)0, "Hub Boots", new String[] {}, 1, true, false)); + setItem(36, new ShopItem(Material.LEATHER_BOOTS, (byte)0, "Hub Boots", new String[] {}, 1, false, false)); meta = (LeatherArmorMeta)getItem(36).getItemMeta(); meta.setColor(Color.BLACK); getItem(36).setItemMeta(meta); - setItem(45, new ShopItem(Material.SADDLE, (byte)0, "Hub Mount", new String[] {}, 1, true, false)); + setItem(45, new ShopItem(Material.SADDLE, (byte)0, "Hub Mount", new String[] {}, 1, false, false)); for (Gadget gadget : Plugin.getGadgets()) { @@ -119,11 +119,7 @@ public class GadgetPage extends ShopPageBase { List itemLore = new ArrayList(); - if (gadget.GetCost(CurrencyType.Gems) == -1) - { - itemLore.add(C.cYellow + "You can only earn this!"); - } - else + if (gadget.GetCost(CurrencyType.Gems) != -1) { itemLore.add(C.cYellow + gadget.GetCost(CurrencyType.Gems) + " Gems"); } @@ -133,7 +129,7 @@ public class GadgetPage extends ShopPageBase if (DonationManager.Get(Player.getName()).OwnsUnknownPackage(gadget.GetName())) { - if (gadget.GetOwners().contains(Player)) + if (gadget.GetActive().contains(Player)) { AddButton(slot, new ShopItem(gadget.GetDisplayMaterial(), gadget.GetDisplayData(), "Deactivate " + gadget.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, false, false), new DeactivateGadgetButton(gadget, this)); } @@ -165,7 +161,7 @@ public class GadgetPage extends ShopPageBase if (DonationManager.Get(Player.getName()).OwnsUnknownPackage(mount.GetName())) { - if (mount.GetOwners().contains(Player)) + if (mount.GetActive().containsKey(Player)) { AddButton(slot, new ShopItem(mount.GetDisplayMaterial(), mount.GetDisplayData(), "Deactivate " + mount.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, false, false), new DeactivateMountButton(mount, this)); } @@ -176,7 +172,7 @@ public class GadgetPage extends ShopPageBase } else { - if (DonationManager.Get(Player.getName()).GetBalance(CurrencyType.Gems) >= mount.GetCost(CurrencyType.Gems)) + if (mount.GetCost(CurrencyType.Gems) != -1 && DonationManager.Get(Player.getName()).GetBalance(CurrencyType.Gems) >= mount.GetCost(CurrencyType.Gems)) AddButton(slot, new ShopItem(mount.GetDisplayMaterial(), mount.GetDisplayData(), "Purchase " + mount.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, false, false), new MountButton(mount, this)); else setItem(slot, new ShopItem(mount.GetDisplayMaterial(), mount.GetDisplayData(), "Purchase " + mount.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false)); diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/mount/types/Mule.java b/Plugins/Mineplex.Hub/src/mineplex/hub/mount/types/Mule.java index 3ffc0a768..02365e363 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/mount/types/Mule.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/mount/types/Mule.java @@ -1,5 +1,6 @@ package mineplex.hub.mount.types; +import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.entity.Horse.Color; import org.bukkit.entity.Horse.Style; @@ -14,7 +15,7 @@ public class Mule extends Mount { super(manager, "Mount Mule", new String[] { - "Muley muley!" + ChatColor.RESET + "Muley muley!" }, Material.HAY_BLOCK, (byte)0, diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/mount/types/Undead.java b/Plugins/Mineplex.Hub/src/mineplex/hub/mount/types/Undead.java index ced9b0d78..1286750a1 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/mount/types/Undead.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/mount/types/Undead.java @@ -7,7 +7,6 @@ import org.bukkit.entity.Horse.Style; import org.bukkit.entity.Horse.Variant; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; -import org.bukkit.event.player.PlayerToggleSneakEvent; import mineplex.core.common.util.C; import mineplex.core.common.util.UtilParticle; @@ -27,7 +26,7 @@ public class Undead extends Mount C.cWhite + "The most ghastly horse in", C.cWhite + "existance, from the pits of", C.cWhite + "the Nether.", - "", + " ", C.cYellow + "Only available on website.", C.cYellow + "www.mineplex.com/Shop", },