Xalcon / EnergyConverters

Simple mod which provides a few blocks which can convert energy from and to EU or RF
MIT License
12 stars 17 forks source link

MJ Producer draws far too much power #59

Closed vladmarica closed 4 years ago

vladmarica commented 4 years ago

I was testing out my Energy Meters mod using this mod to generate MJ and I noticed that the MJ Producer draws far too much power from the Energy Bridge.

The Problem

If the Energy Bridge is full and the MJ Producer is connected to an IMjReceiver that requests 2 MJ, it will supply the 2 MJ and use up all of the energy in the bridge in a single tick. This problem is caused by this segment: https://github.com/Xalcon/EnergyConverters/blob/696bcf8fb9c1c2ced487fcd3bd78172ce3d1b7a7/src/main/java/net/xalcon/energyconverters/common/tiles/TileEntityProducerMj.java#L51-L53

available - taken is an MJ value, it needs to be scaled down to Energy Bridge units before calling retrieveEnergyFromBridge.

Xalcon commented 4 years ago

i could swear I've fixed this bug in the past >_> Thank you for your contribution.

vladmarica commented 4 years ago

Ah, I see, you had previously fixed a similar issue with the MJ Consumer. I guess this solves the problem on the Producer side. Thanks for accepting my PR!