File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
invui/src/main/java/xyz/xenondevs/invui/item Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change 2424import org .bukkit .Material ;
2525import org .bukkit .craftbukkit .inventory .CraftItemStack ;
2626import org .bukkit .inventory .ItemStack ;
27+ import org .bukkit .inventory .ItemType ;
2728import org .jspecify .annotations .Nullable ;
2829import xyz .xenondevs .invui .i18n .Languages ;
2930import xyz .xenondevs .invui .internal .util .ArrayUtils ;
@@ -56,6 +57,25 @@ public final class ItemBuilder implements ItemProvider {
5657
5758 private Map <Locale , ItemStack > buildCache = new HashMap <>();
5859
60+ /**
61+ * Constructs a new {@link ItemBuilder} based on the given {@link ItemType}.
62+ *
63+ * @param type The {@link ItemType}
64+ */
65+ public ItemBuilder (ItemType type ) {
66+ this (type .createItemStack ());
67+ }
68+
69+ /**
70+ * Constructs a new {@link ItemBuilder} based on the given {@link ItemType} and amount.
71+ *
72+ * @param type The {@link ItemType}
73+ * @param amount The amount
74+ */
75+ public ItemBuilder (ItemType type , int amount ) {
76+ this (type .createItemStack (amount ));
77+ }
78+
5979 /**
6080 * Constructs a new {@link ItemBuilder} based on the given {@link Material}.
6181 *
You can’t perform that action at this time.
0 commit comments