Return AIR if the amount is 0 or below

This commit is contained in:
TheMode 2021-04-12 09:11:08 +02:00
parent adfb487140
commit 0fea9b39a2

View File

@ -99,6 +99,9 @@ public class ItemStackBuilder {
@Contract(value = "-> new", pure = true)
public @NotNull ItemStack build() {
if (amount <= 0)
return ItemStack.AIR;
return new ItemStack(material, amount, metaBuilder.build());
}