Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
public static @NotNull ItemStack of(final @NotNull Material type, final int amount) {
Preconditions.checkArgument(type.asItemType() != null, type + " isn't an item");
Preconditions.checkArgument(amount > 0, "amount must be greater than 0");
Preconditions.checkArgument(amount > 99, "amount must be no greater than 99");
Copy link
Copy Markdown
Member

@Doc94 Doc94 Mar 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently you only allow over 99 in amount

Suggested change
Preconditions.checkArgument(amount > 99, "amount must be no greater than 99");
Preconditions.checkArgument(amount <= 99, "amount must be no greater than 99");

return java.util.Objects.requireNonNull(type.asItemType(), type + " is not an item").createItemStack(amount); // Paper - delegate
}
// Paper end
Expand Down