Package mekanism.api.gas

Examples of mekanism.api.gas.GasStack


    Point point = GuiDraw.getMousePosition();

    int xAxis = point.x - (Integer)MekanismUtils.getPrivateValue(gui, GuiContainer.class, ObfuscatedNames.GuiContainer_guiLeft);
    int yAxis = point.y - (Integer)MekanismUtils.getPrivateValue(gui, GuiContainer.class, ObfuscatedNames.GuiContainer_guiTop);

    GasStack gas = null;
    FluidStack fluid = null;

    if(xAxis >= 26 && xAxis <= 42 && yAxis >= 14+18 && yAxis <= 72+18)
    {
      gas = ((CachedIORecipe)arecipes.get(recipe)).gasStack;
View Full Code Here


  }

  @Override
  public void addInformation(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag)
  {
    GasStack gasStack = getGas(itemstack);

    if(gasStack == null)
    {
      list.add(MekanismUtils.localize("tooltip.noGas") + ".");
    }
    else {
      list.add(MekanismUtils.localize("tooltip.stored") + " " + gasStack.getGas().getLocalizedName() + ": " + gasStack.amount);
    }

    list.add(EnumColor.GREY + MekanismUtils.localize("tooltip.flowing") + ": " + (getFlowing(itemstack) ? EnumColor.DARK_GREEN : EnumColor.DARK_RED) + getFlowingStr(itemstack));
  }
View Full Code Here

    return model;
  }

  public void useGas(ItemStack stack)
  {
    setGas(stack, new GasStack(getGas(stack).getGas(), getGas(stack).amount-1));
  }
View Full Code Here

    {
      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

    }

    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

    if(itemstack.stackTagCompound == null)
    {
      return null;
    }

    GasStack stored = GasStack.readFromNBT(itemstack.stackTagCompound.getCompoundTag("stored"));

    if(stored == null)
    {
      itemstack.setItemDamage(100);
    }
View Full Code Here

      itemstack.setItemDamage(100);
      itemstack.stackTagCompound.removeTag("stored");
    }
    else {
      int amount = Math.max(0, Math.min(stack.amount, getMaxGas(itemstack)));
      GasStack gasStack = new GasStack(stack.getGas(), amount);

      itemstack.setItemDamage((int)Math.max(1, (Math.abs((((float)amount/getMaxGas(itemstack))*100)-100))));
      itemstack.stackTagCompound.setTag("stored", gasStack.write(new NBTTagCompound()));
    }
  }
View Full Code Here

    setGas(empty, null);
    empty.setItemDamage(100);
    list.add(empty);

    ItemStack filled = new ItemStack(this);
    setGas(filled, new GasStack(GasRegistry.getGas("oxygen"), ((IGasItem)filled.getItem()).getMaxGas(filled)));
    list.add(filled);
  }
View Full Code Here

      }
    }
   
    for(ItemStack ore : OreDictionary.getOres("dustSulfur"))
    {
      RecipeHandler.addChemicalOxidizerRecipe(MekanismUtils.size(ore, 1), new GasStack(GasRegistry.getGas("sulfurDioxideGas"), 100));
    }
   
    for(ItemStack ore : OreDictionary.getOres("dustSalt"))
    {
      RecipeHandler.addChemicalOxidizerRecipe(MekanismUtils.size(ore, 1), new GasStack(GasRegistry.getGas("brine"), 15));
    }
   
    for(ItemStack ore : OreDictionary.getOres("dustRefinedObsidian"))
    {
      RecipeHandler.addOsmiumCompressorRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Ingot, 1, 0));
      RecipeHandler.addCrusherRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.DirtyDust, 1, 6));
      RecipeHandler.addEnrichmentChamberRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.CompressedObsidian));
     
      InfuseRegistry.registerInfuseObject(MekanismUtils.size(ore, 1), new InfuseObject(InfuseRegistry.get("OBSIDIAN"), 10));
    }
   
        for(ItemStack ore : OreDictionary.getOres("clumpIron"))
        {
            RecipeHandler.addCrusherRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.DirtyDust, 1, 0));
        }
       
        for(ItemStack ore : OreDictionary.getOres("clumpGold"))
        {
            RecipeHandler.addCrusherRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.DirtyDust, 1, 1));
        }
       
        for(ItemStack ore : OreDictionary.getOres("clumpOsmium"))
        {
            RecipeHandler.addCrusherRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.DirtyDust, 1, 2));
        }
       
        for(ItemStack ore : OreDictionary.getOres("clumpCopper"))
        {
            RecipeHandler.addCrusherRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.DirtyDust, 1, 3));
        }
       
        for(ItemStack ore : OreDictionary.getOres("clumpTin"))
        {
            RecipeHandler.addCrusherRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.DirtyDust, 1, 4));
        }
       
        for(ItemStack ore : OreDictionary.getOres("clumpSilver"))
        {
            RecipeHandler.addCrusherRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.DirtyDust, 1, 5));
        }
       
        for(ItemStack ore : OreDictionary.getOres("clumpObsidian"))
        {
            RecipeHandler.addCrusherRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.DirtyDust, 1, 6));
        }
       
        for(ItemStack ore : OreDictionary.getOres("clumpLead"))
        {
            RecipeHandler.addCrusherRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.DirtyDust, 1, 7));
        }
   
    for(ItemStack ore : OreDictionary.getOres("shardIron"))
    {
      RecipeHandler.addPurificationChamberRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Clump, 1, 0));
    }
   
    for(ItemStack ore : OreDictionary.getOres("shardGold"))
    {
      RecipeHandler.addPurificationChamberRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Clump, 1, 1));
    }
   
    for(ItemStack ore : OreDictionary.getOres("shardOsmium"))
    {
      RecipeHandler.addPurificationChamberRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Clump, 1, 2));
    }
   
    for(ItemStack ore : OreDictionary.getOres("shardCopper"))
    {
      RecipeHandler.addPurificationChamberRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Clump, 1, 3));
    }
   
    for(ItemStack ore : OreDictionary.getOres("shardTin"))
    {
      RecipeHandler.addPurificationChamberRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Clump, 1, 4));
    }
   
    for(ItemStack ore : OreDictionary.getOres("shardSilver"))
    {
      RecipeHandler.addPurificationChamberRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Clump, 1, 5));
    }
   
    for(ItemStack ore : OreDictionary.getOres("shardObsidian"))
    {
      RecipeHandler.addPurificationChamberRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Clump, 1, 6));
    }
   
    for(ItemStack ore : OreDictionary.getOres("shardLead"))
    {
      RecipeHandler.addPurificationChamberRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Clump, 1, 7));
    }
   
    for(ItemStack ore : OreDictionary.getOres("crystalIron"))
    {
      RecipeHandler.addChemicalInjectionChamberRecipe(new AdvancedInput(MekanismUtils.size(ore, 1), GasRegistry.getGas("hydrogenChloride")), new ItemStack(Mekanism.Shard, 1, 0));
    }
   
    for(ItemStack ore : OreDictionary.getOres("crystalGold"))
    {
      RecipeHandler.addChemicalInjectionChamberRecipe(new AdvancedInput(MekanismUtils.size(ore, 1), GasRegistry.getGas("hydrogenChloride")), new ItemStack(Mekanism.Shard, 1, 1));
    }
   
    for(ItemStack ore : OreDictionary.getOres("crystalOsmium"))
    {
      RecipeHandler.addChemicalInjectionChamberRecipe(new AdvancedInput(MekanismUtils.size(ore, 1), GasRegistry.getGas("hydrogenChloride")), new ItemStack(Mekanism.Shard, 1, 2));
    }
   
    for(ItemStack ore : OreDictionary.getOres("crystalCopper"))
    {
      RecipeHandler.addChemicalInjectionChamberRecipe(new AdvancedInput(MekanismUtils.size(ore, 1), GasRegistry.getGas("hydrogenChloride")), new ItemStack(Mekanism.Shard, 1, 3));
    }
   
    for(ItemStack ore : OreDictionary.getOres("crystalTin"))
    {
      RecipeHandler.addChemicalInjectionChamberRecipe(new AdvancedInput(MekanismUtils.size(ore, 1), GasRegistry.getGas("hydrogenChloride")), new ItemStack(Mekanism.Shard, 1, 4));
    }
   
    for(ItemStack ore : OreDictionary.getOres("crystalSilver"))
    {
      RecipeHandler.addChemicalInjectionChamberRecipe(new AdvancedInput(MekanismUtils.size(ore, 1), GasRegistry.getGas("hydrogenChloride")), new ItemStack(Mekanism.Shard, 1, 5));
    }
   
    for(ItemStack ore : OreDictionary.getOres("crystalObsidian"))
    {
      RecipeHandler.addChemicalInjectionChamberRecipe(new AdvancedInput(MekanismUtils.size(ore, 1), GasRegistry.getGas("hydrogenChloride")), new ItemStack(Mekanism.Shard, 1, 6));
    }
   
    for(ItemStack ore : OreDictionary.getOres("crystalLead"))
    {
      RecipeHandler.addChemicalInjectionChamberRecipe(new AdvancedInput(MekanismUtils.size(ore, 1), GasRegistry.getGas("hydrogenChloride")), new ItemStack(Mekanism.Shard, 1, 7));
    }
   
    for(ItemStack ore : OreDictionary.getOres("dustDirtyIron"))
    {
      RecipeHandler.addEnrichmentChamberRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Dust, 1, 0));
    }
   
    for(ItemStack ore : OreDictionary.getOres("dustDirtyGold"))
    {
      RecipeHandler.addEnrichmentChamberRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Dust, 1, 1));
    }
   
    for(ItemStack ore : OreDictionary.getOres("dustDirtyOsmium"))
    {
      RecipeHandler.addEnrichmentChamberRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Dust, 1, 2));
    }
   
    for(ItemStack ore : OreDictionary.getOres("dustDirtyCopper"))
    {
      RecipeHandler.addEnrichmentChamberRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Dust, 1, 6));
    }
   
    for(ItemStack ore : OreDictionary.getOres("dustDirtyTin"))
    {
      RecipeHandler.addEnrichmentChamberRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Dust, 1, 7));
    }
   
    for(ItemStack ore : OreDictionary.getOres("dustDirtySilver"))
    {
      RecipeHandler.addEnrichmentChamberRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Dust, 1, 8));
    }
   
    for(ItemStack ore : OreDictionary.getOres("dustDirtyLead"))
    {
      RecipeHandler.addEnrichmentChamberRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Dust, 1, 9));
    }
   
    for(ItemStack ore : OreDictionary.getOres("oreCopper"))
    {
      RecipeHandler.addEnrichmentChamberRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Dust, 2, 6));
      RecipeHandler.addPurificationChamberRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Clump, 3, 3));
      RecipeHandler.addChemicalInjectionChamberRecipe(new AdvancedInput(MekanismUtils.size(ore, 1), GasRegistry.getGas("hydrogenChloride")), new ItemStack(Mekanism.Shard, 4, 3));
      RecipeHandler.addChemicalDissolutionChamberRecipe(MekanismUtils.size(ore, 1), new GasStack(GasRegistry.getGas("copper"), 1000));
    }
   
    for(ItemStack ore : OreDictionary.getOres("oreTin"))
    {
      RecipeHandler.addEnrichmentChamberRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Dust, 2, 7));
      RecipeHandler.addPurificationChamberRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Clump, 3, 4));
      RecipeHandler.addChemicalInjectionChamberRecipe(new AdvancedInput(MekanismUtils.size(ore, 1), GasRegistry.getGas("hydrogenChloride")), new ItemStack(Mekanism.Shard, 4, 4));
      RecipeHandler.addChemicalDissolutionChamberRecipe(MekanismUtils.size(ore, 1), new GasStack(GasRegistry.getGas("tin"), 1000));
    }
   
    for(ItemStack ore : OreDictionary.getOres("oreOsmium"))
    {
      RecipeHandler.addEnrichmentChamberRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Dust, 2, 2));
      RecipeHandler.addPurificationChamberRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Clump, 3, 2));
      RecipeHandler.addChemicalInjectionChamberRecipe(new AdvancedInput(MekanismUtils.size(ore, 1), GasRegistry.getGas("hydrogenChloride")), new ItemStack(Mekanism.Shard, 4, 2));
      RecipeHandler.addChemicalDissolutionChamberRecipe(MekanismUtils.size(ore, 1), new GasStack(GasRegistry.getGas("osmium"), 1000));
    }
   
    for(ItemStack ore : OreDictionary.getOres("oreIron"))
    {
      RecipeHandler.addEnrichmentChamberRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Dust, 2, 0));
          RecipeHandler.addPurificationChamberRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Clump, 3, 0));
      RecipeHandler.addChemicalInjectionChamberRecipe(new AdvancedInput(MekanismUtils.size(ore, 1), GasRegistry.getGas("hydrogenChloride")), new ItemStack(Mekanism.Shard, 4, 0));
      RecipeHandler.addChemicalDissolutionChamberRecipe(MekanismUtils.size(ore, 1), new GasStack(GasRegistry.getGas("iron"), 1000));
    }
   
    for(ItemStack ore : OreDictionary.getOres("oreGold"))
    {
      RecipeHandler.addEnrichmentChamberRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Dust, 2, 1));
          RecipeHandler.addPurificationChamberRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Clump, 3, 1));
      RecipeHandler.addChemicalInjectionChamberRecipe(new AdvancedInput(MekanismUtils.size(ore, 1), GasRegistry.getGas("hydrogenChloride")), new ItemStack(Mekanism.Shard, 4, 1));
      RecipeHandler.addChemicalDissolutionChamberRecipe(MekanismUtils.size(ore, 1), new GasStack(GasRegistry.getGas("gold"), 1000));
    }
   
    for(ItemStack ore : OreDictionary.getOres("oreSilver"))
    {
      RecipeHandler.addEnrichmentChamberRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Dust, 2, 8));
      RecipeHandler.addPurificationChamberRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Clump, 3, 5));
      RecipeHandler.addChemicalInjectionChamberRecipe(new AdvancedInput(MekanismUtils.size(ore, 1), GasRegistry.getGas("hydrogenChloride")), new ItemStack(Mekanism.Shard, 4, 5));
      RecipeHandler.addChemicalDissolutionChamberRecipe(MekanismUtils.size(ore, 1), new GasStack(GasRegistry.getGas("silver"), 1000));
    }
   
    for(ItemStack ore : OreDictionary.getOres("oreLead"))
    {
      RecipeHandler.addEnrichmentChamberRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Dust, 2, 9));
      RecipeHandler.addPurificationChamberRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Clump, 3, 7));
      RecipeHandler.addChemicalInjectionChamberRecipe(new AdvancedInput(MekanismUtils.size(ore, 1), GasRegistry.getGas("hydrogenChloride")), new ItemStack(Mekanism.Shard, 4, 7));
      RecipeHandler.addChemicalDissolutionChamberRecipe(MekanismUtils.size(ore, 1), new GasStack(GasRegistry.getGas("lead"), 1000));
    }
   
    for(ItemStack ore : OreDictionary.getOres("oreNickel"))
    {
      try {
View Full Code Here

  }

  @Override
  public void drawExtras(int i)
  {
    GasStack gas = ((CachedIORecipe)arecipes.get(i)).inputStack;

    float f = ticksPassed % 20 / 20.0F;
    drawProgressBar(53-xOffset, 61-yOffset, 176, 63, 48, 8, f, 0);

    if(gas != null)
View Full Code Here

TOP

Related Classes of mekanism.api.gas.GasStack

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.