Package erogenousbeef.bigreactors.common.multiblock.tileentity

Examples of erogenousbeef.bigreactors.common.multiblock.tileentity.TileEntityTurbinePartBase


    public IIcon getIcon(IBlockAccess blockAccess, int x, int y, int z, int side) {
    TileEntity te = blockAccess.getTileEntity(x, y, z);
    int metadata = blockAccess.getBlockMetadata(x,y,z);

    if(te instanceof TileEntityTurbinePartBase) {
      TileEntityTurbinePartBase part = (TileEntityTurbinePartBase)te;
      MultiblockTurbine turbine = part.getTurbine();
     
      if(metadata == METADATA_FLUIDPORT) {
        if(te instanceof TileEntityTurbineFluidPort) {
          if(turbine == null || !turbine.isAssembled() || part.getOutwardsDir().ordinal() == side)
          {
            if(((TileEntityTurbineFluidPort)te).getFlowDirection() == FluidFlow.Out)
              return _subIcons[SUBICON_FLUIDPORT_OUTPUT];
            else
              return _icons[METADATA_FLUIDPORT];
          }
          else if(turbine.isAssembled() && part.getOutwardsDir().ordinal() != side)
            return _subIcons[SUBICON_HOUSING_FACE];
        }
        return getIcon(side, metadata);
      }
      else if(!part.isConnected() || turbine == null || !turbine.isAssembled()) {
        return getIcon(side, metadata);
      }
      else {
        int subIcon = SUBICON_NONE;
        if(metadata == METADATA_HOUSING) {
          subIcon = getSubIconForHousing(blockAccess, x, y, z, turbine, side);
        }
        else if(part.getOutwardsDir().ordinal() == side) {
          // Only put the fancy icon on one side of the machine. Other parts will use the base.
          if(metadata == METADATA_CONTROLLER) {
            if(turbine.getActive()) {
              subIcon = SUBICON_CONTROLLER_ACTIVE;
            }
View Full Code Here


    super.isMachineWhole();
   
    // Now do additional validation based on the coils/blades/rotors that were found
   
    // Check that we have a rotor that goes all the way up the bearing
    TileEntityTurbinePartBase rotorPart = attachedRotorBearings.iterator().next();
   
    // Rotor bearing must calculate outwards dir, as this is normally only calculated in onMachineAssembled().
    rotorPart.recalculateOutwardsDirection(getMinimumCoord(), getMaximumCoord());
   
    // Find out which way the rotor runs. Obv, this is inwards from the bearing.
    ForgeDirection rotorDir = rotorPart.getOutwardsDir().getOpposite();
    CoordTriplet rotorCoord = rotorPart.getWorldLocation();
   
    CoordTriplet minRotorCoord = getMinimumCoord();
    CoordTriplet maxRotorCoord = getMaximumCoord();
   
    // Constrain min/max rotor coords to where the rotor bearing is and the block opposite it
View Full Code Here

TOP

Related Classes of erogenousbeef.bigreactors.common.multiblock.tileentity.TileEntityTurbinePartBase

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.