@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)
| 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 |
no outgoing calls
no test coverage detected