mirror of
https://github.com/Sollace/Unicopia.git
synced 2025-02-01 03:26:44 +01:00
Use the stack-aware version of Slot#getMaxItemCount
This commit is contained in:
parent
32a23a6ca5
commit
ac874945cd
1 changed files with 1 additions and 1 deletions
|
@ -249,7 +249,7 @@ public class SpellbookScreenHandler extends ScreenHandler {
|
||||||
|
|
||||||
if (!current.isEmpty() && ItemStack.canCombine(stack, current)) {
|
if (!current.isEmpty() && ItemStack.canCombine(stack, current)) {
|
||||||
// abide by the slot's max item count when trying to insert stacks
|
// abide by the slot's max item count when trying to insert stacks
|
||||||
int available = Math.min(Math.min(current.getMaxCount(), slot.getMaxItemCount()) - current.getCount(), stack.getCount());
|
int available = Math.min(Math.min(current.getMaxCount(), slot.getMaxItemCount(stack)) - current.getCount(), stack.getCount());
|
||||||
|
|
||||||
if (available > 0) {
|
if (available > 0) {
|
||||||
current.increment(available);
|
current.increment(available);
|
||||||
|
|
Loading…
Reference in a new issue