Package net.minecraft.src

Examples of net.minecraft.src.Slot


        }
    for(int a = 0; a < 2; a++)
        {
          for(int i = 0; i < 9; i++)
            {
                addSlot(new Slot(theTile, i + (a*9), 8 + i * 18, 112 + (18*a)));
            }
        }

        for(int j = 0; j < 3; j++)
        {
            for(int i1 = 0; i1 < 9; i1++)
            {
                addSlot(new Slot(thePlayer.inventory, i1 + j * 9 + 9, 8 + i1 * 18, 152 + j * 18));
            }
        }
       
        for(int i3 = 0; i3 < 9; i3++)
        {
            addSlot(new Slot(thePlayer.inventory, i3, 8 + i3 * 18, 211));
        }
       
       
        if (mod_CraftingTableIII.RecipeType == 0)
        {
View Full Code Here


            j = 0;
       
        for(int k = 0; k < 5; k++) {
            for(int l = 0; l < 8; l++) {
                int i1 = l + (k + j) * 8;
                Slot slot = (Slot)inventorySlots.get(l + k * 8);
                if(i1 >= 0 && i1 < numberOfRecipes) {
                  ItemStack recipeOutput = craftableRecipes.getRecipeOutput(i1);
                  if(recipeOutput != null) {
                    inventory.setInventorySlotContents(l + k * 8, recipeOutput);
                      if(slot instanceof SlotClevercraft) {
View Full Code Here

        }
  }
  public ItemStack transferStackInSlot(int par1)
    {
        ItemStack var2 = null;
        Slot var3 = (Slot)this.inventorySlots.get(par1);

        if (var3 != null && var3.getHasStack())
        {
            ItemStack var4 = var3.getStack();
            var2 = var4.copy();

            if (par1 < 58 && par1 > 39)
            {
                if (!this.mergeItemStack(var4, 58, 94, true))
                {
                    return null;
                }
            }
            else if (par1 > 57)
              if (!this.mergeItemStack(var4, 40, 58, false))
              {
                  return null;
              }

            if (var4.stackSize == 0)
            {
                var3.putStack((ItemStack)null);
            }
            else
            {
                var3.onSlotChanged();
            }
        }

        return var2;
    }
View Full Code Here

                if (!chestAlgorithmButtonDown) {
                    chestAlgorithmButtonDown = true;

                    InvTweaksContainerManager containerMgr = new InvTweaksContainerManager(mc);
          Slot slotAtMousePosition = containerMgr.getSlotAtMousePosition();
                    InvTweaksContainerSection target = null;
                    if (slotAtMousePosition != null) {
                      target = containerMgr.getSlotSection(getSlotNumber(slotAtMousePosition));
                    }
View Full Code Here

    public ShortcutConfig computeShortcutToTrigger() {
        updatePressedKeys();
   
        // Init
        container = new InvTweaksContainerManager(mc);
        Slot slot = container.getSlotAtMousePosition();
        ShortcutConfig shortcutConfig = new ShortcutConfig();
       
        // If a valid and not empty slot is clicked
        if (slot != null && (hasStack(slot) || getHeldStack() != null)) {
            int slotNumber = getSlotNumber(slot);
View Full Code Here

    }

    private void runShortcut(ShortcutConfig shortcut) throws TimeoutException {
        // Try to put held item down
        if (getHeldStack() != null) {
            Slot slot = container.getSlotAtMousePosition();
            if (slot != null) {
                int slotNumber = getSlotNumber(slot);
                container.putHoldItemDown(container.getSlotSection(slotNumber), container.getSlotIndex(slotNumber));
                if (getHeldStack() != null) {
                    return;
                }
            }
            else {
                return;
            }
        }
       
        synchronized(this) {
            if (shortcut.type == InvTweaksShortcutType.MOVE_TO_SPECIFIC_HOTBAR_SLOT) {
                container.move(shortcut.fromSection, shortcut.fromIndex, shortcut.toSection, shortcut.toIndex);
            }
            else {
               
                int toIndex = getNextTargetIndex(shortcut);
                boolean success;
                int newIndex;
               
                if (toIndex != -1) {
                    switch (shortcut.type) {
                   
                    case MOVE_ONE_STACK:
                    {
                        Slot slot = container.getSlot(shortcut.fromSection, shortcut.fromIndex);
                        if (shortcut.fromSection != InvTweaksContainerSection.CRAFTING_OUT
                                && shortcut.toSection != InvTweaksContainerSection.ENCHANTMENT) {
                            while (hasStack(slot) && toIndex != -1) {
                                success = container.move(shortcut.fromSection, shortcut.fromIndex, shortcut.toSection, toIndex);
                                newIndex = getNextTargetIndex(shortcut);
View Full Code Here

      // Copied from GuiContainer
      if (guiContainer != null) {
          int x = getMouseX();
          int y = getMouseY();
        for (int k = 0; k < getSlots(getContainer(guiContainer)).size(); k++) {
          Slot slot = (Slot) getSlots(getContainer(guiContainer)).get(k);
            if (getIsMouseOverSlot(slot, x, y)) {
                return slot;
            }
        }
        return null;
View Full Code Here

    private int indexToSlot(InvTweaksContainerSection section, int index) {
        if (index == DROP_SLOT) {
            return DROP_SLOT;
        }
        if (hasSection(section)) {
            Slot slot = slotRefs.get(section).get(index);
            if (slot != null) {
                return getSlotNumber(slot);
            }
            else {
                return -1;
View Full Code Here

        this.filterIInventory = filterInventory;

        int k = 0;

        for(int j1 = 0; j1 < 9; j1++) {
            addSlot(new Slot(filterInventory, j1 + k * 9, 8 + j1 * 18, 18 + k * 18));
        }


        for(int l = 0; l < 3; l++) {
            for(int k1 = 0; k1 < 9; k1++) {
                addSlot(new Slot(playerInventory, k1 + l * 9 + 9, 8 + k1 * 18, 76 + l * 18));
            }

        }

        for(int i1 = 0; i1 < 9; i1++) {
            addSlot(new Slot(playerInventory, i1, 8 + i1 * 18, 134));
        }
    }
View Full Code Here

TOP

Related Classes of net.minecraft.src.Slot

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.