diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/OutfitGadget.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/OutfitGadget.java index 3318d4fc5..ed08dfaa7 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/OutfitGadget.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/OutfitGadget.java @@ -85,7 +85,17 @@ public abstract class OutfitGadget extends Gadget if (message) 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 (itemStack.getItemMeta() instanceof LeatherArmorMeta) @@ -97,13 +107,21 @@ public abstract class OutfitGadget extends Gadget } } - if (_slot == ArmorSlot.HELMET) player.getInventory().setHelmet(itemStack); - - else if (_slot == ArmorSlot.CHEST) player.getInventory().setChestplate(itemStack); - - else if (_slot == ArmorSlot.LEGS) player.getInventory().setLeggings(itemStack); - - else if (_slot == ArmorSlot.BOOTS) player.getInventory().setBoots(itemStack); + switch (_slot) + { + case HELMET: + player.getInventory().setHelmet(itemStack); + break; + case CHEST: + 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) @@ -113,10 +131,21 @@ public abstract class OutfitGadget extends Gadget if (message) UtilPlayer.message(player, F.main("Gadget", "You took off " + F.elem(getName()) + ".")); - - if (_slot == ArmorSlot.HELMET) player.getInventory().setHelmet(null); - else if (_slot == ArmorSlot.CHEST) player.getInventory().setChestplate(null); - else if (_slot == ArmorSlot.LEGS) player.getInventory().setLeggings(null); - else if (_slot == ArmorSlot.BOOTS) player.getInventory().setBoots(null); + + switch (_slot) + { + case HELMET: + 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; + } } }