Complete freeze on battery insertion into large batbox

No logs, game totally freezes (infinite loop or otherwise) so this has to be debugged.

Gregtech 6.14.09 (and earlier 6.14.06 IIRC)
Inventory Tweaks 1.58-147

Large Battery Box (LV)
1-4 Lead-Acid Battery (LV) inside box with any charge.
2 stacked empty Lead-Acid Battery (LV) in inventory.

CTRL+SHIFT click empty batteries into battery box from inventory. Game freezes occasionally/always (I am not a masochist so i try to avoid doing that move) when doing so.
SHIFT click works fine as far as i can tell, it’s just CTRL+SHIFT that messes up.

Since InvTweaks is involved, i understand it might be out of your hands. But if by any chance this can be fixed it would be greatly appreciated.

Again, as i said, solid freeze. No trace logs or anything. No exceptions.


invTweaks is involved indeed, specifically their Ctrl+Click things are not under my control at all.


So it can’t be avoided somehow either?


Don’t use Ctrl Click? You can regular Shiftclick still.


Yeah, i like your solution on a purely sarcastic level…

But i actually use that to move all stacks of a particular item to and from inventories. It’s ingrained in my very being.
It doesn’t matter though, i finally worked my way through to aluminium and therefore i don’t need to move batteries around as much.


Thinking about it some…
I am pretty sure it’s to do with a stack entering the battery box where normally that wouldn’t be possible, i took a quick peek at code and didn’t find what i was expecting but whenever one shift clicks a stack of empty batteries into a battery box, they are split up into single stacks.
This obviously does not happen when using CTRL+SHIFT or W move (move to inventory above) with InvTweaks. Instead the game freezes, only one battery is inserted after reload and the others are lost to the void.

So i see two solutions to this problem.

  1. Check if any (greater than one) stacks of batteries sit inside the inventory of the battery box (and other similar machines with similar designs) and split them up. This can of course cause issues when no more inventory space is available to split said stack so… Eject any excess?
  2. Heck, check on every insertion into inventory if it’s a stack of batteries (stacked as in more than one) and split said stack and eject the ones that don’t fit.
  3. IMHO, the easiest and preferred method for this one… Simply make empty batteries a max stack size of one. Problem solved!
    It makes no sense to me how charged batteries suddenly grow in size by so much that they can no longer be stacked. (And yes, i understand the underlying reason for charged batteries not being stackable)
    So just make it so batteries (and other such items that may be inserted and freeze the game if they enter a inventory as a stack) simply cannot be stacked.

And yes, “stop using InvTweaks” is a solution. It’s just not my solution.


The Battery Boxes have a 1 Item Limit instead of a 64 Item Limit, InvTweaks does not seem to like that, but nothing I can really do about it.

As for your Solutions:

  1. That is 100% InvTweaks Side.
  2. Also 100% InvTweaks Side.
  3. They are intentionally stackable when empty, just like IC2 Batteries. Also have you tried Ctrl+Clicking anything else that ISN’T a Battery into this? I bet the same freeze happens.

And I don’t even delete anything that surpasses the Stacksize, so the voiding is also purely InvTweaks side…

1 Like

I never said you deleted anything.
It just isn’t handled.

But yeah, everything is InvTweaks. Every inventory crashes when you move stacks into them. :slight_smile:

/sarcasm, Only the battery box freezes. And yes, a stack of hamburgers will freeze the game too.
But as i said, i’ve only ever encountered this issue with the battery box. No other entity does it.


All the Battery Box does (compared to my other GUIs) is limit the stacksize inside the Slot to 1, so if InvTweaks cannot handle this, it is on their Side.

I can even guess that they try to insert something into the same slot that is already at max capacity because of assuming the Item Stacksize is what matters, so it infinitely retries to insert the same Items into the same Slot forever, instead of maybe just trying it 64 times or so, which would still be laggy but it wouldn’t be infinite.

1 Like

You are right, i was just in a “mental period” when i posted my last comment.
I am sorry!

1 Like