Examples of GasStack


Examples of mekanism.api.gas.GasStack

  @Override
  public void handleSecondaryFuel()
  {
    if(inventory[1] != null && gasTank.getNeeded() > 0 && inventory[1].getItem() instanceof IGasItem)
    {
      GasStack removed = GasTransmission.removeGas(inventory[1], GasRegistry.getGas("oxygen"), gasTank.getNeeded());
      gasTank.receive(removed, true);
      return;
    }

    super.handleSecondaryFuel();
View Full Code Here

Examples of mekanism.api.gas.GasStack

      }

      if(canOperate() && getEnergy() >= ENERGY_USAGE && MekanismUtils.canFunction(this))
      {
        setActive(true);
        GasStack stack = RecipeHandler.getChemicalInfuserOutput(leftTank, rightTank, true);

        centerTank.receive(stack, true);

        setEnergy(getEnergy() - ENERGY_USAGE);
      }
      else {
        if(prevEnergy >= getEnergy())
        {
          setActive(false);
        }
      }

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

        TileEntity tileEntity = Coord4D.get(this).getFromSide(ForgeDirection.getOrientation(facing)).getTileEntity(worldObj);

        if(tileEntity instanceof IGasHandler)
        {
View Full Code Here

Examples of mekanism.api.gas.GasStack

    if(leftTank.getGas() == null || rightTank.getGas() == null || centerTank.getNeeded() == 0)
    {
      return false;
    }

    GasStack out = RecipeHandler.getChemicalInfuserOutput(leftTank, rightTank, false);

    if(out == null || centerTank.getGas() != null && centerTank.getGas().getGas() != out.getGas())
    {
      return false;
    }

    if(centerTank.getNeeded() < out.amount)
View Full Code Here

Examples of mekanism.api.gas.GasStack

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

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

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

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

Examples of mekanism.api.gas.GasStack

  {
    if(inventory[4] != null && RecipeType.values()[recipeType].usesFuel() && gasTank.getNeeded() > 0)
    {
      if(inventory[4].getItem() instanceof IGasItem)
      {
        GasStack gas = ((IGasItem)inventory[4].getItem()).getGas(inventory[4]);

        if(gas != null && RecipeType.values()[recipeType].isValidGas(gas.getGas()))
        {
          GasStack removed = GasTransmission.removeGas(inventory[4], gasTank.getGasType(), gasTank.getNeeded());
          gasTank.receive(removed, true);
        }

        return;
      }

      GasStack stack = RecipeType.values()[recipeType].getItemGas(inventory[4]);
      int gasNeeded = gasTank.getNeeded();

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

Examples of mekanism.api.gas.GasStack

      sideConfig[i] = dataStream.readByte();
    }

    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

    for(ItemStack ore : OreDictionary.getOres("ingotOsmium"))
    {
      if(ore.isItemEqual(itemstack))
      {
        return new GasStack(GasRegistry.getGas("liquidOsmium"), 200);
      }
    }

    for(ItemStack ore : OreDictionary.getOres("blockOsmium"))
    {
      if(ore.isItemEqual(itemstack))
      {
        return new GasStack(GasRegistry.getGas("liquidOsmium"), 1800);
      }
    }

    return null;
  }
View Full Code Here

Examples of mekanism.api.gas.GasStack

        if(operatingTicks < MekanismUtils.getTicks(this, TICKS_REQUIRED))
        {
          operatingTicks++;
        }
        else {
          GasStack stack = RecipeHandler.getItemToGasOutput(inventory[0], true, Recipe.CHEMICAL_OXIDIZER.get());

          gasTank.receive(stack, true);
          operatingTicks = 0;

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

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

      prevEnergy = getEnergy();

      if(gasTank.getGas() != null)
      {
        GasStack toSend = new GasStack(gasTank.getGas().getGas(), Math.min(gasTank.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[0] == null)
    {
      return false;
    }

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

    if(stack == null || (gasTank.getGas() != null && (gasTank.getGas().getGas() != stack.getGas() || gasTank.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())
    {
      gasTank.setGas(new GasStack(GasRegistry.getGas(dataStream.readInt()), dataStream.readInt()));
    }
    else {
      gasTank.setGas(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.