AlmuraDev / SGCraft

Stargates mod for Minecraft
https://www.almuramc.com/sgcraft/SGCraft.html
MIT License
31 stars 29 forks source link

RF consume problem #84

Closed squall-tech closed 5 years ago

squall-tech commented 5 years ago

I`m creating a pull request to solve the problem that the portal don't consume RF.

--the problem--- There is 2 places to storage the energy, one is the energyBuffer other is EnergyStorage.

When the method drawEnergyDouble from PowerTE is called, the energy is extracted from energyBuffer but is not updated to EnergyStorage class.

The method receiveEnergy, call this: int result = storage.receiveEnergy(maxReceive, simulate); but the EnergyStorage it's always full, so the result is always zero, and don't extract the energy from the conection. and you update the buffer with this line: energyBuffer = storage.getEnergyStored();

The only way to consume energy is when you connect for the first time.

I removed the EnergyStorage because there is no reason to store in 2 different places the energy.

squall-tech commented 5 years ago

Well, new commit with liach suggestions