Class CreativeModeInventoryScreen.SlotWrapper

java.lang.Object
net.minecraft.world.inventory.Slot
net.minecraft.client.gui.screens.inventory.CreativeModeInventoryScreen.SlotWrapper
Enclosing class:
CreativeModeInventoryScreen

static class CreativeModeInventoryScreen.SlotWrapper extends Slot
  • Field Details

    • target

      final Slot target
  • Constructor Details

    • SlotWrapper

      public SlotWrapper(Slot pSlot, int pIndex, int pX, int pY)
  • Method Details

    • onTake

      public void onTake(Player pPlayer, ItemStack pStack)
      Overrides:
      onTake in class Slot
    • mayPlace

      public boolean mayPlace(ItemStack pStack)
      Check if the stack is allowed to be placed in this slot, used for armor slots as well as furnace fuel.
      Overrides:
      mayPlace in class Slot
    • getItem

      public ItemStack getItem()
      Overrides:
      getItem in class Slot
    • hasItem

      public boolean hasItem()
      Overrides:
      hasItem in class Slot
    • setByPlayer

      public void setByPlayer(ItemStack pNewStack, ItemStack pOldStack)
      Overrides:
      setByPlayer in class Slot
    • set

      public void set(ItemStack pStack)
      Helper method to put a stack in the slot.
      Overrides:
      set in class Slot
    • setChanged

      public void setChanged()
      Overrides:
      setChanged in class Slot
    • getMaxStackSize

      public int getMaxStackSize()
      Overrides:
      getMaxStackSize in class Slot
    • getMaxStackSize

      public int getMaxStackSize(ItemStack pStack)
      Overrides:
      getMaxStackSize in class Slot
    • getNoItemIcon

      @Nullable public com.mojang.datafixers.util.Pair<ResourceLocation,ResourceLocation> getNoItemIcon()
      Overrides:
      getNoItemIcon in class Slot
    • remove

      public ItemStack remove(int pAmount)
      Decrease the size of the stack in slot (first int arg) by the amount of the second int arg. Returns the new stack.
      Overrides:
      remove in class Slot
    • isActive

      public boolean isActive()
      Overrides:
      isActive in class Slot
    • mayPickup

      public boolean mayPickup(Player pPlayer)
      Return whether this slot's stack can be taken from this slot.
      Overrides:
      mayPickup in class Slot
    • getSlotIndex

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

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

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