Class Slot

    • Field Detail

      • slot

        private final int slot
      • index

        public int index
      • x

        public final int x
      • y

        public final int y
    • Constructor Detail

      • Slot

        public Slot​(IInventory p_i1824_1_,
                    int p_i1824_2_,
                    int p_i1824_3_,
                    int p_i1824_4_)
    • Method Detail

      • onQuickCraft

        public void onQuickCraft​(ItemStack p_75220_1_,
                                 ItemStack p_75220_2_)
      • onQuickCraft

        protected void onQuickCraft​(ItemStack p_75210_1_,
                                    int p_75210_2_)
      • onSwapCraft

        protected void onSwapCraft​(int p_190900_1_)
      • checkTakeAchievements

        protected void checkTakeAchievements​(ItemStack p_75208_1_)
      • mayPlace

        public boolean mayPlace​(ItemStack p_75214_1_)
      • hasItem

        public boolean hasItem()
      • set

        public void set​(ItemStack p_75215_1_)
      • setChanged

        public void setChanged()
      • getMaxStackSize

        public int getMaxStackSize()
      • getMaxStackSize

        public int getMaxStackSize​(ItemStack p_178170_1_)
      • remove

        public ItemStack remove​(int p_75209_1_)
      • mayPickup

        public boolean mayPickup​(PlayerEntity p_82869_1_)
      • isActive

        public boolean isActive()
      • getSlotIndex

        public int getSlotIndex()
        Retrieves the index in the inventory for this slot, this value should typically not be used, but can be useful for some occasions.
        Returns:
        Index in associated inventory for this slot.
      • isSameInventory

        public boolean isSameInventory​(Slot other)
        Checks if the other slot is in the same inventory, by comparing the inventory reference.
        Parameters:
        other -
        Returns:
        true if the other slot is in the same inventory
      • setBackground

        public Slot setBackground​(ResourceLocation atlas,
                                  ResourceLocation sprite)
        Sets the background atlas and sprite location.
        Parameters:
        atlas - The atlas name
        sprite - The sprite located on that atlas.
        Returns:
        this, to allow chaining.