Skip to content

Commit 748eca5

Browse files
committed
🐛 Use Item#maxStack for stack size validation in Item#amount
1 parent 4d55864 commit 748eca5

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • src/main/java/com/marcusslover/plus/lib/item

src/main/java/com/marcusslover/plus/lib/item/Item.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ public int maxStack() { // 1.21.3 custom stack size
282282
* @return the item
283283
*/
284284
public @NotNull Item amount(int amount) {
285-
this.itemStack.setAmount(Math.min(64, Math.max(0, amount)));
285+
this.itemStack.setAmount(Math.min(maxStack(), Math.max(0, amount)));
286286
return this;
287287
}
288288

0 commit comments

Comments
 (0)