Package net.minecraftforge.liquids

Examples of net.minecraftforge.liquids.LiquidStack


    ItemStack ci = entityplayer.inventory.getCurrentItem();
    if(LiquidContainerRegistry.isEmptyContainer(ci))
    {
      for(ILiquidTank tank : itcb.getTanks(ForgeDirection.UNKNOWN))
      {
        LiquidStack tankLiquid = tank.getLiquid();
        ItemStack filledBucket = LiquidContainerRegistry.fillLiquidContainer(tankLiquid, ci);
        if(LiquidContainerRegistry.isFilledContainer(filledBucket))
        {
          LiquidStack bucketLiquid = LiquidContainerRegistry.getLiquidForFilledItem(filledBucket);
          if(entityplayer.capabilities.isCreativeMode)
          {
            tank.drain(bucketLiquid.amount, true);
            return true;
          }
View Full Code Here


 
  public static void pumpLiquid(ILiquidTank tank, TileEntityFactory from)
  {
    if(tank != null && tank.getLiquid() != null && tank.getLiquid().amount > 0)
    {
      LiquidStack l = tank.getLiquid().copy();
      l.amount = Math.min(l.amount, LiquidContainerRegistry.BUCKET_VOLUME);
      for(BlockPosition adj : new BlockPosition(from).getAdjacent(true))
      {
        TileEntity tile = from.worldObj.getBlockTileEntity(adj.x, adj.y, adj.z);
        if(tile instanceof ITankContainer)
View Full Code Here

      setWorkDone(getWorkDone() + 1);
      if(getWorkDone() >= getWorkMax())
      {
        if(bgb.getFloatTemperature() >= 0.15F)
        {
          if(_tank.fill(new LiquidStack(Block.waterStill.blockID, LiquidContainerRegistry.BUCKET_VOLUME), true) > 0)
          {
            setWorkDone(0);
            return true;
          }
          else
View Full Code Here

  @Override
  public int fill(ForgeDirection from, LiquidStack resource, boolean doFill)
  {
    if(resource == null || resource.amount == 0) return 0;
   
    LiquidStack converted = unifierTransformLiquid(resource, doFill);
   
    if(converted == null || converted.amount == 0) return 0;
   
    int filled = _tank.fill(converted, doFill);
   
View Full Code Here

  private LiquidStack unifierTransformLiquid(LiquidStack resource, boolean doFill)
  {
    if(_ethanol != null && _biofuel != null &&
        resource.itemID == _ethanol.itemID && resource.itemMeta == _ethanol.itemMeta)
    {
      return new LiquidStack(_biofuel.itemID, resource.amount, _biofuel.itemMeta);
    }
    else if(_ethanol != null && _biofuel != null &&
        resource.itemID == _biofuel.itemID && resource.itemMeta == _biofuel.itemMeta)
    {
      return new LiquidStack(_ethanol.itemID, resource.amount, _ethanol.itemMeta);
    }
    else if(_essence != null && _liquidxp != null &&
        resource.itemID == _essence.itemID && resource.itemMeta == _essence.itemMeta)
    {
      return new LiquidStack(_liquidxp.itemID, resource.amount * 2, _liquidxp.itemMeta);
    }
    else if(_essence != null && _liquidxp != null &&
        resource.itemID == _liquidxp.itemID && resource.itemMeta == _liquidxp.itemMeta)
    {
      if(doFill)
      {
        _roundingCompensation ^= (resource.amount & 1);
      }
      return new LiquidStack(_essence.itemID, resource.amount / 2 + (resource.amount & _roundingCompensation), _essence.itemMeta);
    }
   
    return null;
  }
View Full Code Here

  }
 
  @PostInit
  public void postInit(FMLPostInitializationEvent evt)
  {
    LiquidContainerRegistry.registerLiquid(new LiquidContainerData(LiquidDictionary.getOrCreateLiquid("milk", new LiquidStack(milkLiquid, LiquidContainerRegistry.BUCKET_VOLUME)), new ItemStack(Item.bucketMilk), new ItemStack(Item.bucketEmpty)));
    LiquidContainerRegistry.registerLiquid(new LiquidContainerData(LiquidDictionary.getOrCreateLiquid("sludge", new LiquidStack(sludgeLiquid, LiquidContainerRegistry.BUCKET_VOLUME)), new ItemStack(sludgeBucketItem), new ItemStack(Item.bucketEmpty)));
    LiquidContainerRegistry.registerLiquid(new LiquidContainerData(LiquidDictionary.getOrCreateLiquid("sewage", new LiquidStack(sewageLiquid, LiquidContainerRegistry.BUCKET_VOLUME)), new ItemStack(sewageBucketItem), new ItemStack(Item.bucketEmpty)));
    LiquidContainerRegistry.registerLiquid(new LiquidContainerData(LiquidDictionary.getOrCreateLiquid("mobEssence", new LiquidStack(essenceLiquid, LiquidContainerRegistry.BUCKET_VOLUME)), new ItemStack(mobEssenceBucketItem), new ItemStack(Item.bucketEmpty)));
    LiquidContainerRegistry.registerLiquid(new LiquidContainerData(LiquidDictionary.getOrCreateLiquid("biofuel", new LiquidStack(biofuelLiquid, LiquidContainerRegistry.BUCKET_VOLUME)), new ItemStack(bioFuelBucketItem), new ItemStack(Item.bucketEmpty)));
    LiquidContainerRegistry.registerLiquid(new LiquidContainerData(LiquidDictionary.getOrCreateLiquid("meat", new LiquidStack(meatLiquid, LiquidContainerRegistry.BUCKET_VOLUME)), new ItemStack(meatBucketItem), new ItemStack(Item.bucketEmpty)));
    LiquidContainerRegistry.registerLiquid(new LiquidContainerData(LiquidDictionary.getOrCreateLiquid("pinkslime", new LiquidStack(pinkSlimeLiquid, LiquidContainerRegistry.BUCKET_VOLUME)), new ItemStack(pinkSlimeBucketItem), new ItemStack(Item.bucketEmpty)));
    LiquidContainerRegistry.registerLiquid(new LiquidContainerData(LiquidDictionary.getOrCreateLiquid("chocolatemilk", new LiquidStack(chocolateMilkLiquid, LiquidContainerRegistry.BUCKET_VOLUME)), new ItemStack(chocolateMilkBucketItem), new ItemStack(Item.bucketEmpty)));
    LiquidContainerRegistry.registerLiquid(new LiquidContainerData(LiquidDictionary.getOrCreateLiquid("mushroomsoup", new LiquidStack(mushroomSoupLiquid, LiquidContainerRegistry.BUCKET_VOLUME)), new ItemStack(mushroomSoupBucketItem), new ItemStack(Item.bucketEmpty)));
   
    LiquidContainerRegistry.registerLiquid(new LiquidContainerData(LiquidDictionary.getOrCreateLiquid("mushroomsoup", new LiquidStack(mushroomSoupLiquid, LiquidContainerRegistry.BUCKET_VOLUME)), new ItemStack(Item.bowlSoup), new ItemStack(Item.bowlEmpty)));
   
    TileEntityUnifier.updateUnifierLiquids();
   
    for(ItemStack s : OreDictionary.getOres("itemRubber"))
    {
View Full Code Here

      if (ret == null)
      {
        item.setItemDamage(0);
        return super.getItemDisplayName(item);
      }
      LiquidStack liquid = LiquidDictionary.getLiquid(ret, 0);
      if (liquid != null)
      {
        ItemStack q = liquid.asItemStack();
        Item temp = Item.itemsList[q.itemID];
        if (temp != null) ret = temp.getItemDisplayName(q);
      }
      _prefix = true;
      t = super.getItemDisplayName(item);
View Full Code Here

      drops.add(new ItemStack(Item.bucketMilk));
      rancher.decrStackSize(bucketIndex, 1);
    }
    else
    {
      LiquidStack milk = LiquidDictionary.getLiquid("milk", 1000);
      drops.add(new ItemStack(milk.itemID, 1, milk.itemMeta));
    }
   
    return drops;
  }
View Full Code Here

      drops.add(new ItemStack(Item.bucketMilk));
      rancher.setInventorySlotContents(bucketIndex, null);
    }
    else
    {
      LiquidStack soup = LiquidDictionary.getLiquid("mushroomsoup", 1000);
      drops.add(new ItemStack(soup.itemID, 1, soup.itemMeta));
    }
   
    return drops;
  }
View Full Code Here

    fontRenderer.drawString("Output", 128, 26, 4210752);
   
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    for(int i = 0; i < 9; i++)
    {
      LiquidStack l = _crafter.getTanks(ForgeDirection.UNKNOWN)[i].getLiquid();
      if(l != null)
      {
        drawTank(-50 + (i % 3 * 18), 43 + (i / 3 * 35),  l.itemID, l.itemMeta, l.amount * 33 / _crafter.getTanks(ForgeDirection.UNKNOWN)[i].getCapacity());
      }
    }
View Full Code Here

TOP

Related Classes of net.minecraftforge.liquids.LiquidStack

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.