Examples of GasStack


Examples of mekanism.api.gas.GasStack

    for(Gas type : GasRegistry.getRegisteredGasses())
    {
      if(type.isVisible())
      {
        ItemStack filled = new ItemStack(this);
        setGas(filled, new GasStack(type, ((IGasItem)filled.getItem()).getMaxGas(filled)));
        list.add(filled);
      }
    }
  }
View Full Code Here

Examples of mekanism.api.gas.GasStack

    {
      return 0;
    }

    int toUse = Math.min(getMaxGas(itemstack)-getStored(itemstack), Math.min(getRate(itemstack), stack.amount));
    setGas(itemstack, new GasStack(stack.getGas(), getStored(itemstack)+toUse));

    return toUse;
  }
View Full Code Here

Examples of mekanism.api.gas.GasStack

    }

    Gas type = getGas(itemstack).getGas();

    int gasToUse = Math.min(getStored(itemstack), Math.min(getRate(itemstack), amount));
    setGas(itemstack, new GasStack(type, getStored(itemstack)-gasToUse));

    return new GasStack(type, gasToUse);
  }
View Full Code Here

Examples of mekanism.api.gas.GasStack

   * @param removeGas - whether or not to use gas in the gas tank
   * @return output ItemStack
   */
  public static ItemStack getChemicalCrystallizerOutput(GasTank gasTank, boolean removeGas)
  {
    GasStack gas = gasTank.getGas();

    if(gas != null)
    {
      HashMap<GasStack, ItemStack> recipes = Recipe.CHEMICAL_CRYSTALLIZER.get();

      for(Map.Entry<GasStack, ItemStack> entry : recipes.entrySet())
      {
        GasStack key = (GasStack)entry.getKey();

        if(key != null && key.getGas() == gas.getGas() && gas.amount >= key.amount)
        {
          gasTank.draw(key.amount, removeGas);

          return entry.getValue().copy();
        }
View Full Code Here

Examples of mekanism.api.gas.GasStack

   * @param removeGas - whether or not to use gas in the gas tank
   * @return output GasStack
   */
  public static GasStack getChemicalWasherOutput(GasTank gasTank, boolean removeGas)
  {
    GasStack gas = gasTank.getGas();

    if(gas != null)
    {
      HashMap<GasStack, GasStack> recipes = Recipe.CHEMICAL_WASHER.get();

      for(Map.Entry<GasStack, GasStack> entry : recipes.entrySet())
      {
        GasStack key = (GasStack)entry.getKey();

        if(key != null && key.getGas() == gas.getGas() && gas.amount >= key.amount)
        {
          gasTank.draw(key.amount, removeGas);

          return entry.getValue().copy();
        }
View Full Code Here

Examples of mekanism.api.gas.GasStack

  }

  public static PressurizedRecipe getPRCOutput(ItemStack inputItem, FluidTank inputFluidTank, GasTank inputGasTank)
  {
    FluidStack inputFluid = inputFluidTank.getFluid();
    GasStack inputGas = inputGasTank.getGas();

    if(inputFluid != null && inputGas != null)
    {
      HashMap<PressurizedReactants, PressurizedRecipe> recipes = Recipe.PRESSURIZED_REACTION_CHAMBER.get();
View Full Code Here

Examples of mekanism.api.gas.GasStack

  public void handleSecondaryFuel()
  {
    if(inventory[1] != null)
    {
      GasStack stack = getItemGas(inventory[1]);
      int gasNeeded = gasTank.getNeeded();

      if(stack != null && stack.amount <= gasNeeded)
      {
        gasTank.receive(stack, true);
View Full Code Here

Examples of mekanism.api.gas.GasStack

  {
    super.handlePacketData(dataStream);

    if(dataStream.readBoolean())
    {
      gasTank.setGas(new GasStack(dataStream.readInt(), dataStream.readInt()));
    }
    else {
      gasTank.setGas(null);
    }
  }
View Full Code Here

Examples of mekanism.api.gas.GasStack

        RecipeHandler.addMetallurgicInfuserRecipe(InfusionInput.getInfusion(InfuseRegistry.get("BIO"), 10, new ItemStack(Blocks.sand)), new ItemStack(Blocks.dirt));
        RecipeHandler.addMetallurgicInfuserRecipe(InfusionInput.getInfusion(InfuseRegistry.get("DIAMOND"), 10, new ItemStack(EnrichedAlloy)), new ItemStack(ReinforcedAlloy));
        RecipeHandler.addMetallurgicInfuserRecipe(InfusionInput.getInfusion(InfuseRegistry.get("OBSIDIAN"), 10, new ItemStack(ReinforcedAlloy)), new ItemStack(AtomicAlloy));
       
        //Chemical Infuser Recipes
        RecipeHandler.addChemicalInfuserRecipe(new ChemicalPair(new GasStack(GasRegistry.getGas("oxygen"), 1), new GasStack(GasRegistry.getGas("sulfurDioxideGas"), 2)), new GasStack(GasRegistry.getGas("sulfurTrioxideGas"), 2));
    RecipeHandler.addChemicalInfuserRecipe(new ChemicalPair(new GasStack(GasRegistry.getGas("sulfurTrioxideGas"), 1), new GasStack(GasRegistry.getGas("water"), 1)), new GasStack(GasRegistry.getGas("sulfuricAcid"), 1));
    RecipeHandler.addChemicalInfuserRecipe(new ChemicalPair(new GasStack(GasRegistry.getGas("hydrogen"), 1), new GasStack(GasRegistry.getGas("chlorine"), 1)), new GasStack(GasRegistry.getGas("hydrogenChloride"), 1));

    //Electrolytic Separator Recipes
    RecipeHandler.addElectrolyticSeparatorRecipe(FluidRegistry.getFluidStack("water", 2), new ChemicalPair(new GasStack(GasRegistry.getGas("hydrogen"), 2), new GasStack(GasRegistry.getGas("oxygen"), 1)));
    RecipeHandler.addElectrolyticSeparatorRecipe(FluidRegistry.getFluidStack("brine", 10), new ChemicalPair(new GasStack(GasRegistry.getGas("sodium"), 1), new GasStack(GasRegistry.getGas("chlorine"), 1)));
   
    //T4 Processing Recipes
    for(Gas gas : GasRegistry.getRegisteredGasses())
    {
      if(gas instanceof OreGas && !((OreGas)gas).isClean())
      {
        OreGas oreGas = (OreGas)gas;
       
        RecipeHandler.addChemicalWasherRecipe(new GasStack(oreGas, 1), new GasStack(oreGas.getCleanGas(), 1));
        RecipeHandler.addChemicalCrystallizerRecipe(new GasStack(oreGas.getCleanGas(), 200), new ItemStack(Crystal, 1, Resource.getFromName(oreGas.getName()).ordinal()));
      }
    }
   
    //Chemical Dissolution Chamber Recipes
    RecipeHandler.addChemicalDissolutionChamberRecipe(new ItemStack(Blocks.obsidian), new GasStack(GasRegistry.getGas("obsidian"), 1000));

    //Pressurized Reaction Chamber Recipes
    RecipeHandler.addPRCRecipe(
        new PressurizedReactants(new ItemStack(BioFuel, 2), new FluidStack(FluidRegistry.WATER, 10), new GasStack(GasRegistry.getGas("hydrogen"), 100)),
        new PressurizedProducts(new ItemStack(Substrate), new GasStack(GasRegistry.getGas("ethene"), 100)),
        0,
        100
    );

    RecipeHandler.addPRCRecipe(
        new PressurizedReactants(new ItemStack(Substrate), new FluidStack(FluidRegistry.getFluid("ethene"), 50), new GasStack(GasRegistry.getGas("oxygen"), 10)),
        new PressurizedProducts(new ItemStack(Polyethene), new GasStack(GasRegistry.getGas("oxygen"), 5)),
        1000,
        60
    );

        //Infuse objects
View Full Code Here

Examples of mekanism.api.gas.GasStack

    CachedIORecipe recipe = (CachedIORecipe)arecipes.get(i);

    if(recipe.input.gasType != null && ticksPassed >= 20)
    {
      int displayInt = ticksPassed < 40 ? (ticksPassed-20)*12 / 20 : 12;
      displayGauge(45, 32 + 12 - displayInt, 6, displayInt, new GasStack(recipe.input.gasType, 1));
    }
  }
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.