Modular Machinery

Modular Machinery

12M Downloads

[Bug] Energy Duplication with Energy Input Hatch

OneEyeMaker opened this issue ยท 1 comments

commented

Energy Input Hatch (maybe Output too, didn't test) duplicates energy if rate of extracting energy from other storage is bigger than hatch can receive.
How to reproduce:

  1. Configure Energy Hatch to receive specific amount of energy (25000 FE/t in my case)
  2. Place it in world
  3. Place nearby it any energy source with higher energy extraction rate (Tested with Energy Cells from ThermalExpansion and Energy Cubes from Mekanism, extraction rate of both is 125000 FE/t).
  4. Wait until Energy hatch isn't fully chaged (500000 FE in my case).
  5. Check amount of extracted energy (100000 FE in my case).

In other words, Energy Hatch receives energy 5 (= 125000 FE/t extracting / 25000 FE/t receiving) times.

commented

@HellFirePvP
It's the same problem, that was with Item Output hatch: you create two variables, change first one, but use second one.

https://github.com/HellFirePvP/ModularMachinery/blob/master/src/main/java/hellfirepvp/modularmachinery/common/tiles/base/TileEnergyHatch.java#L51-L57

You change value of insertable, but use value of maxReceive.
And again: the less variables you use, the less chance of its confusing.