Examples of ISpatialStorageCell


Examples of appeng.api.implementations.items.ISpatialStorageCell

    if ( isSpatialCell( cell ) && getStackInSlot( 1 ) == null )
    {
      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 );
View Full Code Here

Examples of appeng.api.implementations.items.ISpatialStorageCell

  private boolean isSpatialCell(ItemStack cell)
  {
    if ( cell != null && cell.getItem() instanceof ISpatialStorageCell )
    {
      ISpatialStorageCell sc = (ISpatialStorageCell) cell.getItem();
      return sc != null && sc.isSpatialStorage( cell );
    }
    return false;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.