[1.14.4] Transformer and HV Transformer do not re-accept wires after a wire was removed
gyroplast opened this issue ยท 0 comments
Description of the issue:
Connecting a Transformer or HV Transformer to any relay connector with any wire (within valid combinations) works only once.
After removing a connected wire by breaking the relay connector, or using the wire cutters, attempting to reconnect a wire to the same transformer side prints "You cannot attach this wire here" to the player chat on right-clicking the transformer connector, and no wire is linked. Attaching a different wire type to the other transformer side still works, once, but then shows the same faulty behaviour of not reaccepting any wire on that side as well. First linking a relay connector and attempting to connect to the transformer also does not work, same message is printed.
Breaking and replacing the transformer resets the situation, and is a suitable workaround if you need rewiring.
Did some tracing and realized that removing the cable does not reset the leftType/rightType members in the TransformerTileEntity to null, and a canAttach() check down the road returns false early as atConn is stored as a non-null value, despite the connection being removed in game. I could verify with NBTEdit that removing the NBT key named leftType (in this particular test with copper wire attached on the left connector) on the bottom master block did solve the issue, and I could connect a copper wire again. Once.
It is not immediately obvious to me why the existing removeCable() method is not called, or why the NBT data is not reset as intended, but this seems to be the place to look, and it appears to be affecting several TypeEntities in a fundamental way.
Fun fact, the removeCable() method is also not called for at least the Breaker Switch. Its internal wires NBT counter is incremented every time I connect a wire, but not decremented ever.
Crashlog:
No crash.
Versions & Modlist
- Minecraft 1.14.4
- Forge 28.2.3
- ImmersiveEngineering 0.14-95+e47805cd (current HEAD, self-built)