Package net.minecraft.src

Examples of net.minecraft.src.ItemStack


 
  @Override
  public ItemStack decrStackSize(int i, int j) {
    if (itemInInventory != null) {
      ItemStack newStack = itemInInventory.splitStack(j);
      if (itemInInventory.stackSize == 0itemInInventory = null;
      return newStack;
    } else {
      return null;
    }
View Full Code Here


  }

  @Override
  public ItemStack getStackInSlotOnClosing(int var1) {
    if (itemInInventory == null) return null;
    ItemStack toReturn = itemInInventory;
    itemInInventory = null;
    return toReturn;
  }
View Full Code Here

    @Override
    @SuppressWarnings( { "rawtypes", "unchecked" })
    @SideOnly(Side.CLIENT)
    public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) {
        for (UsefullThingsType type : UsefullThingsType.values()) {
            par3List.add(new ItemStack(this, 1, type.ordinal()));
        }
    }
View Full Code Here

 
  @Override
  public ItemStack decrStackSize(int i, int j) {
    if (itemInInventory != null) {
      ItemStack newStack = itemInInventory.splitStack(j);
      if (itemInInventory.stackSize == 0itemInInventory = null;
      return newStack;
    } else {
      return null;
    }
View Full Code Here

  }

  @Override
  public ItemStack getStackInSlotOnClosing(int var1) {
    if (itemInInventory == null) return null;
    ItemStack toReturn = itemInInventory;
    itemInInventory = null;
    return toReturn;
  }
View Full Code Here

                mouseWasDown = true;
            }
            handleShortcuts(guiScreen);

            // Copy some info about current selected stack for auto-refill
            ItemStack currentStack = getFocusedStack();
            storedStackId = (currentStack == null) ? 0 : getItemID(currentStack);
            storedStackDamage = (currentStack == null) ? 0 : getItemDamage(currentStack);
            if(!wasInGUI) {
                wasInGUI = true;
            }
View Full Code Here

            // Find stack slot (look in hotbar only).
            // We're looking for a brand new stack in the hotbar
            // (not an existing stack whose amount has been increased)
            int currentSlot = -1;
            for (int i = 0; i < InvTweaksConst.INVENTORY_HOTBAR_SIZE; i++) {
                ItemStack currentHotbarStack = containerMgr.getItemStack(i + 27);
                // Don't move already started stacks
                if (currentHotbarStack != null && getAnimationsToGo(currentHotbarStack) == 5 && hotbarClone[i] == null) {
                    currentSlot = i + 27;
                }
            }

            if (currentSlot != -1) {
                itemPickupPending = false;

                // Find preffered slots
                List<Integer> prefferedPositions = new LinkedList<Integer>();
                InvTweaksItemTree tree = config.getTree();
                ItemStack stack = containerMgr.getItemStack(currentSlot);
                List<InvTweaksItemTreeItem> items = tree.getItems(getItemID(stack),
                        getItemDamage(stack));
                for (InvTweaksConfigSortingRule rule : config.getRules()) {
                    if (tree.matches(items, rule.getKeyword())) {
                        for (int slot : rule.getPreferredSlots()) {
View Full Code Here

    }

    private void handleSorting(GuiScreen guiScreen) {

        ItemStack selectedItem = null;
        int focusedSlot = getFocusedSlot();
        ItemStack[] mainInventory = getMainInventory();
        if (focusedSlot < mainInventory.length && focusedSlot >= 0) {
            selectedItem = mainInventory[focusedSlot];
        }
View Full Code Here

    }

    private void handleAutoRefill() {

        ItemStack currentStack = getFocusedStack();
        int currentStackId = (currentStack == null) ? 0 : getItemID(currentStack);
        int currentStackDamage = (currentStack == null) ? 0 : getItemDamage(currentStack);
        int focusedSlot = getFocusedSlot() + 27; // Convert to container slots index
        InvTweaksConfig config = cfgManager.getConfig();
View Full Code Here

                    }
                    else if (container.hasSection(InvTweaksContainerSection.FURNACE_IN)) {
                        orderedSections.add(InvTweaksContainerSection.FURNACE_IN);
                    }
                    else if (container.hasSection(InvTweaksContainerSection.BREWING_INGREDIENT)) {
                        ItemStack stack = container.getStack(slot);
                        if (stack != null) {
                            if (getItemID(stack) == 373 /* Water Bottle/Potions */) {
                                orderedSections.add(InvTweaksContainerSection.BREWING_BOTTLES);
                            }
                            else {
View Full Code Here

TOP

Related Classes of net.minecraft.src.ItemStack

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.