Examples of IGridNode


Examples of appeng.api.networking.IGridNode

        if ( getPart( s ) != null || isBlocked( s ) )
          sides.remove( s );
      }

      getCenter().setValidSides( sides );
      IGridNode n = getCenter().getGridNode();
      if ( n != null )
        n.updateState();
    }
  }
View Full Code Here

Examples of appeng.api.networking.IGridNode

            bp.onPlacement( player, is, side );

          if ( inWorld )
            bp.addToWorld();

          IGridNode cn = getCenter().getGridNode();
          if ( cn != null )
          {
            for (ForgeDirection ins : ForgeDirection.VALID_DIRECTIONS)
            {
              IPart sbp = getPart( ins );
              if ( sbp != null )
              {
                IGridNode sn = sbp.getGridNode();
                if ( sn != null )
                {
                  try
                  {
                    new GridConnection( cn, sn, ForgeDirection.UNKNOWN );
                  }
                  catch (FailedConnection e)
                  {
                    // ekk!

                    bp.removeFromWorld();
                    setCenter( null );
                    return null;
                  }
                }
              }
            }
          }

          updateConnections();
          markForUpdate();
          markForSave();
          partChanged();
          return ForgeDirection.UNKNOWN;
        }
        else if ( bp != null && !(bp instanceof IPartCable) && side != ForgeDirection.UNKNOWN )
        {
          IPart cable = getPart( ForgeDirection.UNKNOWN );
          if ( cable != null && !bp.canBePlacedOn( ((IPartCable) cable).supportsBuses() ) )
            return null;

          setSide( side, bp );
          bp.setPartHostInfo( side, this, this.getTile() );

          if ( player != null )
            bp.onPlacement( player, is, side );

          if ( inWorld )
            bp.addToWorld();

          if ( getCenter() != null )
          {
            IGridNode cn = getCenter().getGridNode();
            IGridNode sn = bp.getGridNode();

            if ( cn != null && sn != null )
            {
              try
              {
View Full Code Here

Examples of appeng.api.networking.IGridNode

        part.setPartHostInfo( s, this, te );
        part.addToWorld();

        if ( s != ForgeDirection.UNKNOWN )
        {
          IGridNode sn = part.getGridNode();
          if ( sn != null )
          {
            // this is a really stupid if statement, why was this
            // here?
            // if ( !sn.getConnections().iterator().hasNext() )

            IPart center = getPart( ForgeDirection.UNKNOWN );
            if ( center != null )
            {
              IGridNode cn = center.getGridNode();
              if ( cn != null )
              {
                try
                {
                  AEApi.instance().createGridConnection( cn, sn );
View Full Code Here

Examples of appeng.api.networking.IGridNode

  public IGridNode getGridNode(ForgeDirection side)
  {
    IPart part = getPart( side );
    if ( part != null )
    {
      IGridNode n = part.getExternalFacingNode();
      if ( n != null )
        return n;
    }

    if ( getCenter() != null )
View Full Code Here

Examples of appeng.api.networking.IGridNode

    {
      boolean Active = true;

      if ( cc instanceof IActionHost )
      {
        IGridNode node = ((IActionHost) cc).getActionableNode();
        if ( node != null && node.isActive() )
          Active = true;
        else
          Active = false;
      }
View Full Code Here

Examples of appeng.api.networking.IGridNode

  }

  @MENetworkEventSubscribe
  void updateNodReq(MENetworkChannelChanged ev)
  {
    IGridNode gridNode = ev.node;

    if ( gridNode.getGridBlock().getFlags().contains( GridFlags.REQUIRE_CHANNEL ) )
      requireChannels.add( gridNode );
    else
      requireChannels.remove( gridNode );

    repath();
View Full Code Here

Examples of appeng.api.networking.IGridNode

    {
      controllerState = ControllerState.NO_CONTROLLER;
    }
    else
    {
      IGridNode startingNode = controllers.iterator().next().getGridNode( ForgeDirection.UNKNOWN );
      if ( startingNode == null )
      {
        controllerState = ControllerState.CONTROLLER_CONFLICT;
        return;
      }

      DimensionalCoord dc = startingNode.getGridBlock().getLocation();
      ControllerValidator cv = new ControllerValidator( dc.x, dc.y, dc.z );

      startingNode.beginVisit( cv );

      if ( cv.isValid && cv.found == controllers.size() )
        controllerState = ControllerState.CONTROLLER_ONLINE;
      else
        controllerState = ControllerState.CONTROLLER_CONFLICT;
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.