Cables access the opposite side for energy I/O
Frinn38 opened this issue ยท 3 comments
Bug description
Cables from this mod access the energy capability from the opposite side of the block they are next to.
This is probably caused by these lines :
https://github.com/henkelmax/corelib/blob/63d7ba9217af8cef43fcfbfd96ed7a51572f1cbd/src/main/java/de/maxhenkel/corelib/energy/EnergyUtils.java#L49
and
https://github.com/henkelmax/corelib/blob/63d7ba9217af8cef43fcfbfd96ed7a51572f1cbd/src/main/java/de/maxhenkel/corelib/energy/EnergyUtils.java#L62
where Direction#getOpposite
is called twice, resulting in the original side the cable is pointing at, instead of the opposite one.
Steps to reproduce the issue
- Place a block that use energy and whose sides can be configured to accept energy or not (any mekanism machine for example)
- Configure the machine to accept energy only from the left side.
- Place a cable on the right side of the machine, it won't connect visually because the right side of the machine doesn't accept energy (normal behaviour).
- Put energy into the cable (using any generator) and see the machine energy buffer being filled because the cable try to push energy to the opposite (left) side of the machine.
Expected behavior
The cable should push energy on the correct side of the machine.
Log files
I believe logs won't be useful here, if you really want I can provide them thought.
Versions
- Minecraft version : 1.18.2
- Forge version : 40.1.68
- Mod version : 1.0.1
Other mods
Mekanism, or any other mod that add tile entities with configurable sided energy input.
I believe the issue also happen with only Ultimate Car Mod, just it can't be noticed since this mod machines doesn't have configurable energy input.
I forgot to mention that the same bug happen when the cable extract energy, not only when pushing.
No it doesn't...
bug.webm
Visually the cable doesn't connect but the machine still receive energy.
That's because even though the cable is on the right of the machine, it tries to send energy on the left side, which is configured as input.