Immersive Railroading

Immersive Railroading

3M Downloads

Inconsistent output behaviors between machines with similar output methods

littlej541 opened this issue ยท 2 comments

commented

Describe the bug
Right-clicking on a machine with a completed output is inconsistent between the boiler/rail roller, plate roller, and casting basin. The steam hammer does not apply since the output is handled a different way. This inconsistency is caused by two things. First, the OnBlockActivated function always returns false on the boiler/rail rollers and maybe false but mostly true on the plate roller while on the client. When false is returned, the game will also run the function with the off-hand as an input. Second, the roller machines check if the hand is empty or has the appropriate input. This causes a disparity between the rollers and the casting basin since the basin does not check at all what is any hand. These cause the following behaviors for each machine:

Boiler/Rail MH Empty MH Full
OH Empty Get output Get output
OH Full Get output Don't get output
Plate MH Empty MH Full
OH Empty Get output Don't get output
OH Full Get output Don't get output
Casting Basin MH Empty MH Full
OH Empty Get output Get output
OH Full Get output Get output

How to reproduce
Steps to reproduce the unwanted behavior:

  1. Attempt to get various machine outputs with items in differing combinations between hands
  2. Get inconsistent results between machines

Expected behavior
The interaction with the aforementioned machines while getting outputs working the same way, since their output methods are the same.

System Information

  • IR-Version: 1.7.3_1.12.2
  • Forge-Version: 1.12.2-14.23.4.2705, 1.12.2-14.23.5.2854

Additional context
I think it would be best to allow the items to be retrieved regardless of hand state, barring an input capable item in the main-hand. This seems like the natural expectation to me. To solve this I would change the rolling machines checks in the OnBlockActivated functions from:

if hand_is_empty {
    do_output_processing
} else if hand_has_input_item {
    do_input_processing
}

to:

if hand_has_input_item {
    do_input_processing
} else {
    do_output_processing
}

Regardless of the solution, any change that makes them consistent would be better.

commented

This might explain why I have lost several blocks of steel when right-clicking on a finished Plate Machine with a non-empty hand, especially with a finished plate. I'll make sure to empty my off-hand too in the future.

commented

There is actually a separate issue with the Plate Machine that causes you to lose outputs if you click too early after "finishing." I believe it happens with steel blocks in the mainhand, but I cannot remember. It may have been caused by that as well.