Examples of LiquidStack


Examples of buildcraft.api.liquids.LiquidStack

 
 
  @Override
  public void burn() {
    currentOutput = 0;
    IronEngineFuel currentFuel = IronEngineFuel.getFuelForLiquid(new LiquidStack(liquidId, liquidQty, 0));
    if (currentFuel == null) return;
    if (!tile.isRedstonePoweredreturn;
    if (burnTime > 0 || liquidQty > 0) {
      if (burnTime > 0) {
        burnTime--;
View Full Code Here

Examples of buildcraft.api.liquids.LiquidStack

  @Override
  public void update() {
    super.update();

    if (itemInInventory != null) {
      LiquidStack liquid = null;
      liquid = LiquidManager.getLiquidForFilledItem(itemInInventory);
      if (liquid != null) {
        if (fill(Orientations.Unknown, liquid, false) == liquid.amount) {
          fill(Orientations.Unknown, liquid, true);
          tile.setInventorySlotContents(0, Utils.consumeItem(itemInInventory));
View Full Code Here

Examples of buildcraft.api.liquids.LiquidStack

 
  @Override
  public void burn() {
    currentOutput = 0;
    IronEngineFuel currentFuel = IronEngineFuel.getFuelForLiquid(new LiquidStack(liquidId, liquidQty, 0));
    if (currentFuel == null) return;
    if (!tile.isRedstonePoweredreturn;
    if (burnTime > 0 || liquidQty > 0) {
      if (burnTime > 0) {
        burnTime--;
View Full Code Here

Examples of buildcraft.api.liquids.LiquidStack

  @Override
  public void update() {
    super.update();

    if (itemInInventory != null) {
      LiquidStack liquid = null;
      liquid = LiquidManager.getLiquidForFilledItem(itemInInventory);
      if (liquid != null) {
        if (fill(Orientations.Unknown, liquid, false) == liquid.amount) {
          fill(Orientations.Unknown, liquid, true);
          tile.setInventorySlotContents(0, Utils.consumeItem(itemInInventory));
View Full Code Here

Examples of net.minecraftforge.liquids.LiquidStack

  {
    if(!Loader.isModLoaded("Forestry"))
    {
      return;
    }
    LiquidContainerRegistry.registerLiquid(new LiquidContainerData(LiquidDictionary.getOrCreateLiquid("milk", new LiquidStack(
        MineFactoryReloadedCore.milkLiquid, LiquidContainerRegistry.BUCKET_VOLUME)), new ItemStack(Item.bucketMilk), new ItemStack(Item.bucketEmpty)));
    LiquidContainerRegistry.registerLiquid(new LiquidContainerData(LiquidDictionary.getOrCreateLiquid("sludge", new LiquidStack(
        MineFactoryReloadedCore.sludgeLiquid, LiquidContainerRegistry.BUCKET_VOLUME)), new ItemStack(MineFactoryReloadedCore.sludgeBucketItem),
        new ItemStack(Item.bucketEmpty)));
    LiquidContainerRegistry.registerLiquid(new LiquidContainerData(LiquidDictionary.getOrCreateLiquid("sewage", new LiquidStack(
        MineFactoryReloadedCore.sewageLiquid, LiquidContainerRegistry.BUCKET_VOLUME)), new ItemStack(MineFactoryReloadedCore.sewageBucketItem),
        new ItemStack(Item.bucketEmpty)));
    LiquidContainerRegistry.registerLiquid(new LiquidContainerData(LiquidDictionary.getOrCreateLiquid("mobEssence", new LiquidStack(
        MineFactoryReloadedCore.essenceLiquid, LiquidContainerRegistry.BUCKET_VOLUME)), new ItemStack(MineFactoryReloadedCore.mobEssenceBucketItem),
        new ItemStack(Item.bucketEmpty)));
    LiquidContainerRegistry.registerLiquid(new LiquidContainerData(LiquidDictionary.getOrCreateLiquid("biofuel", new LiquidStack(
        MineFactoryReloadedCore.biofuelLiquid, LiquidContainerRegistry.BUCKET_VOLUME)), new ItemStack(MineFactoryReloadedCore.bioFuelBucketItem),
        new ItemStack(Item.bucketEmpty)));
    LiquidContainerRegistry.registerLiquid(new LiquidContainerData(LiquidDictionary.getOrCreateLiquid("meat", new LiquidStack(
        MineFactoryReloadedCore.meatLiquid, LiquidContainerRegistry.BUCKET_VOLUME)), new ItemStack(MineFactoryReloadedCore.meatBucketItem),
        new ItemStack(Item.bucketEmpty)));
    LiquidContainerRegistry.registerLiquid(new LiquidContainerData(LiquidDictionary.getOrCreateLiquid("pinkslime", new LiquidStack(
        MineFactoryReloadedCore.pinkSlimeLiquid, LiquidContainerRegistry.BUCKET_VOLUME)), new ItemStack(MineFactoryReloadedCore.pinkSlimeBucketItem),
        new ItemStack(Item.bucketEmpty)));
    LiquidContainerRegistry.registerLiquid(new LiquidContainerData(LiquidDictionary.getOrCreateLiquid("chocolatemilk", new LiquidStack(
        MineFactoryReloadedCore.chocolateMilkLiquid, LiquidContainerRegistry.BUCKET_VOLUME)), new ItemStack(
        MineFactoryReloadedCore.chocolateMilkBucketItem), new ItemStack(Item.bucketEmpty)));
    LiquidContainerRegistry.registerLiquid(new LiquidContainerData(LiquidDictionary.getOrCreateLiquid("mushroomsoup", new LiquidStack(
        MineFactoryReloadedCore.mushroomSoupLiquid, LiquidContainerRegistry.BUCKET_VOLUME)), new ItemStack(
        MineFactoryReloadedCore.mushroomSoupBucketItem), new ItemStack(Item.bucketEmpty)));
   
    LiquidContainerRegistry.registerLiquid(new LiquidContainerData(LiquidDictionary.getOrCreateLiquid("mushroomsoup", new LiquidStack(
        MineFactoryReloadedCore.mushroomSoupLiquid, LiquidContainerRegistry.BUCKET_VOLUME)), new ItemStack(Item.bowlSoup),
        new ItemStack(Item.bowlEmpty)));
  }
View Full Code Here

Examples of net.minecraftforge.liquids.LiquidStack

  {
    if(!Loader.isModLoaded("Forestry"))
    {
      return;
    }
    LiquidContainerRegistry.registerLiquid(new LiquidContainerData(LiquidDictionary.getOrCreateLiquid("milk", new LiquidStack(
        MineFactoryReloadedCore.milkLiquid, LiquidContainerRegistry.BUCKET_VOLUME)), new ItemStack(Item.bucketMilk), new ItemStack(Item.bucketEmpty)));
    LiquidContainerRegistry.registerLiquid(new LiquidContainerData(LiquidDictionary.getOrCreateLiquid("sludge", new LiquidStack(
        MineFactoryReloadedCore.sludgeLiquid, LiquidContainerRegistry.BUCKET_VOLUME)), new ItemStack(MineFactoryReloadedCore.sludgeBucketItem),
        new ItemStack(Item.bucketEmpty)));
    LiquidContainerRegistry.registerLiquid(new LiquidContainerData(LiquidDictionary.getOrCreateLiquid("sewage", new LiquidStack(
        MineFactoryReloadedCore.sewageLiquid, LiquidContainerRegistry.BUCKET_VOLUME)), new ItemStack(MineFactoryReloadedCore.sewageBucketItem),
        new ItemStack(Item.bucketEmpty)));
    LiquidContainerRegistry.registerLiquid(new LiquidContainerData(LiquidDictionary.getOrCreateLiquid("mobEssence", new LiquidStack(
        MineFactoryReloadedCore.essenceLiquid, LiquidContainerRegistry.BUCKET_VOLUME)), new ItemStack(MineFactoryReloadedCore.mobEssenceBucketItem),
        new ItemStack(Item.bucketEmpty)));
    LiquidContainerRegistry.registerLiquid(new LiquidContainerData(LiquidDictionary.getOrCreateLiquid("biofuel", new LiquidStack(
        MineFactoryReloadedCore.biofuelLiquid, LiquidContainerRegistry.BUCKET_VOLUME)), new ItemStack(MineFactoryReloadedCore.bioFuelBucketItem),
        new ItemStack(Item.bucketEmpty)));
   
    MineFactoryReloadedCore.proxy.onPostTextureStitch(null);
    ForestryUtils.setTreeRoot();
View Full Code Here

Examples of net.minecraftforge.liquids.LiquidStack

        {
          for(ItemStack s : drops)
          {
            if(LiquidContainerRegistry.isLiquid(s))
            {
              _tank.fill(new LiquidStack(s.itemID, LiquidContainerRegistry.BUCKET_VOLUME, s.getItemDamage()), true);
              didDrop = true;
              continue;
            }
           
            doDrop(s);
View Full Code Here

Examples of net.minecraftforge.liquids.LiquidStack

    {
      if(_inventory[i] != null)
      {
        if(LiquidContainerRegistry.isFilledContainer(_inventory[i]))
        {
          LiquidStack l = LiquidContainerRegistry.getLiquidForFilledItem(_inventory[i]);
          for(ItemResourceTracker t : requiredItems)
          {
            if(t.id == l.itemID && t.meta == l.itemMeta)
            {
              t.required += 1000;
              continue inv;
            }
          }
          requiredItems.add(new ItemResourceTracker(l.itemID, l.itemMeta, 1000));
        }
        else
        {
          for(ItemResourceTracker t : requiredItems)
          {
            if(t.id == _inventory[i].itemID && t.meta == _inventory[i].getItemDamage())
            {
              t.required++;
              continue inv;
            }
          }
          requiredItems.add(new ItemResourceTracker(_inventory[i].itemID, _inventory[i].getItemDamage(), 1));
        }
      }
    }
   
    for(int i = 11; i < 29; i++)
    {
      if(_inventory[i] != null)
      {
        for(ItemResourceTracker t : requiredItems)
        {
          if(t.id == _inventory[i].itemID && (t.meta == _inventory[i].getItemDamage() || _inventory[i].getItem().isDamageable()))
          {
            if(!_inventory[i].getItem().hasContainerItem())
            {
              t.found += _inventory[i].stackSize;
            }
            else
            {
              t.found += 1;
            }
            break;
          }
        }
      }
    }
    for(int i = 0; i < _tanks.length; i++)
    {
      LiquidStack l = _tanks[i].getLiquid();
      if(l == null || l.amount == 0)
      {
        continue;
      }
      for(ItemResourceTracker t : requiredItems)
      {
        if(t.id == l.itemID && t.meta == l.itemMeta)
        {
          t.found += l.amount;
          break;
        }
      }
    }
   
    for(ItemResourceTracker t : requiredItems)
    {
      if(t.found < t.required)
      {
        _resourcesChangedSinceLastFailedCraft = false;
        return;
      }
    }
   
    for(int i = 11; i < 29; i++)
    {
      if(_inventory[i] != null)
      {
        for(ItemResourceTracker t : requiredItems)
        {
          if(t.id == _inventory[i].itemID && (t.meta == _inventory[i].getItemDamage() || _inventory[i].getItem().isDamageable()))
          {
            int use;
            if(_inventory[i].getItem().hasContainerItem())
            {
              use = 1;
              ItemStack container = _inventory[i].getItem().getContainerItemStack(_inventory[i]);
              if(container.isItemStackDamageable() && container.getItemDamage() > container.getMaxDamage())
              {
                _inventory[i] = null;
              }
              else
              {
                _inventory[i] = container;
              }
            }
            else
            {
              use = Math.min(t.required, _inventory[i].stackSize);
              _inventory[i].stackSize -= use;
            }
            t.required -= use;
           
            if(_inventory[i] != null && _inventory[i].stackSize == 0)
            {
              _inventory[i] = null;
            }
           
            if(t.required == 0)
            {
              requiredItems.remove(t);
            }
            break;
          }
        }
      }
    }
    for(int i = 0; i < _tanks.length; i++)
    {
      LiquidStack l = _tanks[i].getLiquid();
      if(l == null || l.amount == 0)
      {
        continue;
      }
      for(ItemResourceTracker t : requiredItems)
View Full Code Here

Examples of net.minecraftforge.liquids.LiquidStack

    {
      NBTTagCompound nbttagcompound1 = (NBTTagCompound)nbttaglist.tagAt(i);
      int j = nbttagcompound1.getByte("Tank") & 0xff;
      if(j >= 0 && j < _tanks.length)
      {
        LiquidStack l = LiquidStack.loadLiquidStackFromNBT(nbttagcompound1);
        if(l != null && l.asItemStack().getItem() != null && LiquidContainerRegistry.isLiquid(l.asItemStack()))
        {
          _tanks[j].setLiquid(l);
        }
      }
    }
View Full Code Here

Examples of net.minecraftforge.liquids.LiquidStack

      if(_tanks[i].getLiquid() != null)
      {
        NBTTagCompound nbttagcompound1 = new NBTTagCompound();
        nbttagcompound1.setByte("Tank", (byte)i);
       
        LiquidStack l = _tanks[i].getLiquid();
        l.writeToNBT(nbttagcompound1);
        tanks.appendTag(nbttagcompound1);
      }
    }
   
    nbttagcompound.setTag("Tanks", tanks);
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.