MCPcopy Index your code
hub / github.com/Cortex-MC/SimpAPI / makeItem

Method makeItem

src/main/java/me/kodysimpson/simpapi/menu/Menu.java:118–130  ·  view source on GitHub ↗

@param material The material to base the ItemStack on @param displayName The display name of the ItemStack @param lore The lore of the ItemStack, with the Strings being automatically color coded with ColorTranslator @return The constructed ItemStack object

(Material material, String displayName, String... lore)

Source from the content-addressed store, hash-verified

116 * @return The constructed ItemStack object
117 */
118 public ItemStack makeItem(Material material, String displayName, String... lore) {
119
120 ItemStack item = new ItemStack(material);
121 ItemMeta itemMeta = item.getItemMeta();
122 assert itemMeta != null;
123 itemMeta.setDisplayName(displayName);
124
125 //Automatically translate color codes provided
126 itemMeta.setLore(Arrays.stream(lore).map(ColorTranslator::translateColorCodes).collect(Collectors.toList()));
127 item.setItemMeta(itemMeta);
128
129 return item;
130 }
131
132 /**
133 * Called when a player closes this menu

Callers 2

MenuClass · 0.95
addMenuBorderMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected