Fix HatGadgets only displaying glass
This commit is contained in:
parent
bf1d2e4b71
commit
87f35fecca
@ -85,7 +85,17 @@ public abstract class OutfitGadget extends Gadget
|
|||||||
if (message)
|
if (message)
|
||||||
UtilPlayer.message(player, F.main(Manager.getName(), "You put on " + F.elem(getName()) + "."));
|
UtilPlayer.message(player, F.main(Manager.getName(), "You put on " + F.elem(getName()) + "."));
|
||||||
|
|
||||||
ItemStack itemStack = new ItemStack(getDisplayMaterial(), 1, getDisplayData());
|
ItemStack itemStack;
|
||||||
|
|
||||||
|
if (getDisplayItem() == null)
|
||||||
|
{
|
||||||
|
itemStack = new ItemStack(getDisplayMaterial(), 1, getDisplayData());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
itemStack = getDisplayItem();
|
||||||
|
}
|
||||||
|
|
||||||
if (getColor() != null)
|
if (getColor() != null)
|
||||||
{
|
{
|
||||||
if (itemStack.getItemMeta() instanceof LeatherArmorMeta)
|
if (itemStack.getItemMeta() instanceof LeatherArmorMeta)
|
||||||
@ -97,13 +107,21 @@ public abstract class OutfitGadget extends Gadget
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_slot == ArmorSlot.HELMET) player.getInventory().setHelmet(itemStack);
|
switch (_slot)
|
||||||
|
{
|
||||||
else if (_slot == ArmorSlot.CHEST) player.getInventory().setChestplate(itemStack);
|
case HELMET:
|
||||||
|
player.getInventory().setHelmet(itemStack);
|
||||||
else if (_slot == ArmorSlot.LEGS) player.getInventory().setLeggings(itemStack);
|
break;
|
||||||
|
case CHEST:
|
||||||
else if (_slot == ArmorSlot.BOOTS) player.getInventory().setBoots(itemStack);
|
player.getInventory().setChestplate(itemStack);
|
||||||
|
break;
|
||||||
|
case LEGS:
|
||||||
|
player.getInventory().setLeggings(itemStack);
|
||||||
|
break;
|
||||||
|
case BOOTS:
|
||||||
|
player.getInventory().setBoots(itemStack);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void removeArmor(Player player, boolean message)
|
public void removeArmor(Player player, boolean message)
|
||||||
@ -114,9 +132,20 @@ public abstract class OutfitGadget extends Gadget
|
|||||||
if (message)
|
if (message)
|
||||||
UtilPlayer.message(player, F.main("Gadget", "You took off " + F.elem(getName()) + "."));
|
UtilPlayer.message(player, F.main("Gadget", "You took off " + F.elem(getName()) + "."));
|
||||||
|
|
||||||
if (_slot == ArmorSlot.HELMET) player.getInventory().setHelmet(null);
|
switch (_slot)
|
||||||
else if (_slot == ArmorSlot.CHEST) player.getInventory().setChestplate(null);
|
{
|
||||||
else if (_slot == ArmorSlot.LEGS) player.getInventory().setLeggings(null);
|
case HELMET:
|
||||||
else if (_slot == ArmorSlot.BOOTS) player.getInventory().setBoots(null);
|
player.getInventory().setHelmet(null);
|
||||||
|
break;
|
||||||
|
case CHEST:
|
||||||
|
player.getInventory().setChestplate(null);
|
||||||
|
break;
|
||||||
|
case LEGS:
|
||||||
|
player.getInventory().setLeggings(null);
|
||||||
|
break;
|
||||||
|
case BOOTS:
|
||||||
|
player.getInventory().setBoots(null);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user