Examples of Slot


Examples of net.minecraft.inventory.Slot

     */
    @Override
    public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, 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 > 5)
            {
                if (var4.getItem() instanceof IItemElectric)
                {
                    float max = ((IItemElectric) var4.getItem()).getMaxElectricityStored(var2);
                    if (((IItemElectric) var4.getItem()).discharge(var2, max / 2, false) > 0)
                    {
                        if (!this.mergeItemStack(var4, 1, 1, false))
                            return null;
                    }
                    else
                    {
                        if (!this.mergeItemStack(var4, 0, 0, false))
                            return null;
                    }
                }
                else if (var4.getItem() instanceof IModifier)
                {
                    if (!this.mergeItemStack(var4, 2, 4, false))
                        return null;
                }
                else if (var4.getItem() instanceof ItemLinkCard)
                    if (!this.mergeItemStack(var4, 5, 5, false))
                        return null;
            }
            else if (!this.mergeItemStack(var4, 6, 38, false))
                return null;
           
            if (var4.stackSize == 0)
            {
                var3.putStack((ItemStack) null);
            }
            else
            {
                var3.onSlotChanged();
            }
           
            if (var4.stackSize == var2.stackSize)
                return null;
           
            var3.onPickupFromSlot(par1EntityPlayer, var4);
        }
       
        return var2;
    }
View Full Code Here

Examples of net.minecraft.inventory.Slot

    {
        this.tileEntity = tileEntity;
        this.addSlotToContainer(new SlotUniversalElectricItem(tileEntity, 0, 55, 49)); // Electric
                                                                                       // Input
                                                                                       // Slot
        this.addSlotToContainer(new Slot(tileEntity, 1, 55, 25)); // To be
                                                                  // processed
        this.addSlotToContainer(new SlotSpecific(tileEntity, 2, 108, 25, (ItemStack) null)); // Process
                                                                                             // result
       
        int var3;
       
        for (var3 = 0; var3 < 3; ++var3)
        {
            for (int var4 = 0; var4 < 9; ++var4)
            {
                this.addSlotToContainer(new Slot(par1InventoryPlayer, var4 + var3 * 9 + 9, 8 + var4 * 18, 84 + var3 * 18));
            }
        }
        for (var3 = 0; var3 < 9; ++var3)
        {
            this.addSlotToContainer(new Slot(par1InventoryPlayer, var3, 8 + var3 * 18, 142));
        }
        tileEntity.openChest();
    }
View Full Code Here

Examples of net.minecraft.inventory.Slot

     */
    @Override
    public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, 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 == 2)
            {
                if (!this.mergeItemStack(var4, 3, 39, true))
                    return null;
               
                var3.onSlotChange(var4, var2);
            }
            else if (par1 != 1 && par1 != 0)
            {
                if (var4.getItem() instanceof IItemElectric)
                {
                    if (!this.mergeItemStack(var4, 0, 1, false))
                        return null;
                }
                else if (InsulationRecipes.INSTANCE.getProcessResult(var4) > 0)
                {
                    if (!this.mergeItemStack(var4, 1, 2, false))
                        return null;
                }
                else if (par1 >= 3 && par1 < 30)
                {
                    if (!this.mergeItemStack(var4, 30, 39, false))
                        return null;
                }
                else if (par1 >= 30 && par1 < 39 && !this.mergeItemStack(var4, 3, 30, false))
                    return null;
            }
            else if (!this.mergeItemStack(var4, 3, 39, false))
                return null;
           
            if (var4.stackSize == 0)
            {
                var3.putStack((ItemStack) null);
            }
            else
            {
                var3.onSlotChanged();
            }
           
            if (var4.stackSize == var2.stackSize)
                return null;
           
            var3.onPickupFromSlot(par1EntityPlayer, var4);
        }
       
        return var2;
    }
View Full Code Here

Examples of net.minecraft.inventory.Slot

  }

  @Override
  public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) {
    ItemStack var3 = null;
    Slot var4 = (Slot) inventorySlots.get(par2);

    if (var4 != null && var4.getHasStack()) {
      ItemStack var5 = var4.getStack();

      if (par2 == 0 || var5 != null && slot.isItemValid(var5)) {
        var3 = var5.copy();

        if (par2 < 1) {
          if (!mergeItemStack(var5, 1, 37, false))
            return null;
        } else if (!mergeItemStack(var5, 0, 1, false))
          return null;

        if (var5.stackSize == 0)
          var4.putStack(null);
        else
          var4.onSlotChanged();

        if (var5.stackSize == var3.stackSize)
          return null;

        var4.onPickupFromSlot(par1EntityPlayer, var5);
      }
    }

    return var3;
  }
View Full Code Here

Examples of net.minecraft.inventory.Slot

  }

  @Override
  public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) {
    ItemStack var3 = null;
    Slot var4 = (Slot) inventorySlots.get(par2);

    if (var4 != null && var4.getHasStack()) {
      ItemStack var5 = var4.getStack();

      if (var5 != null && var5.getItem() == Items.book)
        return null;

      boolean wand = ((Slot) inventorySlots.get(1)).isItemValid(var5);

      //noinspection ConstantConditions
      var3 = var5.copy();

      if (par2 < 2) {
        if (!mergeItemStack(var5, 2, 38, false))
          return null;
      } else if (wand ? !mergeItemStack(var5, 1, 2, false) : var5.getItem().isItemTool(var5) && !mergeItemStack(var5, 0, 1, false))
        return null;

      if (var5.stackSize == 0)
        var4.putStack(null);
      else
        var4.onSlotChanged();

      if (var5.stackSize == var3.stackSize)
        return null;

      var4.onPickupFromSlot(par1EntityPlayer, var5);
    }

    return var3;
  }
View Full Code Here

Examples of net.minecraft.inventory.Slot

    public ContainerRemotePlacer(TileRPlacer placer, InventoryPlayer playerInv) {
        super(playerInv);

        this.placer=placer;

        addSlotToContainer(new Slot(placer, 0, 20, 30));

        initPlayerInv();
    }
View Full Code Here

Examples of net.minecraft.inventory.Slot

    }

    @Override
    public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) {
        ItemStack var3 = null;
        Slot var4 = (Slot) inventorySlots.get(par2);

        if (var4 != null && var4.getHasStack()) {
            ItemStack var5 = var4.getStack();

            var3 = var5.copy();

            if (par2 < 1) {
                if (!mergeItemStack(var5, 1, 37, false))
                    return null;
            } else if (!mergeItemStack(var5, 0, 1, false))
                return null;

            if (var5.stackSize == 0)
                var4.putStack(null);
            else
                var4.onSlotChanged();

            if (var5.stackSize == var3.stackSize)
                return null;

            var4.onPickupFromSlot(par1EntityPlayer, var5);
        }

        return var3;
    }
View Full Code Here

Examples of net.minecraft.inventory.Slot

  public ContainerAnimationTablet(TileAnimationTablet tablet, InventoryPlayer playerInv) {
    super(playerInv);

    this.tablet = tablet;

    addSlotToContainer(new Slot(tablet, 0, 80, 15));

    initPlayerInv();
  }
View Full Code Here

Examples of net.minecraft.inventory.Slot

  }

  @Override
  public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) {
    ItemStack var3 = null;
    Slot var4 = (Slot) inventorySlots.get(par2);

    if (var4 != null && var4.getHasStack()) {
      ItemStack var5 = var4.getStack();

      var3 = var5.copy();

      if (par2 < 1) {
        if (!mergeItemStack(var5, 1, 37, false))
          return null;
      } else if (!mergeItemStack(var5, 0, 1, false))
        return null;

      if (var5.stackSize == 0)
        var4.putStack(null);
      else
        var4.onSlotChanged();

      if (var5.stackSize == var3.stackSize)
        return null;

      var4.onPickupFromSlot(par1EntityPlayer, var5);
    }

    return var3;
  }
View Full Code Here

Examples of net.minecraft.inventory.Slot

    int ys = getInvYStart();
    int xs = getInvXStart();

    for (int x = 0; x < 3; ++x)
      for (int y = 0; y < 9; ++y)
        addSlotToContainer(new Slot(playerInv, y + x * 9 + 9, xs + y * 18, ys + x * 18));

    for (int x = 0; x < 9; ++x)
      addSlotToContainer(new Slot(playerInv, x, xs + x * 18, ys + 58));
  }
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.