Package appeng.tile.qnb

Examples of appeng.tile.qnb.TileQuantumBridge


  }

  @Override
  public boolean renderInWorld(AEBaseBlock block, IBlockAccess world, int x, int y, int z, RenderBlocks renderer)
  {
    TileQuantumBridge tqb = block.getTileEntity( world, x, y, z );
    if ( tqb == null )
      return false;

    renderer.renderAllFaces = true;

    if ( tqb.getBlockType() == AEApi.instance().blocks().blockQuantumLink.block() )
    {
      if ( tqb.isFormed() )
      {
        AEColoredItemDefinition glassCableDefinition = AEApi.instance().parts().partCableGlass;
        Item transparentGlassCable = glassCableDefinition.item( AEColor.Transparent );

        AEColoredItemDefinition coveredCableDefinition = AEApi.instance().parts().partCableCovered;
        Item transparentCoveredCable = coveredCableDefinition.item( AEColor.Transparent );

        EnumSet<ForgeDirection> sides = tqb.getConnections();
        renderCableAt( 0.11D, world, x, y, z, block, renderer, transparentGlassCable.getIconIndex( glassCableDefinition.stack( AEColor.Transparent, 1 ) ), 0.141D, sides );
        renderCableAt( 0.188D, world, x, y, z, block, renderer, transparentCoveredCable.getIconIndex( coveredCableDefinition.stack( AEColor.Transparent, 1 ) ), 0.1875D, sides );
      }

      float renderMin = 2.0f / 16.0f;
      float renderMax = 14.0f / 16.0f;
      renderer.setRenderBounds( renderMin, renderMin, renderMin, renderMax, renderMax, renderMax );
      renderer.renderStandardBlock( block, x, y, z );
      // super.renderWorldBlock(world, x, y, z, block, modelId, renderer);
    }
    else
    {
      if ( !tqb.isFormed() )
      {
        float renderMin = 2.0f / 16.0f;
        float renderMax = 14.0f / 16.0f;
        renderer.setRenderBounds( renderMin, renderMin, renderMin, renderMax, renderMax, renderMax );
        renderer.renderStandardBlock( block, x, y, z );
      }
      else if ( tqb.isCorner() )
      {
        // renderCableAt(0.11D, world, x, y, z, block, modelId,
        // renderer,
        // AppEngTextureRegistry.Blocks.MECable.get(), true, 0.0D);
        AEColoredItemDefinition coveredCableDefinition = AEApi.instance().parts().partCableCovered;
        Item transparentCoveredCable = coveredCableDefinition.item( AEColor.Transparent );

        renderCableAt( 0.188D, world, x, y, z, block, renderer, transparentCoveredCable.getIconIndex( coveredCableDefinition.stack( AEColor.Transparent, 1 ) ), 0.05D,
            tqb.getConnections() );

        float renderMin = 4.0f / 16.0f;
        float renderMax = 12.0f / 16.0f;

        renderer.setRenderBounds( renderMin, renderMin, renderMin, renderMax, renderMax, renderMax );
        renderer.renderStandardBlock( block, x, y, z );

        if ( tqb.isPowered() )
        {

          renderMin = 3.9f / 16.0f;
          renderMax = 12.1f / 16.0f;
          renderer.setRenderBounds( renderMin, renderMin, renderMin, renderMax, renderMax, renderMax );

          int bn = 15;
          Tessellator.instance.setColorOpaque_F( 1.0F, 1.0F, 1.0F );
          Tessellator.instance.setBrightness( bn << 20 | bn << 4 );
          for (ForgeDirection side : ForgeDirection.VALID_DIRECTIONS)
            renderFace( x, y, z, block, ExtraBlockTextures.BlockQRingCornerLight.getIcon(), renderer, side );

        }
      }
      else
      {
        float renderMin = 2.0f / 16.0f;
        float renderMax = 14.0f / 16.0f;
        renderer.setRenderBounds( 0, renderMin, renderMin, 1, renderMax, renderMax );
        renderer.renderStandardBlock( block, x, y, z );

        renderer.setRenderBounds( renderMin, 0, renderMin, renderMax, 1, renderMax );
        renderer.renderStandardBlock( block, x, y, z );

        renderer.setRenderBounds( renderMin, renderMin, 0, renderMax, renderMax, 1 );
        renderer.renderStandardBlock( block, x, y, z );

        if ( tqb.isPowered() )
        {
          renderMin = -0.01f / 16.0f;
          renderMax = 16.01f / 16.0f;
          renderer.setRenderBounds( renderMin, renderMin, renderMin, renderMax, renderMax, renderMax );
View Full Code Here


  @Override
  @SideOnly(Side.CLIENT)
  public void randomDisplayTick(World w, int bx, int by, int bz, Random r)
  {
    TileQuantumBridge bridge = getTileEntity( w, bx, by, bz );
    if ( bridge != null )
    {
      if ( bridge.hasQES() )
      {
        if ( CommonHelper.proxy.shouldAddParticles( r ) )
          CommonHelper.proxy.spawnEffect( EffectType.Energy, w, bx + 0.5, by + 0.5, bz + 0.5, null );
      }
    }
View Full Code Here

  }

  @Override
  public void onNeighborBlockChange(World w, int x, int y, int z, Block pointlessNumber)
  {
    TileQuantumBridge bridge = getTileEntity( w, x, y, z );
    if ( bridge != null )
      bridge.neighborUpdate();
  }
View Full Code Here

  }

  @Override
  public void breakBlock(World w, int x, int y, int z, Block a, int b)
  {
    TileQuantumBridge bridge = getTileEntity( w, x, y, z );
    if ( bridge != null )
      bridge.breakCluster();

    super.breakBlock( w, x, y, z, a, b );
  }
View Full Code Here

  public boolean onActivated(World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ)
  {
    if ( p.isSneaking() )
      return false;

    TileQuantumBridge tg = getTileEntity( w, x, y, z );
    if ( tg != null )
    {
      if ( Platform.isServer() )
        Platform.openGUI( p, tg, ForgeDirection.getOrientation( side ), GuiBridge.GUI_QNB );
      return true;
View Full Code Here

  }

  @Override
  public void onNeighborBlockChange(World w, int x, int y, int z, Block pointlessNumber)
  {
    TileQuantumBridge bridge = getTileEntity( w, x, y, z );
    if ( bridge != null )
      bridge.neighborUpdate();
  }
View Full Code Here

  }

  @Override
  public void breakBlock(World w, int x, int y, int z, Block a, int b)
  {
    TileQuantumBridge bridge = getTileEntity( w, x, y, z );
    if ( bridge != null )
      bridge.breakCluster();

    super.breakBlock( w, x, y, z, a, b );
  }
View Full Code Here

  @Override
  public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool(World w, int x, int y, int z, Entity e, boolean isVisual)
  {
    double OnePx = 2.0 / 16.0;
    TileQuantumBridge bridge = getTileEntity( w, x, y, z );
    if ( bridge != null && bridge.isCorner() )
    {
      OnePx = 4.0 / 16.0;
    }
    else if ( bridge != null && bridge.isFormed() )
    {
      OnePx = 1.0 / 16.0;
    }
    return Arrays.asList( AxisAlignedBB.getBoundingBox( OnePx, OnePx, OnePx, 1.0 - OnePx, 1.0 - OnePx, 1.0 - OnePx ) );
  }
View Full Code Here

  @Override
  public void addCollidingBlockToList(World w, int x, int y, int z, AxisAlignedBB bb, List out, Entity e)
  {
    double OnePx = 2.0 / 16.0;
    TileQuantumBridge bridge = getTileEntity( w, x, y, z );
    if ( bridge != null && bridge.isCorner() )
    {
      OnePx = 4.0 / 16.0;
    }
    else if ( bridge != null && bridge.isFormed() )
    {
      OnePx = 1.0 / 16.0;
    }
    out.add( AxisAlignedBB.getBoundingBox( OnePx, OnePx, OnePx, 1.0 - OnePx, 1.0 - OnePx, 1.0 - OnePx ) );
  }
View Full Code Here

    {
      for (int y = min.y; y <= max.y; y++)
      {
        for (int z = min.z; z <= max.z; z++)
        {
          TileQuantumBridge te = (TileQuantumBridge) w.getTileEntity( x, y, z );

          byte flags = 0;

          num++;
          if ( num == 5 )
          {
            flags = num;
            c.setCenter( te );
          }
          else
          {
            if ( num == 1 || num == 3 || num == 7 || num == 9 )
              flags = (byte) (tqb.corner | num);
            else
              flags = num;
            c.Ring[ringNum++] = te;
          }

          te.updateStatus( c, flags, true );
        }
      }
    }

  }
View Full Code Here

TOP

Related Classes of appeng.tile.qnb.TileQuantumBridge

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.