Tweaked Energy Flow Code for Network Acceptor, should be more what I'm looking for.
This commit is contained in:
parent
9ae4ce54d1
commit
14aba981b2
5 changed files with 11 additions and 8 deletions
|
@ -19,6 +19,7 @@ public class BlockGrinder extends AEBaseBlock
|
|||
super( BlockGrinder.class, Material.rock );
|
||||
setfeature( EnumSet.of( AEFeature.GrindStone ) );
|
||||
setTileEntiy( TileGrinder.class );
|
||||
setHardness( 3.2F );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -27,7 +28,7 @@ public class BlockGrinder extends AEBaseBlock
|
|||
TileGrinder tg = getTileEntity( w, x, y, z );
|
||||
if ( tg != null && !p.isSneaking() )
|
||||
{
|
||||
Platform.openGUI( p, tg, ForgeDirection.getOrientation(side),GuiBridge.GUI_GRINDER );
|
||||
Platform.openGUI( p, tg, ForgeDirection.getOrientation( side ), GuiBridge.GUI_GRINDER );
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -25,6 +25,7 @@ public class BlockVibrationChamber extends AEBaseBlock
|
|||
super( BlockVibrationChamber.class, Material.iron );
|
||||
setfeature( EnumSet.of( AEFeature.PowerGen ) );
|
||||
setTileEntiy( TileVibrationChamber.class );
|
||||
setHardness( 4.2F );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -77,12 +77,10 @@ public class TileEnergyAcceptor extends AENetworkPowerTile
|
|||
try
|
||||
{
|
||||
IEnergyGrid grid = gridProxy.getEnergy();
|
||||
double overFlow = grid.injectPower( newPower, Actionable.SIMULATE );
|
||||
|
||||
if ( mode == Actionable.MODULATE )
|
||||
grid.injectPower( Math.max( 0.0, newPower - overFlow ), Actionable.MODULATE );
|
||||
|
||||
return super.funnelPowerIntoStorage( overFlow, mode );
|
||||
double leftOver = grid.injectPower( newPower, mode );
|
||||
if ( mode == Actionable.SIMULATE )
|
||||
return leftOver;
|
||||
return 0.0;
|
||||
}
|
||||
catch (GridAccessException e)
|
||||
{
|
||||
|
|
|
@ -73,7 +73,6 @@ public abstract class IC2 extends MinecraftJoules6 implements IEnergySink
|
|||
super.setPowerSides( sides );
|
||||
removeFromENet();
|
||||
addToENet();
|
||||
|
||||
}
|
||||
|
||||
final private void addToENet()
|
||||
|
|
|
@ -30,6 +30,10 @@ public abstract class MinecraftJoules6 extends MinecraftJoules5 implements IBatt
|
|||
@Method(iname = "MJ6")
|
||||
public double addEnergy(double amount)
|
||||
{
|
||||
double demand = getExternalPowerDemand( PowerUnits.MJ, Double.MAX_VALUE );
|
||||
if ( amount > demand )
|
||||
amount = demand;
|
||||
|
||||
double overflow = injectExternalPower( PowerUnits.MJ, amount );
|
||||
return amount - overflow;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue