PneumaticCraft: Repressurized

PneumaticCraft: Repressurized

43M Downloads

Air Compressor ignores low-signal redstone rule after loading game

Opened this issue ยท 4 comments

commented

Minecraft Version

1.16.5

Forge Version

36.1.6

Mod Versions

pneumaticcraft-repressurized-1.16.5-2.12.4-188 (discovered here)
pneumaticcraft-repressurized-1.16.5-2.12.5-190 (still a problem here)

Describe your problem, including steps to reproduce it

The Air Compressor's low-signal Redstone Behavior works as expected during the session in which it is configured. However, the redstone signal is ignored in the next session (quit and load again) under the following conditions:

  1. The Air Compressor is connected to its Pressure Gauge Tube Module with 5 blocks of redstone.
  2. The compressor has a high redstone signal causing it to power off.
  3. The compressor is not actively burning fuel.

Non-conditions:

  1. The tubing's destination. I have three Air Compressors that fire up when I load the game, and all three are connected to different objects.
  2. Other mods. I can reproduce this using only PNC:R and The One Probe for testing purposes.

After the second session loads, the compressor will begin burning fuel despite the high redstone signal. The compressor claims that there are "No Problems", i.e., no redstone signal to disable it.

First Session โ€” working fine:
image
image

Second Session โ€” No changes from first session, but redstone is ignored and it's now burning fuel:
image
image

Any other comments?

Thanks for all the work you've put into the mod.

commented

I can reproduce the problem with the other compressors, with one obvious difference: their input redstone strengths update as the pressure increases, and the compressors sober up as a consequence. With the Air Compressor, the redstone strength is not changing because its pressure is already maxed. (I assume it's possible to rig up the other compressors this way also, it just didn't work out that way on my first try.)

It looks like RedstoneController.currentRedstonePower is not saved with the compressor state. When the game loads, the value is 0. The compressor interprets that as "no redstone signal," and proceeds to start the compressor. The value is not updated until TileEntityBase.onNeighborBlockUpdate is called, which won't happen if the input never changes. Since the Air Compressor was at max input, that call was never made and the redstone state was never synchronized.

Just spitballing here, but I wanted to put it out there to see what you think.

commented

Easier way to reproduce: stick a redstone torch next to a compressor set to start on a low signal.

First Session (works):
image
image

Second Session (broken):
image
image

commented

Thanks for the detailed analysis. I believe you're correct; I'll take a closer look at this tomorrow.

The redstone controller's current level shouldn't need to be saved - it's a dynamically calculated value. The bug is that's it's not properly reinitialised on first reload.

commented

Fixed in 2.13.0