Package appeng.client.render

Examples of appeng.client.render.BlockRenderInfo


  @Override
  public boolean renderInWorld(AEBaseBlock block, IBlockAccess world, int x, int y, int z, RenderBlocks renderer)
  {
    TileInterface ti = block.getTileEntity( world, x, y, z );

    BlockRenderInfo info = block.getRendererInstance();

    if ( ti.getForward() != ForgeDirection.UNKNOWN )
    {
      IIcon side = ExtraBlockTextures.BlockInterfaceAlternateArrow.getIcon();
      info.setTemporaryRenderIcons( ExtraBlockTextures.BlockInterfaceAlternate.getIcon(), block.getIcon( 0, 0 ), side, side, side, side );
    }

    boolean fz = super.renderInWorld( block, world, x, y, z, renderer );

    info.setTemporaryRenderIcon( null );

    return fz;
  }
View Full Code Here


          renderer.uvRotateNorth = 1;
          renderer.uvRotateSouth = 2;
        }
      }

      BlockRenderInfo bri = imb.getRendererInstance();
      bri.setTemporaryRenderIcon( null );
      bri.setTemporaryRenderIcons( getBlockTextureFromSideOutside( imb, sp, displayBits, ori, ForgeDirection.UP ),
          getBlockTextureFromSideOutside( imb, sp, displayBits, ori, ForgeDirection.DOWN ),
          getBlockTextureFromSideOutside( imb, sp, displayBits, ori, ForgeDirection.SOUTH ),
          getBlockTextureFromSideOutside( imb, sp, displayBits, ori, ForgeDirection.NORTH ),
          getBlockTextureFromSideOutside( imb, sp, displayBits, ori, ForgeDirection.EAST ),
          getBlockTextureFromSideOutside( imb, sp, displayBits, ori, ForgeDirection.WEST ) );

      boolean r = renderer.renderStandardBlock( imb, x, y, z );

      if ( (displayBits & sp.DISPLAY_POWERED_ENABLED) == sp.DISPLAY_POWERED_ENABLED )
      {
        int bn = 15;
        Tessellator.instance.setBrightness( bn << 20 | bn << 4 );
        Tessellator.instance.setColorOpaque_I( 0xffffff );

        for (ForgeDirection d : ForgeDirection.VALID_DIRECTIONS)
          renderFace( x, y, z, imb, getBlockTextureFromSideInside( imb, sp, displayBits, ori, d ), renderer, d );
      }
      else
      {
        bri.setTemporaryRenderIcon( null );
        bri.setTemporaryRenderIcons( getBlockTextureFromSideInside( imb, sp, displayBits, ori, ForgeDirection.UP ),
            getBlockTextureFromSideInside( imb, sp, displayBits, ori, ForgeDirection.DOWN ),
            getBlockTextureFromSideInside( imb, sp, displayBits, ori, ForgeDirection.SOUTH ),
            getBlockTextureFromSideInside( imb, sp, displayBits, ori, ForgeDirection.NORTH ),
            getBlockTextureFromSideInside( imb, sp, displayBits, ori, ForgeDirection.EAST ),
            getBlockTextureFromSideInside( imb, sp, displayBits, ori, ForgeDirection.WEST ) );

        renderer.renderStandardBlock( imb, x, y, z );
      }

      bri.setTemporaryRenderIcon( null );
      renderer.uvRotateEast = renderer.uvRotateWest = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateBottom = 0;

      return r;
    }
View Full Code Here

    centerX = 0;
    centerY = 0;
    centerZ = 0;
    hasChan = false;
    hasPower = false;
    BlockRenderInfo ri = blk.getRendererInstance();
    Tessellator tess = Tessellator.instance;

    renderer.renderAllFaces = true;

    IIcon r = CableBusTextures.PartMonitorSidesStatus.getIcon();
    ri.setTemporaryRenderIcons( r, r, CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), r, r );
    renderBlockBounds( renderer, 5, 5, 0, 11, 11, 1, ForgeDirection.EAST, ForgeDirection.UP, ForgeDirection.SOUTH );
    renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, tess, 0xffffff, renderer );

    r = CableBusTextures.PartWirelessSides.getIcon();
    ri.setTemporaryRenderIcons( r, r, ExtraBlockTextures.BlockWirelessInside.getIcon(), ExtraBlockTextures.BlockWirelessInside.getIcon(), r, r );
    renderBlockBounds( renderer, 5, 5, 1, 11, 11, 2, ForgeDirection.EAST, ForgeDirection.UP, ForgeDirection.SOUTH );
    renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, is, tess, 0xffffff, renderer );

    tess.startDrawingQuads();
    ri.setTemporaryRenderIcon( null );
    renderTorchAtAngle( renderer, ForgeDirection.EAST, ForgeDirection.UP, ForgeDirection.SOUTH );
    super.postRenderInWorld( renderer );
    tess.draw();

    ri.setTemporaryRenderIcons( r, r, ExtraBlockTextures.BlockWirelessInside.getIcon(), ExtraBlockTextures.BlockWirelessInside.getIcon(), r, r );

    ForgeDirection sides[] = new ForgeDirection[] { ForgeDirection.EAST, ForgeDirection.WEST, ForgeDirection.UP, ForgeDirection.DOWN };

    int s = 1;
View Full Code Here

    if ( tw != null )
    {
      hasChan = (tw.clientFlags & (TileWireless.POWERED_FLAG | TileWireless.CHANNEL_FLAG)) == (TileWireless.POWERED_FLAG | TileWireless.CHANNEL_FLAG);
      hasPower = (tw.clientFlags & TileWireless.POWERED_FLAG) == TileWireless.POWERED_FLAG;

      BlockRenderInfo ri = blk.getRendererInstance();

      ForgeDirection fdy = tw.getUp();
      ForgeDirection fdz = tw.getForward();
      ForgeDirection fdx = Platform.crossProduct( fdz, fdy ).getOpposite();

      renderer.renderAllFaces = true;

      IIcon r = CableBusTextures.PartMonitorSidesStatus.getIcon();
      ri.setTemporaryRenderIcons( r, r, CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), r, r );
      renderBlockBounds( renderer, 5, 5, 0, 11, 11, 1, fdx, fdy, fdz );
      super.renderInWorld( blk, world, x, y, z, renderer );

      r = CableBusTextures.PartWirelessSides.getIcon();
      ri.setTemporaryRenderIcons( r, r, ExtraBlockTextures.BlockWirelessInside.getIcon(), ExtraBlockTextures.BlockWirelessInside.getIcon(), r, r );
      renderBlockBounds( renderer, 5, 5, 1, 11, 11, 2, fdx, fdy, fdz );
      super.renderInWorld( blk, world, x, y, z, renderer );

      centerX = x;
      centerY = y;
      centerZ = z;
      ri.setTemporaryRenderIcon( null );

      renderTorchAtAngle( renderer, fdx, fdy, fdz );
      super.postRenderInWorld( renderer );

      ri.setTemporaryRenderIcons( r, r, ExtraBlockTextures.BlockWirelessInside.getIcon(), ExtraBlockTextures.BlockWirelessInside.getIcon(), r, r );

      ForgeDirection sides[] = new ForgeDirection[] { ForgeDirection.EAST, ForgeDirection.WEST, ForgeDirection.UP, ForgeDirection.DOWN };

      int s = 1;

      for (ForgeDirection side : sides)
      {
        renderBlockBounds( renderer, 8 + (side.offsetX != 0 ? side.offsetX * 2 : -2), 8 + (side.offsetY != 0 ? side.offsetY * 2 : -2), 2
            + (side.offsetZ != 0 ? side.offsetZ * 2 : -1) + s, 8 + (side.offsetX != 0 ? side.offsetX * 4 : 2),
            8 + (side.offsetY != 0 ? side.offsetY * 4 : 2), 2 + (side.offsetZ != 0 ? side.offsetZ * 5 : 1) + s, fdx, fdy, fdz );
        super.renderInWorld( blk, world, x, y, z, renderer );
      }

      s = 3;
      for (ForgeDirection side : sides)
      {
        renderBlockBounds( renderer, 8 + (side.offsetX != 0 ? side.offsetX * 4 : -1), 8 + (side.offsetY != 0 ? side.offsetY * 4 : -1), 1
            + (side.offsetZ != 0 ? side.offsetZ * 4 : -1) + s, 8 + (side.offsetX != 0 ? side.offsetX * 5 : 1),
            8 + (side.offsetY != 0 ? side.offsetY * 5 : 1), 2 + (side.offsetZ != 0 ? side.offsetZ * 5 : 1) + s, fdx, fdy, fdz );
        super.renderInWorld( blk, world, x, y, z, renderer );
      }

      r = CableBusTextures.PartMonitorSidesStatusLights.getIcon();
      // ri.setTemporaryRenderIcons( r, r, ExtraTextures.BlockChargerInside.getIcon(),
      // ExtraTextures.BlockChargerInside.getIcon(), r, r );
      renderBlockBounds( renderer, 5, 5, 0, 11, 11, 1, fdx, fdy, fdz );

      if ( hasChan )
      {
        int l = 14;
        Tessellator.instance.setBrightness( l << 20 | l << 4 );
        Tessellator.instance.setColorOpaque_I( AEColor.Transparent.blackVariant );
      }
      else if ( hasPower )
      {
        int l = 9;
        Tessellator.instance.setBrightness( l << 20 | l << 4 );
        Tessellator.instance.setColorOpaque_I( AEColor.Transparent.whiteVariant );
      }
      else
      {
        Tessellator.instance.setBrightness( 0 );
        Tessellator.instance.setColorOpaque_I( 0x000000 );
      }

      if ( ForgeDirection.UP != fdz.getOpposite() )
        super.renderFace( x, y, z, blk, r, renderer, ForgeDirection.UP );
      if ( ForgeDirection.DOWN != fdz.getOpposite() )
        super.renderFace( x, y, z, blk, r, renderer, ForgeDirection.DOWN );
      if ( ForgeDirection.EAST != fdz.getOpposite() )
        super.renderFace( x, y, z, blk, r, renderer, ForgeDirection.EAST );
      if ( ForgeDirection.WEST != fdz.getOpposite() )
        super.renderFace( x, y, z, blk, r, renderer, ForgeDirection.WEST );
      if ( ForgeDirection.SOUTH != fdz.getOpposite() )
        super.renderFace( x, y, z, blk, r, renderer, ForgeDirection.SOUTH );
      if ( ForgeDirection.NORTH != fdz.getOpposite() )
        super.renderFace( x, y, z, blk, r, renderer, ForgeDirection.NORTH );

      ri.setTemporaryRenderIcon( null );
      renderer.renderAllFaces = false;
    }

    return true;
  }
View Full Code Here

  @Override
  @SideOnly(Side.CLIENT)
  public void registerBlockIcons(IIconRegister iconRegistry)
  {
    BlockRenderInfo info = getRendererInstance();
    FlippableIcon topIcon;
    FlippableIcon bottomIcon;
    FlippableIcon sideIcon;
    FlippableIcon eastIcon;
    FlippableIcon westIcon;
    FlippableIcon southIcon;
    FlippableIcon northIcon;

    this.blockIcon = topIcon = optionalIcon( iconRegistry, this.getTextureName(), null );
    bottomIcon = optionalIcon( iconRegistry, this.getTextureName() + "Bottom", topIcon );
    sideIcon = optionalIcon( iconRegistry, this.getTextureName() + "Side", topIcon );
    eastIcon = optionalIcon( iconRegistry, this.getTextureName() + "East", sideIcon );
    westIcon = optionalIcon( iconRegistry, this.getTextureName() + "West", sideIcon );
    southIcon = optionalIcon( iconRegistry, this.getTextureName() + "Front", sideIcon );
    northIcon = optionalIcon( iconRegistry, this.getTextureName() + "Back", sideIcon );

    info.updateIcons( bottomIcon, topIcon, northIcon, southIcon, eastIcon, westIcon );
  }
View Full Code Here

    info.updateIcons( bottomIcon, topIcon, northIcon, southIcon, eastIcon, westIcon );
  }

  public void registerNoIcons()
  {
    BlockRenderInfo info = getRendererInstance();
    FlippableIcon i = new FlippableIcon( new MissingIcon( this ) );
    info.updateIcons( i, i, i, i, i, i );
  }
View Full Code Here

    if ( renderInfo != null )
      return renderInfo;

    try
    {
      return renderInfo = new BlockRenderInfo( getRenderer().newInstance() );
    }
    catch (Throwable t)
    {
      throw new RuntimeException( t );
    }
View Full Code Here

TOP

Related Classes of appeng.client.render.BlockRenderInfo

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.