Skip to content

Commit

Permalink
remove max stack size coercion
Browse files Browse the repository at this point in the history
  • Loading branch information
Gutin1 committed Jan 12, 2025
1 parent ebec986 commit be4ebfd
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ open class CustomItem(

fun constructItemStack(quantity: Int): ItemStack {
val constructed = baseItemFactory.construct()
val maxSize = constructed.getData(DataComponentTypes.MAX_STACK_SIZE) ?:
constructed.type.asItemType()?.getDefaultData(DataComponentTypes.MAX_STACK_SIZE) ?: 1
// val maxSize = constructed.getData(DataComponentTypes.MAX_STACK_SIZE) ?:
// constructed.type.asItemType()?.getDefaultData(DataComponentTypes.MAX_STACK_SIZE) ?: 1

return constructed.asQuantity(quantity.coerceIn(1..maxSize))
return constructed.asQuantity(quantity.coerceAtLeast(1))
}

protected open fun decorateItemStack(base: ItemStack) {}
Expand Down

0 comments on commit be4ebfd

Please sign in to comment.