Package erogenousbeef.core.common

Examples of erogenousbeef.core.common.CoordTriplet


    // Not a "proper" TE, so just pass through
    return getIcon(side, metadata);
  }
 
  private int getSubIconForHousing(IBlockAccess blockAccess, int x, int y, int z, MultiblockTurbine turbine, int side) {
    CoordTriplet minCoord, maxCoord;
    minCoord = turbine.getMinimumCoord();
    maxCoord = turbine.getMaximumCoord();
   
    if(minCoord == null || maxCoord == null) {
      return SUBICON_NONE;
View Full Code Here


          MultiblockTurbine turbine = bearing.getTurbine();
          if(turbine != null && turbine.getActive()) {
            // Spawn particles!
            int numParticles = Math.min(20, Math.max(1, turbine.getFluidConsumedLastTick() / 40));
            ForgeDirection inwardsDir = bearing.getOutwardsDir().getOpposite();
            CoordTriplet minCoord, maxCoord;
            minCoord = turbine.getMinimumCoord();
            maxCoord = turbine.getMaximumCoord();
            minCoord.x++; minCoord.y++; minCoord.z++;
            maxCoord.x--; maxCoord.y--; maxCoord.z--;
            if(inwardsDir.offsetX != 0) {
View Full Code Here

    this.active = false;
  }

  private void recalculateDerivedValues() {
    // Recalculate size of fuel/waste tank via fuel rods
    CoordTriplet minCoord, maxCoord;
    minCoord = getMinimumCoord();
    maxCoord = getMaximumCoord();
   
    fuelContainer.setCapacity(attachedFuelRods.size() * FuelCapacityPerFuelRod);

 
View Full Code Here

  protected int getReactorVolume() {
    return reactorVolume;
  }
 
  protected void calculateReactorVolume() {
    CoordTriplet minInteriorCoord = getMinimumCoord();
    minInteriorCoord.x += 1;
    minInteriorCoord.y += 1;
    minInteriorCoord.z += 1;
   
    CoordTriplet maxInteriorCoord = getMaximumCoord();
    maxInteriorCoord.x -= 1;
    maxInteriorCoord.y -= 1;
    maxInteriorCoord.z -= 1;
   
    reactorVolume = StaticUtils.ExtraMath.Volume(minInteriorCoord, maxInteriorCoord);
View Full Code Here

   
    return coolantContainer.getTankInfo(-1);
  }
 
  protected void markReferenceCoordForUpdate() {
    CoordTriplet rc = getReferenceCoord();
    if(worldObj != null && rc != null) {
      worldObj.markBlockForUpdate(rc.x, rc.y, rc.z);
    }
  }
View Full Code Here

  }
 
  protected void markReferenceCoordDirty() {
    if(worldObj == null || worldObj.isRemote) { return; }

    CoordTriplet referenceCoord = getReferenceCoord();
    if(referenceCoord == null) { return; }

    TileEntity saveTe = worldObj.getTileEntity(referenceCoord.x, referenceCoord.y, referenceCoord.z);
    worldObj.markTileEntityChunkModified(referenceCoord.x, referenceCoord.y, referenceCoord.z, saveTe);
  }
View Full Code Here

  public AxisAlignedBB getAABB() { return boundingBox; }
 
  private void calculateRotorInfo() {
    // Calculate bounding box
    MultiblockTurbine turbine = getTurbine();
    CoordTriplet minCoord = turbine.getMinimumCoord();
    CoordTriplet maxCoord = turbine.getMaximumCoord();

    boundingBox = AxisAlignedBB.getBoundingBox(minCoord.x, minCoord.y, minCoord.z, maxCoord.x, maxCoord.y, maxCoord.z);
   
    if(worldObj.isRemote) {
      // Calculate rotor info
      rotorInfo = new RotorInfo();
      rotorInfo.rotorDirection = getOutwardsDir().getOpposite();
      switch(rotorInfo.rotorDirection) {
        case DOWN:
        case UP:
        case UNKNOWN:
          rotorInfo.rotorLength = maxCoord.y - minCoord.y - 1;
          break;
        case EAST:
        case WEST:
          rotorInfo.rotorLength = maxCoord.x - minCoord.x - 1;
          break;
        case NORTH:
        case SOUTH:
          rotorInfo.rotorLength = maxCoord.z - minCoord.z - 1;
          break;
      }
     
      CoordTriplet currentCoord = getWorldLocation();
      CoordTriplet bladeCoord = new CoordTriplet(0,0,0);

      ForgeDirection[] dirsToCheck = StaticUtils.neighborsBySide[rotorInfo.rotorDirection.ordinal()];
      rotorInfo.bladeLengths = new int[rotorInfo.rotorLength][4];

      int rotorPosition = 0;
      currentCoord.translate(rotorInfo.rotorDirection);

      while(rotorPosition < rotorInfo.rotorLength) {
        // Current block is a rotor
        // Get list of normals
        int bladeLength;
        ForgeDirection bladeDir;
        for(int bladeIdx = 0; bladeIdx < dirsToCheck.length; bladeIdx++) {
          bladeDir = dirsToCheck[bladeIdx];
          bladeCoord.copy(currentCoord);
          bladeCoord.translate(bladeDir);
          bladeLength = 0;
          while(worldObj.getBlock(bladeCoord.x, bladeCoord.y, bladeCoord.z) == BigReactors.blockTurbineRotorPart && bladeLength < 32) {
            bladeLength++;
            bladeCoord.translate(bladeDir);
          }
         
          rotorInfo.bladeLengths[rotorPosition][bladeIdx] = bladeLength;
        }
       
View Full Code Here

    if(CircuitType.canBeToggledBetweenPulseAndNormal(type)) {
      pulseOrToggle = buf.readBoolean();
    }
   
    CoordTriplet coord = null;
    if(CircuitType.hasCoordinate(type)) {
      boolean coordNull = buf.readBoolean();
      if(!coordNull) {
        coord = new CoordTriplet(buf.readInt(), buf.readInt(), buf.readInt());
      }
    }
   
    return new RedNetChange(channelID, type, pulseOrToggle, coord);
  }
View Full Code Here

  protected TileEntity getMappedTileEntity(int channel) {
    if(channel < 0 || channel >= numChannels) { return null; }
    if(coordMappings[channel] == null) { return null; }
   
    CoordTriplet coord = coordMappings[channel];
   
    if(coord == null) { return null; }
    if(!this.worldObj.checkChunksExist(coord.x, coord.y, coord.z, coord.x, coord.y, coord.z)) {
      return null;
    }
View Full Code Here

    entry.setInteger("setting", this.channelCircuitTypes[channel].ordinal());
    if(isInput(this.channelCircuitTypes[channel]) && CircuitType.canBeToggledBetweenPulseAndNormal(this.channelCircuitTypes[channel])) {
      entry.setBoolean("pulse", this.inputActivatesOnPulse[channel]);
    }
    if( CircuitType.hasCoordinate(this.channelCircuitTypes[channel]) ) {
      CoordTriplet coord = this.coordMappings[channel];
      if(coord != null) {
        entry.setInteger("x", coord.x);
        entry.setInteger("y", coord.y);
        entry.setInteger("z", coord.z);
      }
View Full Code Here

TOP

Related Classes of erogenousbeef.core.common.CoordTriplet

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.