[ComputerCraft API]: getEnergyProducedLastTick() returns 0 at start of new tick instead of the energy produced last tick.
Kasra-G opened this issue · 1 comments
Issue
Briefly, right after a new tick, the output of getEnergyProducedLastTick()
or getEnergyStats().energyProducedLastTick
is 0.
Expected behavior
The output of the function should accurately return the energy produced in the last tick, no matter what time during the tick the function was called
Workaround
The workaround is pretty simple, which is to just loop until the RFT is no longer 0. This workaround introduces some ambiguity, though, as to whether or not the reactor is actually producing 0 RFT.
Reproduction/Additional Context
Minimal computercraft script reproduction: pastebin run sScZ39Hk
Tested on latest version - ExtremeReactors2-1.21.1-2.4.18.jar
on neoforge 21.1.92
, CC:Tweaked version cc-tweaked-1.21.1-forge-1.113.0.jar
, but have also seen this issue happening on older versions, at least since ATM6 on Minecraft 1.16.4.