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

    if(xAxis >= 6 && xAxis <= 22 && yAxis >= 5+13 && yAxis <= 63+13)
    {
      stack = ((CachedIORecipe)arecipes.get(recipe)).inputStack;
    }
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 = ((CachedIORecipe)arecipes.get(recipe)).inputStack;
    }
View Full Code Here

      prevEnergy = getEnergy();

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

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

        if(tileEntity instanceof IGasHandler)
        {
View Full Code Here

      inputFluidTank.setFluid(null);
    }

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

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

      gasTank.receive(GasTransmission.removeGas(inventory[1], gasTank.getGasType(), gasTank.getNeeded()), true);
    }

    if(!worldObj.isRemote && gasTank.getGas() != null && MekanismUtils.canFunction(this))
    {
      GasStack toSend = new GasStack(gasTank.getGas().getGas(), Math.min(gasTank.getStored(), output));

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

      if(tileEntity instanceof IGasHandler)
      {
View Full Code Here

    super.handlePacketData(dataStream);

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

  }

  @Override
  public GasStack getItemGas(ItemStack itemstack)
  {
    if(MekanismUtils.getOreDictName(itemstack).contains("dustSulfur")) return new GasStack(GasRegistry.getGas("sulfuricAcid"), 2);
    if(MekanismUtils.getOreDictName(itemstack).contains("dustSalt")) return new GasStack(GasRegistry.getGas("hydrogenChloride"), 2);
    if(Block.getBlockFromItem(itemstack.getItem()) == Mekanism.GasTank && ((IGasItem)itemstack.getItem()).getGas(itemstack) != null &&
        isValidGas(((IGasItem)itemstack.getItem()).getGas(itemstack).getGas())) return new GasStack(GasRegistry.getGas("sulfuricAcid"), 1);

    return null;
  }
View Full Code Here

  @Override
  public void handleSecondaryFuel()
  {
    if(inventory[1] != null && gasTank.getNeeded() > 0 && inventory[1].getItem() instanceof IGasItem)
    {
      GasStack gas = ((IGasItem)inventory[1].getItem()).getGas(inventory[1]);

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

      return;
    }
View Full Code Here

      ((IEnergizedItem)toReturn.getItem()).setEnergy(toReturn, Math.min(((IEnergizedItem)toReturn.getItem()).getMaxEnergy(toReturn), energyFound));
    }
   
    if(toReturn.getItem() instanceof IGasItem)
    {
      GasStack gasFound = null;
     
      for(int i = 0; i < 9; i++)
      {
        ItemStack itemstack = inv.getStackInSlot(i);

        if(itemstack != null && itemstack.getItem() instanceof IGasItem)
        {
          GasStack stored = ((IGasItem)itemstack.getItem()).getGas(itemstack);
         
          if(stored != null)
          {
            if(!((IGasItem)toReturn.getItem()).canReceiveGas(toReturn, stored.getGas()))
            {
              return null;
            }
           
            if(gasFound == null)
            {
              gasFound = stored;
            }
            else {
              if(gasFound.getGas() != stored.getGas())
              {
                return null;
              }
             
              gasFound.amount += stored.amount;
View Full Code Here

      }

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

        outputTank.receive(stack, true);
        fluidTank.drain(WATER_USAGE, true);

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

      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

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.