Examples of GasStack


Examples of mekanism.api.gas.GasStack

  @Override
  public GasStack getItemGas(ItemStack itemstack)
  {
    if(itemstack.getItem() instanceof ItemBlock && Block.getBlockFromItem(itemstack.getItem()) == Blocks.cobblestone)
    {
      return new GasStack(GasRegistry.getGas("liquidStone"), 200);
    }

    return null;
  }
View Full Code Here

Examples of mekanism.api.gas.GasStack

    controlType = RedstoneControl.values()[dataStream.readInt()];

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

Examples of mekanism.api.gas.GasStack

        {
          operatingTicks++;
          injectTank.draw(INJECT_USAGE, true);
        }
        else {
          GasStack stack = RecipeHandler.getItemToGasOutput(inventory[1], true, Recipe.CHEMICAL_DISSOLUTION_CHAMBER.get());

          outputTank.receive(stack, true);
          injectTank.draw(INJECT_USAGE, true);

          operatingTicks = 0;

          if(inventory[1].stackSize <= 0)
          {
            inventory[1] = null;
          }

          markDirty();
        }
      }
      else {
        if(prevEnergy >= getEnergy())
        {
          changed = true;
          setActive(false);
        }
      }

      if(changed && !canOperate())
      {
        operatingTicks = 0;
      }

      prevEnergy = getEnergy();

      if(outputTank.getGas() != null)
      {
        GasStack toSend = new GasStack(outputTank.getGas().getGas(), Math.min(outputTank.getStored(), gasOutput));

        TileEntity tileEntity = Coord4D.get(this).getFromSide(MekanismUtils.getRight(facing)).getTileEntity(worldObj);

        if(tileEntity instanceof IGasHandler)
        {
View Full Code Here

Examples of mekanism.api.gas.GasStack

    if(inventory[1] == null)
    {
      return false;
    }

    GasStack stack = RecipeHandler.getItemToGasOutput(inventory[1], false, Recipe.CHEMICAL_DISSOLUTION_CHAMBER.get());

    if(stack == null || (outputTank.getGas() != null && (outputTank.getGas().getGas() != stack.getGas() || outputTank.getNeeded() < stack.amount)))
    {
      return false;
    }

    return true;
View Full Code Here

Examples of mekanism.api.gas.GasStack

    controlType = RedstoneControl.values()[dataStream.readInt()];
    operatingTicks = dataStream.readInt();

    if(dataStream.readBoolean())
    {
      injectTank.setGas(new GasStack(GasRegistry.getGas(dataStream.readInt()), dataStream.readInt()));
    }
    else {
      injectTank.setGas(null);
    }

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

Examples of mekanism.api.gas.GasStack

        amount = dataStream.readInt();
        didGasTransfer = dataStream.readBoolean();
 
        if(gasType != null)
        {
          gasStack = new GasStack(gasType, amount);
        }
      }
      else if(packetType == PacketType.FLUID)
      {
        int type = dataStream.readInt();
View Full Code Here

Examples of mekanism.api.gas.GasStack

   */
  public static ItemStack getFullGasTank(Gas gas)
  {
    ItemStack tank = getEmptyGasTank();
    ItemBlockGasTank item = (ItemBlockGasTank)tank.getItem();
    item.setGas(tank, new GasStack(gas, item.MAX_GAS));

    return tank;
  }
View Full Code Here

Examples of mekanism.api.gas.GasStack

  }

  @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);
    }

    if(!MekKeyHandler.getIsKeyPressed(MekanismKeyHandler.sneakKey))
    {
      list.add(MekanismUtils.localize("tooltip.hold") + " " + EnumColor.AQUA + GameSettings.getKeyDisplayString(MekanismKeyHandler.sneakKey.getKeyCode()) + EnumColor.GREY + " " + MekanismUtils.localize("tooltip.forDetails"));
View Full Code Here

Examples of mekanism.api.gas.GasStack

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

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

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

Examples of mekanism.api.gas.GasStack

      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
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.