Fixed issue where the player could be given stacks of 0 items

This commit is contained in:
Jordan 2024-02-21 02:03:41 +00:00 committed by Ryan
parent 6e2f8c6f30
commit 9e5a7aefc8

View file

@ -221,7 +221,7 @@ public class Container {
public boolean add(Item item, boolean fireListener, int preferredSlot) {
item = item.copy();
int maximum = getMaximumAdd(item);
if (maximum == 0) {
if (maximum == 0 || (item.getDefinition().isStackable() && item.getAmount() == 0)) {
return false;
}
if (preferredSlot > -1 && items[preferredSlot] != null) {