Package erogenousbeef.bigreactors.common.multiblock

Examples of erogenousbeef.bigreactors.common.multiblock.MultiblockReactor


  private IIcon getControllerIcon(IBlockAccess blockAccess, int x, int y,
      int z, int side) {
    TileEntity te = blockAccess.getTileEntity(x, y, z);
    if(te instanceof TileEntityReactorPart) {
      TileEntityReactorPart controller = (TileEntityReactorPart)te;
      MultiblockReactor reactor = controller.getReactorController();
     
      if(reactor == null || !reactor.isAssembled()) {
        return _icons[METADATA_CONTROLLER][CONTROLLER_OFF];
      }
      else if(!isOutwardsSide(controller, side)) {
        return blockIcon;
      }
      else if(reactor.getActive()) {
        return _icons[METADATA_CONTROLLER][CONTROLLER_ACTIVE];
      }
      else {
        return _icons[METADATA_CONTROLLER][CONTROLLER_IDLE];
      }
View Full Code Here


  private IIcon getCasingIcon(IBlockAccess blockAccess, int x, int y, int z, int side) {
    TileEntity te = blockAccess.getTileEntity(x, y, z);
    if(te instanceof TileEntityReactorPart) {
      TileEntityReactorPart part = (TileEntityReactorPart)te;
      PartPosition position = part.getPartPosition();
      MultiblockReactor reactor = part.getReactorController();
      if(reactor == null || !reactor.isAssembled()) {
        return _icons[METADATA_CASING][DEFAULT];
      }
     
      switch(position) {
      case BottomFace:
View Full Code Here

    ForgeDirection outDir = part.getOutwardsDir();
    return outDir.ordinal() == side;
  }
 
  private boolean isReactorAssembled(TileEntityReactorPart part) {
    MultiblockReactor reactor = part.getReactorController();
    return reactor != null && reactor.isAssembled();
  }
View Full Code Here

    case outputFuelTemperature:
      return (int)Math.floor(getReactorController().getFuelHeat());
    case outputCasingTemperature:
      return (int)Math.floor(getReactorController().getReactorHeat());
    case outputFuelMix:
      MultiblockReactor controller = getReactorController();
      return (int)Math.floor(((float)controller.getFuelAmount() / (float)controller.getCapacity())*100.0f);
    case outputFuelAmount:
      return getReactorController().getFuelAmount();
    case outputWasteAmount:
      return getReactorController().getWasteAmount();
    case outputEnergyAmount:
      int energyStored, energyTotal;
      MultiblockReactor reactor = this.getReactorController();
      if(reactor != null) {
        return reactor.getEnergyStoredPercentage();
      }
      return 0;
    default:
      return 0;
    }
View Full Code Here

    if(!this.isConnected()) { return; }
   
    if(newValue == oldValue[channel]) { return; }
    boolean isPulse = (oldValue[channel] == 0 && newValue != 0);
   
    MultiblockReactor reactor = null;
    switch(type) {
    case inputActive:
      reactor = getReactorController();
      if(inputActivatesOnPulse[channel]) {
        if(isPulse) {
          reactor.setActive(!reactor.getActive());
        }
      }
      else {
        boolean newActive = newValue != 0;
        if(newActive != reactor.getActive()) {
          reactor.setActive(newActive);
        }
      }
      break;
    case inputSetControlRod:
      // This doesn't make sense for pulsing
      newValue = Math.min(100, Math.max(0, newValue)); // Clamp to 0..100
      if(newValue == oldValue[channel]) { return; }

      if(coordMappings[channel] != null) {
        setControlRodInsertion(channel, coordMappings[channel], newValue);
      }
      else {
        reactor = getReactorController();
        reactor.setAllControlRodInsertionValues(newValue);
      }
      break;
    case inputEjectWaste:
      // This only makes sense for pulsing
      if(isPulse) {
        reactor = getReactorController();
        reactor.ejectWaste(false, null);
      }
    default:
      break;
    }
   
View Full Code Here

    protected abstract IMessage handleMessage(M message, MessageContext ctx, MultiblockReactor reactor);

    @Override
    protected IMessage handleMessage(M message, MessageContext ctx, TileEntity te) {
      if(te instanceof TileEntityReactorPartBase) {
        MultiblockReactor reactor = ((TileEntityReactorPartBase)te).getReactorController();
        if(reactor != null) {
          return handleMessage(message, ctx, reactor);
        }
        else {
          BRLog.error("Received ReactorMessageServer for a reactor part @ %d, %d, %d which has no attached reactor", te.xCoord, te.yCoord, te.zCoord);
View Full Code Here

        TileEntity te;
        te = world.getTileEntity(x, y, z);
        if(te instanceof TileEntityReactorFuelRod) {
          TileEntityReactorFuelRod fuelRod = (TileEntityReactorFuelRod)te;
          if(fuelRod.isConnected()) {
            MultiblockReactor reactor = (MultiblockReactor)fuelRod.getMultiblockController();
            int fuelAmount = reactor.getFuelAmount();
            int wasteAmount = reactor.getWasteAmount();
            int totalFluid = fuelAmount + wasteAmount;
            int capacity = reactor.getCapacity();
            if(capacity > 0 && totalFluid > 0) {
              // Okay, we're connected and have some kind of fluid inside. Let's do this.
                  float fluidColumnOffsetFromCenter = -1f;
                  float red, green, blue;
                  IIcon iconSide, iconBottom;
                  iconSide = iconBottom = null;
                  red = green = blue = 1f;

              iconSide = BigReactors.fluidFuelColumn.getFlowingIcon();
              iconBottom = BigReactors.fluidFuelColumn.getStillIcon();

              ReactantData fuelData = Reactants.getReactant(reactor.getFuelType());
              ReactantData wasteData = Reactants.getReactant(reactor.getWasteType());
                 
              int fuelColor = fuelData != null ? fuelData.getColor() : StandardReactants.colorYellorium;
              int wasteColor = wasteData != null ? wasteData.getColor() : StandardReactants.colorCyanite;
             
                if(fuelAmount == 0) {
View Full Code Here

  @Override
  public boolean canUpdate() { return false; }

  @Override
  public MultiblockControllerBase createNewMultiblock() {
    return new MultiblockReactor(this.worldObj);
  }
View Full Code Here

    }
  }
 
  @Override
  public String getDebugInfo() {
    MultiblockReactor r = getReactorController();
    StringBuilder sb = new StringBuilder();
    sb.append(getClass().toString()).append("\n");
    if(r == null) {
      sb.append("Not attached to controller!");
      return sb.toString();
    }
    sb.append(r.getDebugInfo());
    return sb.toString();
  }
View Full Code Here

  @Override
  public void moderateRadiation(RadiationData data, RadiationPacket radiation) {
    if(!isConnected()) { return; }

    // Grab control rod insertion and reactor heat
    MultiblockReactor reactor = getReactorController();
    float heat = reactor.getFuelHeat();
   
    int maxY = reactor.getMaximumCoord().y;
    TileEntity te = worldObj.getTileEntity(xCoord, maxY, zCoord);
    if(!(te instanceof TileEntityReactorControlRod)) {
      return;
    }
View Full Code Here

TOP

Related Classes of erogenousbeef.bigreactors.common.multiblock.MultiblockReactor

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.