Package appeng.api.parts

Examples of appeng.api.parts.IPartHost


    return getLayerFlags().contains( LayerFlags.IC2_ENET );
  }

  private TileEntity getEnergySinkTile()
  {
    IPartHost host = (IPartHost) this;
    return host.getTile();
  }
View Full Code Here


        connections = n.getConnectedSides();
      else
        connections.clear();
    }

    IPartHost ph = getHost();
    if ( ph != null )
    {
      for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS)
      {
        IPart p = ph.getPart( dir );
        if ( p instanceof IGridHost )
        {
          double dist = p.cableConnectionRenderTo();

          if ( dist > 8 )
View Full Code Here

  @SideOnly(Side.CLIENT)
  public void renderGlassConnection(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer, ForgeDirection of)
  {
    TileEntity te = this.tile.getWorldObj().getTileEntity( x + of.offsetX, y + of.offsetY, z + of.offsetZ );
    IPartHost partHost = te instanceof IPartHost ? (IPartHost) te : null;
    IGridHost gh = te instanceof IGridHost ? (IGridHost) te : null;

    rh.setFacesToRender( EnumSet.complementOf( EnumSet.of( of ) ) );

    if ( gh != null && partHost != null && gh.getCableConnectionType( of ) == AECableType.GLASS && partHost.getColor() != AEColor.Transparent
        && partHost.getPart( of.getOpposite() ) == null )
      rh.setTexture( getTexture( partHost.getColor() ) );
    else if ( partHost == null && gh != null && gh.getCableConnectionType( of ) != AECableType.GLASS )
    {
      rh.setTexture( getCoveredTexture( getCableColor() ) );
      switch (of)
      {
View Full Code Here

  @SideOnly(Side.CLIENT)
  public void renderCoveredConnection(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer, int channels, ForgeDirection of)
  {
    TileEntity te = this.tile.getWorldObj().getTileEntity( x + of.offsetX, y + of.offsetY, z + of.offsetZ );
    IPartHost partHost = te instanceof IPartHost ? (IPartHost) te : null;
    IGridHost ghh = te instanceof IGridHost ? (IGridHost) te : null;
    boolean isSmart = false;

    rh.setFacesToRender( EnumSet.complementOf( EnumSet.of( of ) ) );
    if ( ghh != null && partHost != null && ghh.getCableConnectionType( of.getOpposite() ) == AECableType.GLASS && partHost.getPart( of.getOpposite() ) == null
        && partHost.getColor() != AEColor.Transparent )
      rh.setTexture( getGlassTexture( partHost.getColor() ) );
    else if ( partHost == null && ghh != null && ghh.getCableConnectionType( of ) != AECableType.GLASS )
    {
      rh.setTexture( getCoveredTexture( getCableColor() ) );
      switch (of)
      {
      case DOWN:
        rh.setBounds( 5, 0, 5, 11, 4, 11 );
        break;
      case EAST:
        rh.setBounds( 12, 5, 5, 16, 11, 11 );
        break;
      case NORTH:
        rh.setBounds( 5, 5, 0, 11, 11, 4 );
        break;
      case SOUTH:
        rh.setBounds( 5, 5, 12, 11, 11, 16 );
        break;
      case UP:
        rh.setBounds( 5, 12, 5, 11, 16, 11 );
        break;
      case WEST:
        rh.setBounds( 0, 5, 5, 4, 11, 11 );
        break;
      default:
        return;
      }

      rh.renderBlock( x, y, z, renderer );

      rh.setTexture( getTexture( getCableColor() ) );
    }
    else if ( ghh != null && partHost != null && ghh.getCableConnectionType( of ) == AECableType.COVERED && partHost.getColor() != AEColor.Transparent
        && partHost.getPart( of.getOpposite() ) == null )
      rh.setTexture( getCoveredTexture( partHost.getColor() ) );
    else if ( ghh != null && partHost != null && ghh.getCableConnectionType( of ) == AECableType.SMART && partHost.getPart( of.getOpposite() ) == null )
    {
      isSmart = true;
      rh.setTexture( getSmartTexture( getCableColor() ) );
    }
    else
View Full Code Here

  @SideOnly(Side.CLIENT)
  public void renderSmartConnection(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer, int channels, ForgeDirection of)
  {
    TileEntity te = this.tile.getWorldObj().getTileEntity( x + of.offsetX, y + of.offsetY, z + of.offsetZ );
    IPartHost partHost = te instanceof IPartHost ? (IPartHost) te : null;
    IGridHost ghh = te instanceof IGridHost ? (IGridHost) te : null;
    boolean isGlass = false;
    AEColor myColor = getCableColor();

    rh.setFacesToRender( EnumSet.complementOf( EnumSet.of( of ) ) );

    if ( ghh != null && partHost != null && ghh.getCableConnectionType( of.getOpposite() ) == AECableType.GLASS && partHost.getPart( of.getOpposite() ) == null
        && partHost.getColor() != AEColor.Transparent )
    {
      isGlass = true;
      rh.setTexture( getGlassTexture( myColor = partHost.getColor() ) );
    }
    else if ( partHost == null && ghh != null && ghh.getCableConnectionType( of.getOpposite() ) != AECableType.GLASS )
    {
      rh.setTexture( getSmartTexture( myColor ) );
      switch (of)
      {
      case DOWN:
        rh.setBounds( 5, 0, 5, 11, 4, 11 );
        break;
      case EAST:
        rh.setBounds( 12, 5, 5, 16, 11, 11 );
        break;
      case NORTH:
        rh.setBounds( 5, 5, 0, 11, 11, 4 );
        break;
      case SOUTH:
        rh.setBounds( 5, 5, 12, 11, 11, 16 );
        break;
      case UP:
        rh.setBounds( 5, 12, 5, 11, 16, 11 );
        break;
      case WEST:
        rh.setBounds( 0, 5, 5, 4, 11, 11 );
        break;
      default:
        return;
      }
      rh.renderBlock( x, y, z, renderer );

      setSmartConnectionRotations( of, renderer );
      IIcon firstIcon = new TaughtIcon( getChannelTex( channels, false ).getIcon(), -0.2f );
      IIcon secondIcon = new TaughtIcon( getChannelTex( channels, true ).getIcon(), -0.2f );

      if ( of == ForgeDirection.EAST || of == ForgeDirection.WEST )
      {
        AEBaseBlock blk = (AEBaseBlock) rh.getBlock();
        FlippableIcon ico = blk.getRendererInstance().getTexture( ForgeDirection.EAST );
        ico.setFlip( false, true );
      }

      Tessellator.instance.setBrightness( 15 << 20 | 15 << 4 );
      Tessellator.instance.setColorOpaque_I( myColor.blackVariant );
      rh.setTexture( firstIcon, firstIcon, firstIcon, firstIcon, firstIcon, firstIcon );
      renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer );

      Tessellator.instance.setColorOpaque_I( myColor.whiteVariant );
      rh.setTexture( secondIcon, secondIcon, secondIcon, secondIcon, secondIcon, secondIcon );
      renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, rh, renderer );

      renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0;

      rh.setTexture( getTexture( getCableColor() ) );
    }

    else if ( ghh != null && partHost != null && ghh.getCableConnectionType( of ) != AECableType.GLASS && partHost.getColor() != AEColor.Transparent
        && partHost.getPart( of.getOpposite() ) == null )
      rh.setTexture( getSmartTexture( myColor = partHost.getColor() ) );
    else
      rh.setTexture( getSmartTexture( getCableColor() ) );

    switch (of)
    {
View Full Code Here

        }
      }
      else if ( connections.contains( dir ) )
      {
        TileEntity te = this.tile.getWorldObj().getTileEntity( x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ );
        IPartHost partHost = te instanceof IPartHost ? (IPartHost) te : null;
        IGridHost gh = te instanceof IGridHost ? (IGridHost) te : null;
        if ( partHost == null && gh != null && gh.getCableConnectionType( dir ) != AECableType.GLASS )
          requireDetailed = true;
      }
    }

    if ( useCovered )
    {
      rh.setTexture( getCoveredTexture( getCableColor() ) );
    }
    else
    {
      rh.setTexture( getTexture( getCableColor() ) );
    }

    IPartHost ph = getHost();
    for (ForgeDirection of : EnumSet.complementOf( connections ))
    {
      IPart bp = ph.getPart( of );
      if ( bp instanceof IGridHost )
      {
        int len = bp.cableConnectionRenderTo();
        if ( len < 8 )
        {
View Full Code Here

    return getLayerFlags().contains( LayerFlags.IC2_ENET );
  }

  private TileEntity getEnergySourceTile()
  {
    IPartHost host = (IPartHost) this;
    return host.getTile();
  }
View Full Code Here

TOP

Related Classes of appeng.api.parts.IPartHost

Copyright © 2018 www.massapicom. 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.