From 80a473a93b0d88584c67accbcd356cf0b9343e67 Mon Sep 17 00:00:00 2001 From: Neeve Date: Sat, 16 Dec 2023 03:26:43 +1100 Subject: [PATCH] Fix data loss in BasicCellInventory (#327) --- src/main/java/appeng/me/storage/BasicCellInventory.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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();