mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-25 02:17:35 +01:00
Use max inventory size for new stack. Fixes BUKKIT-3240
This commit is contained in:
parent
708252c020
commit
b870755edb
@ -290,6 +290,7 @@ public class CraftInventory implements Inventory {
|
|||||||
// More than a single stack!
|
// More than a single stack!
|
||||||
if (item.getAmount() > getMaxItemStack()) {
|
if (item.getAmount() > getMaxItemStack()) {
|
||||||
CraftItemStack stack = CraftItemStack.asCraftCopy(item);
|
CraftItemStack stack = CraftItemStack.asCraftCopy(item);
|
||||||
|
stack.setAmount(getMaxItemStack());
|
||||||
setItem(firstFree, stack);
|
setItem(firstFree, stack);
|
||||||
item.setAmount(item.getAmount() - getMaxItemStack());
|
item.setAmount(item.getAmount() - getMaxItemStack());
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user