Adds a debug generator for ForgeEnergy. (#3259)

* Adds a debug generator for ForgeEnergy.

This adds a simple debug block to test external energy injection via
ForgeEnergy and not rely solely on creative cells.

The energy has two functions. The first is acting as an infinite
ForgEnergy battery, this is unused by AE2 itself as nothing pulls
energy.
The second one is injecting energy every tick into any adjacent block
accepting ForgeEnergy.
The base generation is 8 per tick, but this is increased by the power of
adjacent TileEnergyGenerators.
This commit is contained in:
yueh
2017-12-21 17:29:39 +01:00
committed by GitHub
parent 641d0d40cc
commit e243c8e9a2
9 changed files with 215 additions and 5 deletions
+9 -5
View File
@@ -336,10 +336,7 @@ public class EnergyGridCache implements IEnergyGrid
@Override
public double injectProviderPower( double amt, final Actionable mode )
{
if( mode == Actionable.MODULATE )
{
this.tickInjectionPerTick += amt;
}
final double originalAmount = amt;
final Iterator<IAEPowerStorage> it = this.requesters.iterator();
@@ -354,7 +351,14 @@ public class EnergyGridCache implements IEnergyGrid
}
}
return Math.max( 0.0, amt );
final double overflow = Math.max( 0.0, amt );
if( mode == Actionable.MODULATE )
{
this.tickInjectionPerTick += originalAmount - overflow;
}
return overflow;
}
@Override