Fixed gadget item slot.

Fixed some desc on mounts
This commit is contained in:
Jonathan Williams 2013-10-26 11:01:01 -05:00
parent df36145800
commit 88eab4b1a3
4 changed files with 11 additions and 15 deletions

View File

@ -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);

View File

@ -62,12 +62,12 @@ public class GadgetPage extends ShopPageBase<GadgetManager, GadgetShop>
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<GadgetManager, GadgetShop>
{
List<String> itemLore = new ArrayList<String>();
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<GadgetManager, GadgetShop>
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<GadgetManager, GadgetShop>
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<GadgetManager, GadgetShop>
}
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));

View File

@ -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,

View File

@ -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",
},