ItemStack#withAmount does not need to pass through the builder

This commit is contained in:
themode 2021-12-19 21:55:24 +01:00 committed by TheMode
parent d31b219294
commit 639d19fced

View File

@ -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)