try to fix energy issues again

fix issue with voiding p2p parts when shift-right clicking with a memory card
This commit is contained in:
Salomão
2021-09-04 18:59:28 -03:00
parent c284748b6c
commit d229570495
3 changed files with 6 additions and 7 deletions
+4 -5
View File
@@ -191,6 +191,10 @@ public class EnergyGridCache implements IEnergyGrid
@Override
public void onUpdateTick()
{
if( localStorage.stored < MAX_BUFFER_STORAGE - 0.001 )
{
this.myGrid.postEvent( new MENetworkPowerStorage( localStorage, PowerEventType.REQUEST_POWER ) );
}
if( !this.interests.isEmpty() )
{
final double oldPower = this.lastStoredPower;
@@ -833,11 +837,6 @@ public class EnergyGridCache implements IEnergyGrid
{
this.stored -= amount;
if( this.stored < MAX_BUFFER_STORAGE - 0.001 )
{
EnergyGridCache.this.myGrid.postEvent( new MENetworkPowerStorage( this, PowerEventType.REQUEST_POWER ) );
}
if( this.stored < 0.01 )
{
EnergyGridCache.this.ticksSinceHasPowerChange = 0;