Package mekanism.common.inventory

Examples of mekanism.common.inventory.InventoryBin


      if(binRenderer == null || binRenderer.func_147498_b()/*getFontRenderer()*/ == null)
      {
        return;
      }

      InventoryBin inv = new InventoryBin(item);
      ForgeDirection side = ForgeDirection.getOrientation(2);

      String amount = "";
      ItemStack itemStack = inv.getStack();

      if(itemStack != null)
      {
        amount = Integer.toString(inv.getItemCount());
      }

      OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240, 240);

      if(itemStack != null)
View Full Code Here


    if(this == Mekanism.BasicBlock)
    {
      if(ret.getItemDamage() == 6)
      {
        TileEntityBin tileEntity = (TileEntityBin)world.getTileEntity(x, y, z);
        InventoryBin inv = new InventoryBin(ret);

        inv.setItemCount(tileEntity.getItemCount());

        if(tileEntity.getItemCount() > 0)
        {
          inv.setItemType(tileEntity.itemType);
        }
      }
    }

    return ret;
View Full Code Here

  @SideOnly(Side.CLIENT)
  public void addInformation(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag)
  {
    if(Block.getBlockFromItem(this) == Mekanism.BasicBlock && itemstack.getItemDamage() == 6)
    {
      InventoryBin inv = new InventoryBin(itemstack);

      if(inv.getItemCount() > 0)
      {
        list.add(EnumColor.BRIGHT_GREEN + inv.getItemType().getDisplayName());
        list.add(EnumColor.INDIGO + "Item amount: " + EnumColor.GREY + inv.getItemCount());
      }
      else {
        list.add(EnumColor.DARK_RED + "Empty");
      }
    }
View Full Code Here

      if(Block.getBlockFromItem(this) == Mekanism.BasicBlock)
      {
        if(stack.getItemDamage() == 6 && stack.stackTagCompound != null)
        {
          TileEntityBin tileEntity = (TileEntityBin)world.getTileEntity(x, y, z);
          InventoryBin inv = new InventoryBin(stack);

          if(inv.getItemType() != null)
          {
            tileEntity.setItemType(inv.getItemType());
          }

          tileEntity.setItemCount(inv.getItemCount());
        }
      }
    }

    return place;
View Full Code Here

        addStack = stack.copy();
      }
    }

    InventoryBin binInv = new InventoryBin(bin);

    if(addStack != null)
    {
      if(binInv.getItemType() != null && !binInv.getItemType().isItemEqual(addStack))
      {
        return null;
      }

      binInv.add(addStack);

      return bin;
    }
    else {
      return binInv.removeStack();
    }
  }
View Full Code Here

        for(int i = 0; i < event.craftMatrix.getSizeInventory(); i++)
        {
          if(isBin(event.craftMatrix.getStackInSlot(i)))
          {
            ItemStack bin = event.craftMatrix.getStackInSlot(i);
            InventoryBin inv = new InventoryBin(bin.copy());

            int size = inv.getItemCount();

            ItemStack testRemove = inv.removeStack();

            bin.stackTagCompound.setInteger("newCount", size-(testRemove != null ? testRemove.stackSize : 0));
          }
        }
      }
      else {
        int bin = -1;
        int other = -1;

        for(int i = 0; i < event.craftMatrix.getSizeInventory(); i++)
        {
          if(isBin(event.craftMatrix.getStackInSlot(i)))
          {
            bin = i;
          }
          else if(!isBin(event.craftMatrix.getStackInSlot(i)) && event.craftMatrix.getStackInSlot(i) != null)
          {
            other = i;
          }
        }

        ItemStack binStack = event.craftMatrix.getStackInSlot(bin);
        ItemStack otherStack = event.craftMatrix.getStackInSlot(other);

        ItemStack testRemain = new InventoryBin(binStack.copy()).add(otherStack.copy());

        if(testRemain != null && testRemain.stackSize > 0)
        {
          ItemStack proxy = new ItemStack(Mekanism.ItemProxy);
          ((ItemProxy)proxy.getItem()).setSavedItem(proxy, testRemain.copy());
View Full Code Here

TOP

Related Classes of mekanism.common.inventory.InventoryBin

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.