Examples of Fluid


Examples of net.minecraftforge.fluids.Fluid

    multiblockEventHandler = new MultiblockEventHandler();
    MinecraftForge.EVENT_BUS.register(multiblockEventHandler);
   
    proxy.preInit();
   
    Fluid waterFluid = FluidRegistry.WATER; // Force-load water to prevent startup crashes
  }
View Full Code Here

Examples of net.minecraftforge.fluids.Fluid

    if(BigReactors.fluidYelloriumStill == null) {
      BRConfig.CONFIGURATION.load();
     
      BigReactors.fluidYellorium = FluidRegistry.getFluid("yellorium");
      if(fluidYellorium == null) {
        fluidYellorium = new Fluid("yellorium");
        fluidYellorium.setDensity(100);
        fluidYellorium.setGaseous(false);
        fluidYellorium.setLuminosity(10);
        fluidYellorium.setRarity(EnumRarity.uncommon);
        fluidYellorium.setTemperature(295);
        fluidYellorium.setViscosity(100);
        fluidYellorium.setUnlocalizedName("bigreactors.yellorium.still");
        FluidRegistry.registerFluid(fluidYellorium);
      }

      BlockBRGenericFluid liqY = new BlockBRGenericFluid(BigReactors.fluidYellorium, "yellorium");
      BigReactors.fluidYelloriumStill = liqY;
     
      GameRegistry.registerBlock(BigReactors.fluidYelloriumStill, ItemBlock.class, BigReactors.fluidYelloriumStill.getUnlocalizedName());

      fluidYelloriumBucketItem = (new ItemBRBucket(liqY)).setUnlocalizedName("bucket.yellorium").setMaxStackSize(1).setContainerItem(Items.bucket);
            GameRegistry.registerItem(fluidYelloriumBucketItem, "bucketYellorium");
     
      BRConfig.CONFIGURATION.save();
    }
   
    if(BigReactors.fluidCyaniteStill == null) {
      BRConfig.CONFIGURATION.load();
     
      BigReactors.fluidCyanite = FluidRegistry.getFluid("cyanite");
      if(fluidCyanite == null) {
        fluidCyanite = new Fluid("cyanite");
        fluidCyanite.setDensity(100);
        fluidCyanite.setGaseous(false);
        fluidCyanite.setLuminosity(6);
        fluidCyanite.setRarity(EnumRarity.uncommon);
        fluidCyanite.setTemperature(295);
        fluidCyanite.setViscosity(100);
        fluidCyanite.setUnlocalizedName("bigreactors.cyanite.still");
        FluidRegistry.registerFluid(fluidCyanite);
      }

      BlockBRGenericFluid liqDY = new BlockBRGenericFluid(fluidCyanite, "cyanite");
      BigReactors.fluidCyaniteStill = liqDY;
      GameRegistry.registerBlock(BigReactors.fluidCyaniteStill, ItemBlock.class, BigReactors.fluidCyaniteStill.getUnlocalizedName());
     
      fluidCyaniteBucketItem = (new ItemBRBucket(liqDY)).setUnlocalizedName("bucket.cyanite").setMaxStackSize(1).setContainerItem(Items.bucket);
            GameRegistry.registerItem(fluidCyaniteBucketItem, "bucketCyanite");
     
      BRConfig.CONFIGURATION.save();
    }

    if(BigReactors.fluidFuelColumnStill == null) {
      BRConfig.CONFIGURATION.load();
     
      BigReactors.fluidFuelColumn = FluidRegistry.getFluid("fuelColumn");
      if(fluidFuelColumn == null) {
        fluidFuelColumn = new Fluid("fuelColumn");
        fluidFuelColumn.setUnlocalizedName("bigreactors.fuelColumn.still");
        FluidRegistry.registerFluid(fluidFuelColumn);       
      }

      BRConfig.CONFIGURATION.save();
    }
   
    fluidSteam = FluidRegistry.getFluid("steam");
    registeredOwnSteam = false;
    if(fluidSteam == null) {
      // FINE THEN
      BRConfig.CONFIGURATION.load();
     
      fluidSteam = new Fluid("steam");
      fluidSteam.setUnlocalizedName("steam");
      fluidSteam.setTemperature(1000); // For consistency with TE
      fluidSteam.setGaseous(true);
      fluidSteam.setLuminosity(0);
      fluidSteam.setRarity(EnumRarity.common);
View Full Code Here

Examples of net.minecraftforge.fluids.Fluid

    }

    // Permit TE fluids
    if(block != null) {
      if(block instanceof IFluidBlock) {
        Fluid fluid = ((IFluidBlock)block).getFluid();
        String fluidName = fluid.getName();
        if(ReactorInterior.getFluidData(fluidName) != null) { return; }

        throw new MultiblockValidationException(String.format("%d, %d, %d - The fluid %s is not valid for the reactor's interior", x, y, z, fluidName));
      }
      else {
View Full Code Here

Examples of net.minecraftforge.fluids.Fluid

  public void serialize(ByteBuf buf) {
    int fuelTypeID, wasteTypeID, coolantTypeID, vaporTypeID;

    // Marshal fluid types into integers
    {
      Fluid coolantType, vaporType;
      coolantType = coolantContainer.getCoolantType();
      vaporType = coolantContainer.getVaporType();     
      coolantTypeID = coolantType == null ? -1 : coolantType.getID();
      vaporTypeID = vaporType == null ? -1 : vaporType.getID();
    }

    // Basic data
    buf.writeBoolean(active);
View Full Code Here

Examples of net.minecraftforge.fluids.Fluid

  public void merge(CoolantContainer other) {
    super.merge(other);
  }
 
  public float getCoolantTemperature(float reactorTemperature) {
    Fluid coolantType = getCoolantType();
    if(coolantType == null || getFluidAmount(COLD) <= 0) { return reactorTemperature; }

    return Math.min(reactorTemperature, getBoilingPoint(coolantType));
  }
View Full Code Here

Examples of net.minecraftforge.fluids.Fluid

   * @return RF remaining after absorption.
   */
  public float onAbsorbHeat(float rfAbsorbed) {
    if(getFluidAmount(COLD) <= 0 || rfAbsorbed <= 0) { return rfAbsorbed; }

    Fluid coolantType = getCoolantType();
    int coolantAmt = getFluidAmount(COLD);

    float heatOfVaporization = getHeatOfVaporization(coolantType);
   
    int mbVaporized = Math.min(coolantAmt, (int)(rfAbsorbed / heatOfVaporization));

    // Cap by the available space in the vapor chamber
    mbVaporized = Math.min(mbVaporized, getRemainingSpaceForFluid(HOT));
   
    // We don't do partial vaporization. Just return all the heat.
    if(mbVaporized < 1) { return rfAbsorbed; }

    // Make sure we either have an empty vapor chamber or the vapor types match
    Fluid newVaporType = getVaporizedCoolantFluid(coolantType);
    if(newVaporType == null) {
      BRLog.warning("Coolant in tank (%s) has no registered vapor type!", coolantType.getName());
      return rfAbsorbed;
    }
   
    Fluid existingVaporType = getVaporType();
    if(existingVaporType != null && !newVaporType.getName().equals(existingVaporType.getName())) {
      // Can't vaporize anything with incompatible vapor in the vapor tank
      return rfAbsorbed;
    }
   
    // Vaporize! -- POINT OF NO RETURN
View Full Code Here

Examples of net.minecraftforge.fluids.Fluid

      if(steamIn > 0) {
        fluidConsumedLastTick = steamIn;
        drain(TANK_INPUT, steamIn, true);
       
        if(ventStatus != VentStatus.VentAll) {
          Fluid effluent = FluidRegistry.WATER;
          FluidStack effluentStack = new FluidStack(effluent, steamIn);
          fill(TANK_OUTPUT, effluentStack, true);
        }
      }
    }
View Full Code Here

Examples of net.minecraftforge.fluids.Fluid

    if(inputFluidID == FLUID_NONE || inputFluidAmt <= 0) {
      tanks[TANK_INPUT].setFluid(null);
    }
    else {
      Fluid fluid = FluidRegistry.getFluid(inputFluidID);
      if(fluid == null) {
        BRLog.warning("[CLIENT] Multiblock Turbine received an unknown fluid of type %d, setting input tank to empty", inputFluidID);
        tanks[TANK_INPUT].setFluid(null);
      }
      else {
        tanks[TANK_INPUT].setFluid(new FluidStack(fluid, inputFluidAmt));
      }
    }

    if(outputFluidID == FLUID_NONE || outputFluidAmt <= 0) {
      tanks[TANK_OUTPUT].setFluid(null);
    }
    else {
      Fluid fluid = FluidRegistry.getFluid(outputFluidID);
      if(fluid == null) {
        BRLog.warning("[CLIENT] Multiblock Turbine received an unknown fluid of type %d, setting output tank to empty", outputFluidID);
        tanks[TANK_OUTPUT].setFluid(null);
      }
      else {
View Full Code Here

Examples of net.minecraftforge.fluids.Fluid

 
  public FluidStack drain(int idx, FluidStack resource,
      boolean doDrain) {
    if(resource == null || resource.amount <= 0 || idx < 0 || idx >= fluids.length) { return null; }
   
    Fluid existingFluid = getFluidType(idx);
    if(existingFluid == null || existingFluid.getID() != resource.getFluid().getID()) { return null; }
   
    FluidStack drained = resource.copy();
    if(!doDrain) {
      drained.amount = Math.min(resource.amount, getFluidAmount(idx));
    }
View Full Code Here

Examples of net.minecraftforge.fluids.Fluid

    }
    else {
      interiorData = ReactorInterior.getBlockData(ItemHelper.oreProxy.getOreName(new ItemStack(block, 1, metadata)));

      if(interiorData == null && block instanceof IFluidBlock) {
        Fluid fluid = ((IFluidBlock)block).getFluid();
        if(fluid != null) {
          interiorData = ReactorInterior.getFluidData(fluid.getName());
        }
      }
    }
   
    if(interiorData == null) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.