SteamWar/SpigotCore
Archiviert
13
0

Adding option to user Data-Information

Dieser Commit ist enthalten in:
Lixfel 2019-06-04 17:14:24 +02:00
Ursprung 6f430209ea
Commit 89c4ca9e47
2 geänderte Dateien mit 14 neuen und 2 gelöschten Zeilen

Datei anzeigen

@ -53,8 +53,16 @@ public class SWInventory implements Listener, Inventory {
setItem(pos, m, name, new ArrayList<>(), false, c); 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<String> lore, boolean e, InvCallback c){ public void setItem(int pos, Material m, String name, List<String> 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<String> lore, boolean e, InvCallback c){
SWItem item = new SWItem(m, meta, name, lore, e, c);
setItem(pos, item); setItem(pos, item);
} }

Datei anzeigen

@ -19,7 +19,11 @@ public class SWItem {
} }
public SWItem(Material material, String name, List<String> lore, boolean enchanted, InvCallback c){ public SWItem(Material material, String name, List<String> 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<String> lore, boolean enchanted, InvCallback c){
itemStack = new ItemStack(material, 1, (short)0, meta);
itemMeta = itemStack.getItemMeta(); itemMeta = itemStack.getItemMeta();
itemMeta.setDisplayName(name); itemMeta.setDisplayName(name);
if(lore != null && !lore.isEmpty()) if(lore != null && !lore.isEmpty())