Last active
August 29, 2015 14:02
-
-
Save AllieQpzm/c679a750a913b4d10ca5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static ItemStack createItemStack(Material type, int amount, byte data, String name, String... lore) { | |
if(type == null) | |
return null; | |
ItemStack is = new ItemStack(type, amount, data); | |
ItemMeta meta = is.getItemMeta(); | |
if(lore != null && lore.length > 0) | |
meta.setLore(Arrays.asList(lore)); | |
if(name != null && !name.isEmpty()) | |
meta.setDisplayName(name); | |
is.setItemMeta(meta); | |
return is; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment