Package appeng.api.parts

Examples of appeng.api.parts.IPart


  {
    int light = 0;

    for (ForgeDirection d : ForgeDirection.values())
    {
      IPart p = getPart( d );
      if ( p != null )
        light = Math.max( p.getLightLevel(), light );
    }

    if ( light > 0 && AppEng.instance.isIntegrationEnabled( IntegrationType.CLApi ) )
      return ((ICLApi) AppEng.instance.getIntegration( IntegrationType.CLApi )).colorLight( getColor(), light );
View Full Code Here


  }

  @Override
  public boolean recolourBlock(ForgeDirection side, AEColor colour, EntityPlayer who)
  {
    IPart cable = getPart( ForgeDirection.UNKNOWN );
    if ( cable != null )
    {
      IPartCable pc = (IPartCable) cable;
      return pc.changeColor( colour, who );
    }
View Full Code Here

  @Override
  public SelectedPart selectPart(Vec3 pos)
  {
    for (ForgeDirection side : ForgeDirection.values())
    {
      IPart p = getPart( side );
      if ( p != null )
      {
        List<AxisAlignedBB> boxes = new LinkedList<AxisAlignedBB>();

        IPartCollisionHelper bch = new BusCollisionHelper( boxes, side, null, true );
        p.getBoxes( bch );
        for (AxisAlignedBB bb : boxes)
        {
          bb = bb.expand( 0.002, 0.002, 0.002 );
          if ( bb.isVecInside( pos ) )
          {
            return new SelectedPart( p, side );
          }
        }
      }
    }

    if ( AEApi.instance().partHelper().getCableRenderMode().opaqueFacades )
    {
      IFacadeContainer fc = getFacadeContainer();
      for (ForgeDirection side : ForgeDirection.VALID_DIRECTIONS)
      {
        IFacadePart p = fc.getFacade( side );
        if ( p != null )
        {
          List<AxisAlignedBB> boxes = new LinkedList<AxisAlignedBB>();

          IPartCollisionHelper bch = new BusCollisionHelper( boxes, side, null, true );
          p.getBoxes( bch, null );
          for (AxisAlignedBB bb : boxes)
          {
            bb = bb.expand( 0.01, 0.01, 0.01 );
            if ( bb.isVecInside( pos ) )
            {
View Full Code Here

  @Override
  public void randomDisplayTick(World world, int x, int y, int z, Random r)
  {
    for (ForgeDirection side : ForgeDirection.values())
    {
      IPart p = getPart( side );
      if ( p != null )
      {
        p.randomDisplayTick( world, x, y, z, r );
      }
    }
  }
View Full Code Here

  @Override
  public boolean isLadder(EntityLivingBase entity)
  {
    for (ForgeDirection side : ForgeDirection.values())
    {
      IPart p = getPart( side );
      if ( p != null )
      {
        if ( p.isLadder( entity ) )
          return true;
      }
    }

    return false;
View Full Code Here

  @Override
  public void securityBreak()
  {
    for (ForgeDirection d : ForgeDirection.values())
    {
      IPart p = getPart( d );
      if ( p != null && p instanceof IGridHost )
        ((IGridHost) p).securityBreak();
    }
  }
View Full Code Here

    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 )
            continue;

          switch (dir)
View Full Code Here

    boolean useCovered = false;
    boolean requireDetailed = false;

    for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS)
    {
      IPart p = getHost().getPart( dir );
      if ( p != null && p instanceof IGridHost )
      {
        IGridHost igh = (IGridHost) p;
        AECableType type = igh.getCableConnectionType( dir.getOpposite() );
        if ( type == AECableType.COVERED || type == AECableType.SMART )
        {
          useCovered = true;
          break;
        }
      }
      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 )
        {
          switch (of)
          {
          case DOWN:
View Full Code Here

    inventories = new ArrayList<ISidedInventory>();
    int slotCount = 0;

    for (ForgeDirection side : ForgeDirection.VALID_DIRECTIONS)
    {
      IPart bp = getPart( side );
      if ( bp instanceof ISidedInventory )
      {
        ISidedInventory part = (ISidedInventory) bp;
        slotCount += part.getSizeInventory();
        inventories.add( part );
View Full Code Here

{

  @Override
  public boolean canEmitPowerFrom(ForgeDirection side)
  {
    IPart part = getPart( side );
    if ( part instanceof IPowerEmitter )
      return ((IPowerEmitter) part).canEmitPowerFrom( side );
    return false;
  }
View Full Code Here

TOP

Related Classes of appeng.api.parts.IPart

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.