Package appeng.api.parts

Examples of appeng.api.parts.IPart


  private boolean isTransitionPlane(TileEntity blockTileEntity, ForgeDirection side)
  {
    if ( blockTileEntity instanceof IPartHost )
    {
      IPart p = ((IPartHost) blockTileEntity).getPart( side );
      return p instanceof PartAnnihilationPlane;
    }
    return false;
  }
View Full Code Here


    if ( renderer.blockAccess == null )
      renderer.blockAccess = Minecraft.getMinecraft().theWorld;

    for (ForgeDirection s : ForgeDirection.values())
    {
      IPart part = cableBusContainer.getPart( s );
      if ( part != null )
      {
        setSide( s );
        renderer.renderAllFaces = true;

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

        part.renderStatic( te.xCoord, te.yCoord, te.zCoord, BusRenderHelper.instance, renderer );

        renderer.faces = EnumSet.allOf( ForgeDirection.class );
        renderer.calculations = true;
        renderer.useTextures = true;
      }
    }

    if ( !iFacadeContainer.isEmpty() )
    {
      /**
       * snag list of boxes...
       */
      List<AxisAlignedBB> boxes = new ArrayList<AxisAlignedBB>();
      for (ForgeDirection s : ForgeDirection.values())
      {
        IPart part = cableBusContainer.getPart( s );
        if ( part != null )
        {
          setSide( s );
          BusRenderHelper brh = BusRenderHelper.instance;
          BusCollisionHelper bch = new BusCollisionHelper( boxes, brh.getWorldX(), brh.getWorldY(), brh.getWorldZ(), null, true );
          part.getBoxes( bch );
        }
      }

      boolean useThinFacades = false;
      double min = 2.0 / 16.0;
View Full Code Here

  public void renderDynamic(CableBusContainer cableBusContainer, double x, double y, double z)
  {
    for (ForgeDirection s : ForgeDirection.values())
    {
      IPart part = cableBusContainer.getPart( s );
      if ( part != null )
      {
        ForgeDirection ax, ay, az;

        switch (s)
        {
        case DOWN:
          ax = ForgeDirection.EAST;
          ay = ForgeDirection.NORTH;
          az = ForgeDirection.DOWN;
          break;
        case UP:
          ax = ForgeDirection.EAST;
          ay = ForgeDirection.SOUTH;
          az = ForgeDirection.UP;
          break;
        case EAST:
          ax = ForgeDirection.SOUTH;
          ay = ForgeDirection.UP;
          az = ForgeDirection.EAST;
          break;
        case WEST:
          ax = ForgeDirection.NORTH;
          ay = ForgeDirection.UP;
          az = ForgeDirection.WEST;
          break;
        case NORTH:
          ax = ForgeDirection.WEST;
          ay = ForgeDirection.UP;
          az = ForgeDirection.NORTH;
          break;
        case SOUTH:
          ax = ForgeDirection.EAST;
          ay = ForgeDirection.UP;
          az = ForgeDirection.SOUTH;
          break;
        case UNKNOWN:
        default:
          ax = ForgeDirection.EAST;
          ay = ForgeDirection.UP;
          az = ForgeDirection.SOUTH;
          break;
        }

        BusRenderHelper.instance.setOrientation( ax, ay, az );
        part.renderDynamic( x, y, z, BusRenderHelper.instance, BusRenderer.instance.renderer );
      }
    }
  }
View Full Code Here

{

  @Override
  public IBatteryObject getMjBattery(String kind, ForgeDirection direction)
  {
    IPart p = getPart( direction );

    if ( p instanceof ISidedBatteryProvider )
      return ((ISidedBatteryProvider) p).getMjBattery( kind, direction );

    return null;
View Full Code Here

{

  @Override
  public int receiveEnergy(ForgeDirection from, int maxReceive, boolean simulate)
  {
    IPart part = getPart( from );
    if ( part instanceof IEnergyHandler )
      return ((IEnergyHandler) part).receiveEnergy( from, maxReceive, simulate );

    return 0;
  }
View Full Code Here

  }

  @Override
  public int extractEnergy(ForgeDirection from, int maxExtract, boolean simulate)
  {
    IPart part = getPart( from );
    if ( part instanceof IEnergyHandler )
      return ((IEnergyHandler) part).extractEnergy( from, maxExtract, simulate );

    return 0;
  }
View Full Code Here

  }

  @Override
  public int getEnergyStored(ForgeDirection from)
  {
    IPart part = getPart( from );
    if ( part instanceof IEnergyHandler )
      return ((IEnergyHandler) part).getEnergyStored( from );

    return 0;
  }
View Full Code Here

  }

  @Override
  public int getMaxEnergyStored(ForgeDirection from)
  {
    IPart part = getPart( from );
    if ( part instanceof IEnergyHandler )
      return ((IEnergyHandler) part).getMaxEnergyStored( from );

    return 0;
  }
View Full Code Here

  }

  @Override
  public boolean canConnectEnergy(ForgeDirection from)
  {
    IPart part = getPart( from );
    if ( part instanceof IEnergyHandler )
      return ((IEnergyHandler) part).canConnectEnergy( from );

    return false;
  }
View Full Code Here

{

  @Override
  public PowerReceiver getPowerReceiver(ForgeDirection side)
  {
    IPart part = getPart( side );
    if ( part instanceof IPowerReceptor )
      return ((IPowerReceptor) part).getPowerReceiver( side );
    return null;
  }
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.