IGrid gi = gridProxy.getGrid();
IEnergyGrid energy = gridProxy.getEnergy();
ISpatialStorageCell sc = (ISpatialStorageCell) cell.getItem();
SpatialPylonCache spc = gi.getCache( ISpatialCache.class );
if ( spc.hasRegion() && spc.isValidRegion() )
{
double req = spc.requiredPower();
double pr = energy.extractAEPower( req, Actionable.SIMULATE, PowerMultiplier.CONFIG );
if ( Math.abs( pr - req ) < req * 0.001 )
{
MENetworkEvent res = gi.postEvent( new MENetworkSpatialEvent( this, req ) );
if ( !res.isCanceled() )
{
TransitionResult tr = sc.doSpatialTransition( cell, worldObj, spc.getMin(), spc.getMax(), true );
if ( tr.success )
{
energy.extractAEPower( req, Actionable.MODULATE, PowerMultiplier.CONFIG );
setInventorySlotContents( 0, null );
setInventorySlotContents( 1, cell );