[BUG]Transformers nonfunctional on placement.

  • Sometimes transformers seem to fail to connect and need a redstone state change before they start working(i.e. downwards transformers need to state changes)
    Problem Scenario:


    Drop a transformer into prelaid wiring, and if it's placed in certain directions, it won't function till you apply and remove a redstone signal.


    Solution:


    In the blockElectric source file, you are calling the setFacing function from the onBlockPlacedBy function. Change all these setFacing functions to alterFacing functions, as setFacing doesn't update the EnergyNet.(it's lines 171-191 in my decompiled version code)
    Had same issue with my Power Regulator addon, applied this fix to it, it now functions correctly.


    (not many bug reports come with detailed code fixing instructions and all, huh?)

    • Official Post

    You're partially right. It was bugged because the transformer wasn't added to the EnergyNet. The alterFacing removes+adds the TE from/to the EnergyNet as well so it symptomatically fixes the issue as well.


    Usually adding to the EnergyNet happens at the beginning of updateEntity() with an addedToEnergyNet flag, removing goes into invalidate().


    I actually fixed the bug a couple hours after the 1.00 release, but thanks for the great report anyway.