Examples of calculateItemAddition()


Examples of appeng.api.me.util.IMEInventoryHandler.calculateItemAddition()

      IAEItemStack toImport = Util.createItemStack(new ItemStack(FLUIDDISPLAY.getItemInstance(), drainable.amount, drainable.fluidID));

      IMEInventoryHandler cellArray = getGrid().getCellArray();
      if (cellArray != null)
      {
        IAEItemStack notImported = cellArray.calculateItemAddition(toImport.copy());

        if (fluidFilter != null && !fluidFilter.isEmpty() && fluidFilter.size() > 0)
        {
          if (fluidFilter.contains(drainable.getFluid()))
          {
View Full Code Here

Examples of appeng.api.me.util.IMEInventoryHandler.calculateItemAddition()

        if (doFill)
        {
          added = cellArray.addItems(temp);
        } else
        {
          added = cellArray.calculateItemAddition(temp);
        }
        if (added == null)
        {
          if (doFill)
            getGrid().useMEEnergy(amount / 50, "Import Fluid");
View Full Code Here

Examples of appeng.api.me.util.IMEInventoryHandler.calculateItemAddition()

    if (grid != null)
    {
      IMEInventoryHandler cellArray = grid.getCellArray();
      if (cellArray != null)
      {
        IAEItemStack sim = cellArray.calculateItemAddition(toFill.copy());

        if (sim != null)
        {
          return false;
        }
View Full Code Here

Examples of appeng.api.me.util.IMEInventoryHandler.calculateItemAddition()

        {
          if (Block.blocksList[offsetID] instanceof IFluidBlock)
          {
            FluidStack simulation = ((IFluidBlock) Block.blocksList[offsetID]).drain(worldObj, xCoord + orientation.offsetX, yCoord + orientation.offsetY, zCoord + orientation.offsetZ, false);

            if (simulation != null && cellArray.calculateItemAddition(Util.createItemStack(new ItemStack(ItemEnum.FLUIDDISPLAY.getItemInstance(), simulation.amount, simulation.fluidID))) == null)
            {
              ((IFluidBlock) Block.blocksList[offsetID]).drain(worldObj, xCoord + orientation.offsetX, yCoord + orientation.offsetY, zCoord + orientation.offsetZ, true);
              cellArray.addItems(Util.createItemStack(new ItemStack(ItemEnum.FLUIDDISPLAY.getItemInstance(), simulation.amount, simulation.fluidID)));
            }
          } else if (offsetID == FluidRegistry.WATER.getBlockID() && offsetMeta == 0)
View Full Code Here

Examples of appeng.api.me.util.IMEInventoryHandler.calculateItemAddition()

              ((IFluidBlock) Block.blocksList[offsetID]).drain(worldObj, xCoord + orientation.offsetX, yCoord + orientation.offsetY, zCoord + orientation.offsetZ, true);
              cellArray.addItems(Util.createItemStack(new ItemStack(ItemEnum.FLUIDDISPLAY.getItemInstance(), simulation.amount, simulation.fluidID)));
            }
          } else if (offsetID == FluidRegistry.WATER.getBlockID() && offsetMeta == 0)
          {
            if (cellArray.calculateItemAddition(Util.createItemStack(new ItemStack(ItemEnum.FLUIDDISPLAY.getItemInstance(), 1000, FluidRegistry.WATER.getID()))) == null)
            {
              worldObj.setBlockToAir(xCoord + orientation.offsetX, yCoord + orientation.offsetY, zCoord + orientation.offsetZ);
              cellArray.addItems(Util.createItemStack(new ItemStack(ItemEnum.FLUIDDISPLAY.getItemInstance(), 1000, FluidRegistry.WATER.getID())));
            }
          } else if (offsetID == FluidRegistry.LAVA.getBlockID() && offsetMeta == 0)
View Full Code Here

Examples of appeng.api.me.util.IMEInventoryHandler.calculateItemAddition()

              worldObj.setBlockToAir(xCoord + orientation.offsetX, yCoord + orientation.offsetY, zCoord + orientation.offsetZ);
              cellArray.addItems(Util.createItemStack(new ItemStack(ItemEnum.FLUIDDISPLAY.getItemInstance(), 1000, FluidRegistry.WATER.getID())));
            }
          } else if (offsetID == FluidRegistry.LAVA.getBlockID() && offsetMeta == 0)
          {
            if (cellArray.calculateItemAddition(Util.createItemStack(new ItemStack(ItemEnum.FLUIDDISPLAY.getItemInstance(), 1000, FluidRegistry.LAVA.getID()))) == null)
            {
              worldObj.setBlockToAir(xCoord + orientation.offsetX, yCoord + orientation.offsetY, zCoord + orientation.offsetZ);
              cellArray.addItems(Util.createItemStack(new ItemStack(ItemEnum.FLUIDDISPLAY.getItemInstance(), 1000, FluidRegistry.LAVA.getID())));
            }
          }
View Full Code Here

Examples of appeng.api.me.util.IMEInventoryHandler.calculateItemAddition()

    if (!isMachineActive() || toFill == null || grid == null)
      return 0;
    IMEInventoryHandler cellArray = grid.getCellArray();
    if (cellArray == null)
      return 0;
    IAEItemStack notFilled = cellArray.calculateItemAddition(createFluidItemStack(toFill));
    IAEItemStack filled = createFluidItemStack(toFill);
    if (notFilled != null)
      filled = createFluidItemStack(new SpecialFluidStack(notFilled.getItemDamage(), toFill.amount - notFilled.getStackSize()));
    if (doFill)
      cellArray.addItems(filled);
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.