Fix cell math for distribution card (#751)

Co-authored-by: Maya <10861407+serenibyss@users.noreply.github.com>
This commit is contained in:
lordIcocainandMaya authored and GitHub committed 2025-05-11 22:34:47 +00:00
1 parent 4f05d24560
commit ddc21fc8cc
1 file changed
+2 -3
@@ -579,10 +579,9 @@ public class CellInventory implements ICellInventory {
if (types == 0) types = this.getTotalItemTypes();
if (l != null) {
if (restrictionLong > 0) {
remaining = Math.min((restrictionLong / types) - l.getStackSize(), this.getUnusedItemCount());
remaining = Math.min((restrictionLong / types) - l.getStackSize(), getRemainingItemCount());
} else {
remaining = (((this.getTotalBytes() / types) - (int) Math.ceil((double) l.getStackSize() / 8)
- getBytesPerType()) * 8) + (8 - l.getStackSize() % 8);
remaining = (((getTotalBytes() / types) - getBytesPerType()) * 8) - l.getStackSize();
}
} else {
if (restrictionLong > 0) {