Fix when Mattery energy is exposed as Mekanism energy it ignore energy flow direction
Just like Mekanism for a long time ignored throughput limits when something charge its items through Forge Energy
This commit is contained in:
parent
d2c2fbd3d2
commit
c887025a6c
@ -170,11 +170,11 @@ class Mattery2MekanismEnergyWrapper(private val power: IMatteryEnergyStorage) :
|
|||||||
|
|
||||||
override fun insertEnergy(container: Int, howMuch: FloatingLong, action: Action): FloatingLong {
|
override fun insertEnergy(container: Int, howMuch: FloatingLong, action: Action): FloatingLong {
|
||||||
val copy = howMuch.copy()
|
val copy = howMuch.copy()
|
||||||
return copy.minusEqual((power.receiveEnergy(howMuch.toDecimal() * Mekanism2MatteryEnergyWrapper.mekanism2MtJ, action.simulate()) * mtj2Mekanism).toFloatingLong())
|
return copy.minusEqual((power.receiveEnergyChecked(howMuch.toDecimal() * Mekanism2MatteryEnergyWrapper.mekanism2MtJ, action.simulate()) * mtj2Mekanism).toFloatingLong())
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun extractEnergy(container: Int, howMuch: FloatingLong, action: Action): FloatingLong {
|
override fun extractEnergy(container: Int, howMuch: FloatingLong, action: Action): FloatingLong {
|
||||||
return (power.extractEnergy(howMuch.toDecimal() * Mekanism2MatteryEnergyWrapper.mekanism2MtJ, action.simulate()) * mtj2Mekanism).toFloatingLong()
|
return (power.extractEnergyChecked(howMuch.toDecimal() * Mekanism2MatteryEnergyWrapper.mekanism2MtJ, action.simulate()) * mtj2Mekanism).toFloatingLong()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user