diff --git a/src/main/java/appeng/me/storage/BasicCellInventory.java b/src/main/java/appeng/me/storage/BasicCellInventory.java index ac8d8259b..d3478bd9f 100644 --- a/src/main/java/appeng/me/storage/BasicCellInventory.java +++ b/src/main/java/appeng/me/storage/BasicCellInventory.java @@ -140,7 +140,7 @@ public class BasicCellInventory> extends AbstractCellInven if (this.canHoldNewItem()) // room for new type, and for at least one item! { - final int remainingItemCount = (int) this.getRemainingItemCount() - this.getBytesPerType() * this.itemsPerByte; + final long remainingItemCount = this.getRemainingItemCount() - (long) this.getBytesPerType() * this.itemsPerByte; if (remainingItemCount > 0) { if (input.getStackSize() > remainingItemCount) { final T toReturn = input.copy();