Refined Storage

Refined Storage

77M Downloads

Reader using max power

temp1029 opened this issue ยท 5 comments

commented

Issue description:

Reader uses max power available on TE fluxducts.

What happens:

Reader is pulling max power through flux ducts (the tier I am using it is 4k), even though no machines connected to writers need power (all buffers are full). I am using Flux Points to provide power to the TE flux ducts, so that is how I see the power draw increase.

What you expected to happen:

Read should pull no power since buffers are full on all machines.

Steps to reproduce:

  1. Attach reader to RS network and Fluxduct with power going into fluxduct
  2. Attach writer to device with full buffer
  3. Connect reader and writer to same channel

Version (make sure you are on the latest version before reporting):

  • Minecraft:1.12.2
  • Forge:14.23.2562
  • Refined Storage:1.5.28

Does this issue occur on a server? [yes/no]
Unknown

If a (crash)log is relevant for this issue, link it here:

[pastebin/gist/etc link here]

commented

The reader doesn't care about other machines, it will keep pulling as long as it's own internal buffer isn't full. Is that the case? You can see the buffer when shift right clicking the reader.

commented

Not sure whats really going on, however I did a bit of testing and it looks like the writer isn't getting notified that there isn't anywhere for the power to go.

capture.zip

I didn't try this with anything other than Thermal Dynamics fluxducts, but I can if that would be helpful. If there is a specific mod you'd like me to try it with I can do that as well.

Video synopsis:

  1. Receiving energy cube is full
  2. Writer buffer has 320FE
  3. Sending energy cube (powered by a creative energy cube) is almost nearly full
  4. Reader buffer has 320FE
  5. Break cable from creative cube to sending cube
  6. Sending cube begins to drain
  7. Receiving cube is still full
  8. Replace cable from creative cube to sending cube
  9. Sending cube is nearly full again
  10. Break cable from writer to receiving cube
  11. Writer and reader buffers fill up
  12. Sending cube fills up

Hope this helps.

commented

Not sure if this helps or not but I think this line might be the cause. I think you want to simulate (second parameter true) the power extraction (storage.extractEnergy) inside the loop.

From my reading of the code, the receiveEnergy call (on the receiving block) is supposed to return how much energy it accepted. When its full it should return zero. RS takes this return value and adds it up for mass extraction at the end of each update. When all receiving blocks are full, it should extract nothing, allowing internal buffer to fill. Since the extractEnergy call inside the loop isn't simulating, the full amount is being pulled out each pass.

I'd've made a pull request but since its a small change and I'm not 100% certain, I figured I'd just post it in here. Let me know if you'd like a pull request.

commented

Aha! Thanks for debugging this for me :)

I couldn't look into it today since I had school but expect a release with a fix tomorrow. :)

commented

Fixed by 8fe3f40

Thanks for looking into it!