Package appeng.api.parts

Examples of appeng.api.parts.IFacadePart


  }

  @Override
  public boolean canAddPart(ItemStack is, ForgeDirection side)
  {
    IFacadePart fp = PartPlacement.isFacade( is, side );
    if ( fp != null )
    {
      if ( !(side == null || side == ForgeDirection.UNKNOWN || tile() == null) )
      {
        List<AxisAlignedBB> boxes = new ArrayList<AxisAlignedBB>();
        IPartCollisionHelper bch = new BusCollisionHelper( boxes, side, null, true );
        fp.getBoxes( bch, null );
        for (AxisAlignedBB bb : boxes)
        {
          disableFacadeOcclusion.set( true );
          boolean canAdd = tile().canAddPart( new NormallyOccludedPart( new Cuboid6( bb ) ) );
          disableFacadeOcclusion.remove();
View Full Code Here


  }

  private EnumSet<ForgeDirection> calculateFaceOpenFaces(IBlockAccess blockAccess, IFacadeContainer fc, int x, int y, int z, ForgeDirection side)
  {
    EnumSet<ForgeDirection> out = EnumSet.of( side, side.getOpposite() );
    IFacadePart facade = fc.getFacade( side );

    for (ForgeDirection it : ForgeDirection.VALID_DIRECTIONS)
    {
      if ( !out.contains( it ) && alphaDiff( blockAccess.getTileEntity( x + it.offsetX, y + it.offsetY, z + it.offsetZ ), side, facade ) )
      {
        out.add( it );
      }
    }

    if ( out.contains( ForgeDirection.UP ) && (side.offsetX != 0 || side.offsetZ != 0) )
    {
      IFacadePart fp = fc.getFacade( ForgeDirection.UP );
      if ( fp != null && (fp.isTransparent() == facade.isTransparent()) )
        out.remove( ForgeDirection.UP );
    }

    if ( out.contains( ForgeDirection.DOWN ) && (side.offsetX != 0 || side.offsetZ != 0) )
    {
      IFacadePart fp = fc.getFacade( ForgeDirection.DOWN );
      if ( fp != null && (fp.isTransparent() == facade.isTransparent()) )
        out.remove( ForgeDirection.DOWN );
    }

    if ( out.contains( ForgeDirection.SOUTH ) && (side.offsetX != 0) )
    {
      IFacadePart fp = fc.getFacade( ForgeDirection.SOUTH );
      if ( fp != null && (fp.isTransparent() == facade.isTransparent()) )
        out.remove( ForgeDirection.SOUTH );
    }

    if ( out.contains( ForgeDirection.NORTH ) && (side.offsetX != 0) )
    {
      IFacadePart fp = fc.getFacade( ForgeDirection.NORTH );
      if ( fp != null && (fp.isTransparent() == facade.isTransparent()) )
        out.remove( ForgeDirection.NORTH );
    }

    /*
     * if ( out.contains( ForgeDirection.EAST ) && (side.offsetZ != 0) ) { IFacadePart fp = fc.getFacade(
View Full Code Here

  private boolean alphaDiff(TileEntity tileEntity, ForgeDirection side, IFacadePart facade)
  {
    if ( tileEntity instanceof IPartHost )
    {
      IPartHost ph = (IPartHost) tileEntity;
      IFacadePart fp = ph.getFacadeContainer().getFacade( side );

      return fp == null || (fp.isTransparent() != facade.isTransparent());
    }

    return true;
  }
View Full Code Here

    }
    out.writeByte( (byte) facadeSides );

    for (int x = 0; x < facades; x++)
    {
      IFacadePart part = getFacade( ForgeDirection.getOrientation( x ) );
      if ( part != null )
      {
        int itemID = Item.getIdFromItem( part.getItem() );
        int dmgValue = part.getItemDamage();
        out.writeInt( itemID * (part.isBC() ? -1 : 1) );
        out.writeInt( dmgValue );
      }
    }
  }
View Full Code Here

  }

  @Override
  public void rotateLeft()
  {
    IFacadePart newFacades[] = new FacadePart[6];

    newFacades[ForgeDirection.UP.ordinal()] = storage.getFacade( ForgeDirection.UP.ordinal() );
    newFacades[ForgeDirection.DOWN.ordinal()] = storage.getFacade( ForgeDirection.DOWN.ordinal() );

    newFacades[ForgeDirection.EAST.ordinal()] = storage.getFacade( ForgeDirection.NORTH.ordinal() );
View Full Code Here

    if ( tile instanceof IPartHost )
      host = (IPartHost) tile;

    if ( held != null )
    {
      IFacadePart fp = isFacade( held, side );
      if ( fp != null )
      {
        if ( host != null )
        {
          if ( !world.isRemote )
View Full Code Here

          useThinFacades = true;
      }

      for (ForgeDirection s : ForgeDirection.VALID_DIRECTIONS)
      {
        IFacadePart fPart = iFacadeContainer.getFacade( s );
        if ( fPart != null )
        {
          AxisAlignedBB b = null;
          fPart.setThinFacades( useThinFacades );
          AxisAlignedBB pb = fPart.getPrimaryBox();
          for (AxisAlignedBB bb : boxes)
          {
            if ( bb.intersectsWith( pb ) )
            {
              if ( b == null )
                b = bb;
              else
              {
                b.maxX = Math.max( b.maxX, bb.maxX );
                b.maxY = Math.max( b.maxY, bb.maxY );
                b.maxZ = Math.max( b.maxZ, bb.maxZ );
                b.minX = Math.min( b.minX, bb.minX );
                b.minY = Math.min( b.minY, bb.minY );
                b.minZ = Math.min( b.minZ, bb.minZ );
              }
            }
          }

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

          setSide( s );
          fPart.renderStatic( te.xCoord, te.yCoord, te.zCoord, BusRenderHelper.instance, renderer, iFacadeContainer, b,
              cableBusContainer.getPart( s ) == null );
        }
      }

      renderer.isFacade = false;
View Full Code Here

    renderer.overrideBlockTexture = null;

    if ( item.getItem() instanceof IFacadeItem )
    {
      IFacadeItem fi = (IFacadeItem) item.getItem();
      IFacadePart fp = fi.createPartFromItemStack( item, ForgeDirection.SOUTH );

      if ( type == ItemRenderType.EQUIPPED_FIRST_PERSON )
      {
        GL11.glRotatef( 160.0f, 0.0f, 1.0f, 0.0f );
        GL11.glTranslated( -0.4, 0.1, -1.6 );
      }

      if ( fp != null )
        fp.renderInventory( BusRenderHelper.instance, renderer );
    }
    else
    {
      IPart ip = getRenderer( item, (IPartItem) item.getItem() );
      if ( ip != null )
View Full Code Here

      if ( AEApi.instance().partHelper().getCableRenderMode().opaqueFacades || !visual )
      {
        if ( includeFacades && s != null && s != ForgeDirection.UNKNOWN )
        {
          IFacadePart fp = fc.getFacade( s );
          if ( fp != null )
            fp.getBoxes( bch, e );
        }
      }
    }

    return boxes;
View Full Code Here

      if ( part != null )
        return false;

      if ( s != ForgeDirection.UNKNOWN )
      {
        IFacadePart fp = fc.getFacade( s );
        if ( fp != null )
          return false;
      }
    }
    return true;
View Full Code Here

TOP

Related Classes of appeng.api.parts.IFacadePart

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.