diff --git a/src/de/steamwar/inventory/SWInventory.java b/src/de/steamwar/inventory/SWInventory.java index 322eb82..02b3d66 100644 --- a/src/de/steamwar/inventory/SWInventory.java +++ b/src/de/steamwar/inventory/SWInventory.java @@ -53,8 +53,16 @@ public class SWInventory implements Listener, Inventory { setItem(pos, m, name, new ArrayList<>(), false, c); } + public void setItem(int pos, Material m, byte meta, String name, InvCallback c){ + setItem(pos, m, meta, name, new ArrayList<>(), false, c); + } + public void setItem(int pos, Material m, String name, List lore, boolean e, InvCallback c){ - SWItem item = new SWItem(m, name, lore, e, c); + setItem(pos, m, (byte)0, name, new ArrayList<>(), false, c); + } + + public void setItem(int pos, Material m, byte meta, String name, List lore, boolean e, InvCallback c){ + SWItem item = new SWItem(m, meta, name, lore, e, c); setItem(pos, item); } diff --git a/src/de/steamwar/inventory/SWItem.java b/src/de/steamwar/inventory/SWItem.java index 8e4c4fe..ce0c8b8 100644 --- a/src/de/steamwar/inventory/SWItem.java +++ b/src/de/steamwar/inventory/SWItem.java @@ -19,7 +19,11 @@ public class SWItem { } public SWItem(Material material, String name, List lore, boolean enchanted, InvCallback c){ - itemStack = new ItemStack(material, 1, (short)0); + this(material, (byte)0, name, lore, enchanted, c); + } + + public SWItem(Material material, byte meta, String name, List lore, boolean enchanted, InvCallback c){ + itemStack = new ItemStack(material, 1, (short)0, meta); itemMeta = itemStack.getItemMeta(); itemMeta.setDisplayName(name); if(lore != null && !lore.isEmpty())