mirror of
https://github.com/Minestom/Minestom.git
synced 2024-12-27 03:27:56 +01:00
ItemStack#withAmount does not need to pass through the builder
This commit is contained in:
parent
d31b219294
commit
639d19fced
@ -119,7 +119,8 @@ public final class ItemStack implements TagReadable, HoverEventSource<HoverEvent
|
||||
|
||||
@Contract(value = "_, -> new", pure = true)
|
||||
public @NotNull ItemStack withAmount(int amount) {
|
||||
return builder().amount(amount).build();
|
||||
if (amount < 1) return AIR;
|
||||
return new ItemStack(material, amount, meta, stackingRule);
|
||||
}
|
||||
|
||||
@Contract(value = "_, -> new", pure = true)
|
||||
|
Loading…
Reference in New Issue
Block a user