Class CreateItem
java.lang.Object
net.joseplay.allianceutils.api.menu.CreateItem
Utility class for creating
ItemStack instances with predefined metadata.
This class centralizes item creation logic, including name, lore, custom model data, and persistent data container usage.
Warning:- No null-safety checks are performed
- ItemMeta is assumed to always be non-null
- Incorrect material types may cause ClassCastException
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.bukkit.inventory.ItemStackcreateItemStack(String name, List<String> lore, org.bukkit.Material material) Creates a basic ItemStack with name and lore.static org.bukkit.inventory.ItemStackcreateItemStack(String name, List<String> lore, org.bukkit.Material material, int modelData) Creates an ItemStack with name, lore and custom model data.static org.bukkit.inventory.ItemStackcreateItemStack(String name, List<String> lore, org.bukkit.Material material, org.bukkit.NamespacedKey namespacedKey) Creates an ItemStack with name, lore and a persistent data key.static org.bukkit.inventory.ItemStackcreateItemStack(String name, List<String> lore, org.bukkit.Material material, org.bukkit.NamespacedKey namespacedKey, int modelData) Creates an ItemStack with name, lore, custom model data and persistent data.static org.bukkit.inventory.ItemStackcreateLeatherItemStack(String name, List<String> lore, org.bukkit.Material material, org.bukkit.Color color) Creates a leather armor ItemStack with custom color.
-
Constructor Details
-
CreateItem
public CreateItem()
-
-
Method Details
-
createItemStack
public static org.bukkit.inventory.ItemStack createItemStack(String name, List<String> lore, org.bukkit.Material material, org.bukkit.NamespacedKey namespacedKey) Creates an ItemStack with name, lore and a persistent data key.- Parameters:
name- display namelore- lore linesmaterial- item materialnamespacedKey- key to store in PersistentDataContainer- Returns:
- configured ItemStack
-
createItemStack
public static org.bukkit.inventory.ItemStack createItemStack(String name, List<String> lore, org.bukkit.Material material, org.bukkit.NamespacedKey namespacedKey, int modelData) Creates an ItemStack with name, lore, custom model data and persistent data.- Parameters:
name- display namelore- lore linesmaterial- item materialnamespacedKey- key to store in PersistentDataContainermodelData- custom model data value- Returns:
- configured ItemStack
-
createItemStack
public static org.bukkit.inventory.ItemStack createItemStack(String name, List<String> lore, org.bukkit.Material material) Creates a basic ItemStack with name and lore.- Parameters:
name- display namelore- lore linesmaterial- item material- Returns:
- configured ItemStack
-
createItemStack
public static org.bukkit.inventory.ItemStack createItemStack(String name, List<String> lore, org.bukkit.Material material, int modelData) Creates an ItemStack with name, lore and custom model data.- Parameters:
name- display namelore- lore linesmaterial- item materialmodelData- custom model data value- Returns:
- configured ItemStack
-
createLeatherItemStack
public static org.bukkit.inventory.ItemStack createLeatherItemStack(String name, List<String> lore, org.bukkit.Material material, org.bukkit.Color color) Creates a leather armor ItemStack with custom color. Warning: - The material must be a leather armor piece - Otherwise a ClassCastException will be thrown- Parameters:
name- display namelore- lore linesmaterial- leather armor materialcolor- armor color- Returns:
- configured ItemStack
-