package me.lethunderhawk.fluxapi.util.itemdesign; import me.lethunderhawk.fluxapi.util.UnItalic; import net.kyori.adventure.text.Component; import org.bukkit.Material; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; import java.util.List; public class ItemOptions { private Component name; private List lore; private int amount = 1; private Material material; /** * Simple way to customize Items * @param material The Base material */ public ItemOptions(Material material){ this.material = material; } /** * Creates the {@link ItemStack} from Scratch * @return The {@link ItemStack} with the Properties specified */ public ItemStack buildItemStack(){ ItemStack item = new ItemStack(material); item.setAmount(amount); ItemMeta meta = item.getItemMeta(); meta.lore(lore); meta.displayName(name); item.setItemMeta(UnItalic.removeItalicFromMeta(meta)); return item; } // ====== Getters and Setters ====== public Component getName() { return name; } public ItemOptions setName(Component name) { this.name = name; return this; } public List getLore() { return lore; } public ItemOptions setLore(List lore) { this.lore = lore; return this; } public int getAmount() { return amount; } public ItemOptions setAmount(int amount) { this.amount = amount; return this; } public Material getMaterial() { return material; } public ItemOptions setMaterial(Material material) { this.material = material; return this; } }