Hbm's Nuclear Tech Mod

Hbm's Nuclear Tech Mod

1M Downloads

Li-Ion Energy Storage Block "truncates" energy inside

laurynasl opened this issue ยท 5 comments

commented

Describe the bug

I have Li-Ion Energy Storage block. It's max size is 50M HE. At one point I noticed that it's almost empty - just 1.05M HE (exactly that number. Previously in that space I had lower tier energy storage block (max 1M HE). So I got suspicious... was it old tileentity somehow? I ran some tests.

(that Li-Ion storage block is connected by coated red copper cable to some machines, like assembled, 2 chemical plants, ore acidizer)

I burned some diesel to increase storage's HE, disconnected for less than 2 minutes from server, then connected back. It had exactly 1.05M HE.
I ran the same test after moving storage and diesel generator by one block (still connected to cable), then another time in other chunk (not connected to anything). Still the same 1.05M HE...

I checked the code and didn't find anything obvious. Release 1.0.27X4144 (currently newest).

commented

Weird. I ran the same test WITHOUT diesel generator on top. This time it loaded exactly what it saved - 1.55M HE.

commented

Perhaps whatever server software you're using saves tile entities in a weird way? This could also relate to the fact that the battery's default power cap is 1MHE until the saved capacity is loaded from NBT when the chunk loads, but that should be instantaneous. Perhaps I could try optimizing that part a little bit but I'm not at all sure if that would help.

commented

My "server software" is nothing special - forge 1614. Yes, that 1.05M number is interesting. It's exactly TileEntityMachineBattery.maxPower + TileEntityMachineDiesel.maxPower. For some reason :)

I can live with this bug, if it only happens when generator is directly attached to energy storage block (not sure if it's true yet). Cables workaround is easy.

commented

Alright, yesterday's version cleaned up some of the battery code which should hopefully fix some generally weird behavior. I can't tell for sure if it'll solve your issue since I couldn't even replicate it but I'm confident that it's at least somewhat of an improvement (at least oscillating buffering battery blocks work properly with battery items again)

commented

After updating, I filled Li-Ion storage (with diesel generator on top) with 1M HE, burned 1 diesel canister for 0.5M HE more, then disconnected for 2 minutes. After reconnect, storage had 1.5M HE, as expected. So fixed, I guess. Thank you :)