Create Crafts & Additions

Create Crafts & Additions

61M Downloads

Accumulator peripheral methods sometimes (often!) return nothing

hatkidchan opened this issue ยท 0 comments

commented

Describe the bug
Sometimes methods such as getCapacity(), getEnergy(), getPercent of modular_accumulator peripheral return no values.

Image

Curiously, reading values in a loop with os.sleep() in between makes values appear:

Image

-- energymon.lua
local acc = peripheral.find("modular_accumulator")

while true do
    print(acc.getEnergy(), "/", acc.getCapacity())
    os.sleep(0)
end

To Reproduce

  1. Assemble accumulator
  2. Place a computer next to it
  3. Open lua REPL
  4. peripheral.find("modular_accumulator").getCapacity() most of the time returns nothing. Spamming it or calling it in a loop may return a value.

Additional context

  • Mod version: v1.2.4
  • Fabric version: 0.16.10
  • Create version: v0.5.1-j-build.1631+mc1.20.1
  • CC:Tweaked version: v1.115.1