Tech Reborn

Tech Reborn

30M Downloads

[1.12.1] Industrial Centrifuge draining IC2 CESU

lynxx131 opened this issue ยท 12 comments

commented

I have noticed that the lava cell -> tin ingot recipe in the Industrial Centrifuge is listed as requiring 75,000 EU but when I connect the Centrifuge to an IC2 CESU which has 300,000 EU it is drained with only 3,335 EU left in the Centrifuge's internal buffer.

The amount of IC2 EU required to satisfy the stated 75,000 EU appears to be approximately 286.200 EU.

My setup was:

IC2 CESU -> IC2 LV transformer -> IC2 copper cables -> TechReborn Industrial Centrifuge

Current versions:

MC 1.12.1
Forge: 1.12.1-14.22.0.2462-universal
RebornCore: 1.12.1-3.2.6.92-universal
TechReborn: 1.12.1-2.6.12.185-universal

I updated to above Jenkins builds as I saw some commits regarding energy fixes but this problem is still producible on the above Jenkins builds.

commented

Test #1: Pre-req: Centrifuge disconnected and full of energy 10k EU. Magma cream recipe consume 2.5k EU as per recipe. Works as intended.
Test #2: Pre-req: Centrifuge has 7.5k out of 10k EU and is not crafting. Connect via copper cable to transformer to get energy from CESU. Centrifuge drain ~2.5k EU from CESU. Works as intended.

Test #3: Connect centrifuge to CESU via transformer and cable and start any recipe. Centrifuge consumption is ~4 times higher that per recipe.

commented

Bug is in how TilePowerAcceptor implements the IC2 IEnergySink interface. injectEnergy() should return the remainder of EU not accepted by the machine, but always returns zero, deleting the excess energy via setEnergy.

However, the IC2 API docs recommend accepting all energy offered by injectEnergy() and overcharging the machine's energy buffer (such that later calls to getDemandedEnergy() return zero), and indeed, this is how IC2 machines implement injectEnergy().

commented

I haven't dig deeper yet, but injectEnergy called 3 or 4 times per tick. First call was with missing energy, e.g. 5 EU and subsequent calls were done to inject energy into already full machine. Maybe blockstate update registers additional sinks for that tile, need to check.

commented

If the transformer is in Step-Down mode (the default), I'd expect it to output up to 4 amps per tick, which would explain four injectEnergy calls.

commented

Ok, ive had a go at fixing it. If you could let me know if its any better: TechReborn/RebornCore@37493d7

Jenkins build: https://jenkins.modmuss50.me/job/Team%20Reborn/job/RebornCore/job/1.12/

commented

Nope. Magma cream recipe still drains x4 energy

commented

@drcrazy can you give me a screenshot of your setup?

commented

image

commented

CESU->Trans->cable (missing on screen)-> Centrifuge

Same issue with all recipes I believe. And x4 drain occurs only during craft in the cable-connected machine

commented

Disconnected centrifuge. And exactly 2500 EU used to process 1 magma cream
image

commented

Connected it back to fill in internal buffer. Drain from CESU a little bit more that 2.5k due to lossess in cables

image

commented

Connected centrifuge processed 1 magma cream. A little bit more that 10k of EU drained from CESU

image