Package mekanism.api.gas

Examples of mekanism.api.gas.GasStack


  public void registerIcons(IIconRegister register) {}

  @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.mode") + ": " + EnumColor.GREY + getMode(itemstack).getName());
  }
View Full Code Here


    setMode(stack, getMode(stack).increment());
  }

  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("hydrogen"), ((IGasItem)filled.getItem()).getMaxGas(filled)));
    list.add(filled);
  }
View Full Code Here

  }

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

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

    displayGauge(58, 6-xOffset, 5-yOffset, 176, 4, 58, null, new GasStack(GasRegistry.getGas("sulfuricAcid"), 1));

    if(gas != null)
    {
      displayGauge(58, 134-xOffset, 14-yOffset, 176, 4, 58, null, gas);
    }
View Full Code Here

    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 stack = null;

    if(xAxis >= 6 && xAxis <= 22 && yAxis >= 5+13 && yAxis <= 63+13)
    {
      stack = new GasStack(GasRegistry.getGas("sulfuricAcid"), 1);
    }
    else if(xAxis >= 134 && xAxis <= 150 && yAxis >= 14+4 && yAxis <= 72+4)
    {
      stack = ((CachedIORecipe)arecipes.get(recipe)).outputStack;
    }
View Full Code Here

    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 stack = null;

    if(xAxis >= 6 && xAxis <= 22 && yAxis >= 5+13 && yAxis <= 63+13)
    {
      stack = new GasStack(GasRegistry.getGas("sulfuricAcid"), 1);
    }
    else if(xAxis >= 134 && xAxis <= 150 && yAxis >= 14+4 && yAxis <= 72+4)
    {
      stack = ((CachedIORecipe)arecipes.get(recipe)).outputStack;
    }
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.