Examples of IGridNode


Examples of appeng.api.networking.IGridNode

  {
    TileCraftingTile core = getCore();
    if ( core == null )
      return false;

    IGridNode node = core.getActionableNode();
    if ( node == null )
      return false;

    return node.isActive();
  }
View Full Code Here

Examples of appeng.api.networking.IGridNode

    Container con = pmp.openContainer;

    if ( con != null && con instanceof IContainerCraftingPacket )
    {
      IContainerCraftingPacket cct = (IContainerCraftingPacket) con;
      IGridNode node = cct.getNetworkNode();
      if ( node != null )
      {
        IGrid grid = node.getGrid();
        if ( grid == null )
          return;

        IStorageGrid inv = grid.getCache( IStorageGrid.class );
        IEnergyGrid energy = grid.getCache( IEnergyGrid.class );
View Full Code Here

Examples of appeng.api.networking.IGridNode

      if ( sideA.isActive() && sideB.isActive() )
      {
        if ( connection != null && connection.connection != null )
        {
          IGridNode a = connection.connection.a();
          IGridNode b = connection.connection.b();
          IGridNode sa = sideA.getNode();
          IGridNode sb = sideB.getNode();
          if ( (a == sa || b == sa) && (a == sb || b == sb) )
            return;
        }

        try
View Full Code Here

Examples of appeng.api.networking.IGridNode

      // :P
    }

    if ( obj instanceof IGridHost )
    {
      IGridNode n = ((IGridHost) obj).getGridNode( ForgeDirection.UNKNOWN );
      if ( n != null )
      {
        targetGrid = n.getGrid();
        if ( targetGrid != null )
        {
          sg = targetGrid.getCache( IStorageGrid.class );
          if ( sg != null )
            itemStorage = sg.getItemInventory();
View Full Code Here

Examples of appeng.api.networking.IGridNode

    }
    else if ( src.isMachine() )
    {
      if ( security.isAvailable() )
      {
        IGridNode n = ((MachineSource) src).via.getActionableNode();
        if ( n == null )
          return true;

        IGrid gn = n.getGrid();
        if ( gn != security.myGrid )
        {
          int playerID = -1;

          ISecurityGrid sg = gn.getCache( ISecurityGrid.class );
View Full Code Here

Examples of appeng.api.networking.IGridNode

  {
    super.writeToNBT( data );

    if ( Platform.isServer() )
    {
      IGridNode node = getGridNode();
      int howMany = 0;

      if ( node != null )
      {
        for (IGridConnection gc : node.getConnections())
          howMany = Math.max( gc.getUsedChannels(), howMany );

        data.setByte( "usedChannels", (byte) howMany );
      }
    }
View Full Code Here

Examples of appeng.api.networking.IGridNode

  public void writeToStream(ByteBuf data) throws IOException
  {
    int cs = 0;
    int sideOut = 0;

    IGridNode n = getGridNode();
    if ( n != null )
    {
      for (ForgeDirection thisSide : ForgeDirection.VALID_DIRECTIONS)
      {
        IPart part = getHost().getPart( thisSide );
        if ( part != null )
        {
          if ( part.getGridNode() != null )
          {
            IReadOnlyCollection<IGridConnection> set = part.getGridNode().getConnections();
            for (IGridConnection gc : set)
            {
              if ( proxy.getNode().hasFlag( GridFlags.DENSE_CAPACITY ) && gc.getOtherSide( proxy.getNode() ).hasFlag( GridFlags.DENSE_CAPACITY ) )
                sideOut |= (gc.getUsedChannels() / 4) << (4 * thisSide.ordinal());
              else
                sideOut |= (gc.getUsedChannels()) << (4 * thisSide.ordinal());
            }
          }
        }
      }

      for (IGridConnection gc : n.getConnections())
      {
        ForgeDirection side = gc.getDirection( n );
        if ( side != ForgeDirection.UNKNOWN )
        {
          boolean isTier2a = proxy.getNode().hasFlag( GridFlags.DENSE_CAPACITY );
View Full Code Here

Examples of appeng.api.networking.IGridNode

  {
    bch.addBox( 6.0, 6.0, 6.0, 10.0, 10.0, 10.0 );

    if ( Platform.isServer() )
    {
      IGridNode n = getGridNode();
      if ( n != null )
        connections = n.getConnectedSides();
      else
        connections.clear();
    }

    IPartHost ph = getHost();
View Full Code Here

Examples of appeng.api.networking.IGridNode

    Iterator<IGridHost> i = c.getTiles();
    while (i.hasNext())
    {
      IGridHost gh = i.next();
      IGridNode n = gh.getGridNode( ForgeDirection.UNKNOWN );
      if ( n != null )
      {
        IGrid g = n.getGrid();
        if ( g != null )
        {
          g.postEvent( new MENetworkCraftingCpuChange( n ) );
          return;
        }
View Full Code Here

Examples of appeng.api.networking.IGridNode

      ContainerCraftAmount cca = (ContainerCraftAmount) player.openContainer;
      Object target = cca.getTarget();
      if ( target instanceof IGridHost )
      {
        IGridHost gh = (IGridHost) target;
        IGridNode gn = gh.getGridNode( ForgeDirection.UNKNOWN );
        if ( gn == null )
          return;

        IGrid g = gn.getGrid();
        if ( g == null || cca.whatToMake == null )
          return;

        Future<ICraftingJob> futureJob = null;
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.