Class LoomMenu


public class LoomMenu extends AbstractContainerMenu
  • Field Details

    • PATTERN_NOT_SET

      private static final int PATTERN_NOT_SET
      See Also:
    • INV_SLOT_START

      private static final int INV_SLOT_START
      See Also:
    • INV_SLOT_END

      private static final int INV_SLOT_END
      See Also:
    • USE_ROW_SLOT_START

      private static final int USE_ROW_SLOT_START
      See Also:
    • USE_ROW_SLOT_END

      private static final int USE_ROW_SLOT_END
      See Also:
    • access

      private final ContainerLevelAccess access
    • selectedBannerPatternIndex

      private final DataSlot selectedBannerPatternIndex
    • selectablePatterns

      private List<Holder<BannerPattern>> selectablePatterns
    • slotUpdateListener

      private Runnable slotUpdateListener
    • patternGetter

      private final HolderGetter<BannerPattern> patternGetter
    • bannerSlot

      private final Slot bannerSlot
    • dyeSlot

      private final Slot dyeSlot
    • patternSlot

      private final Slot patternSlot
    • resultSlot

      private final Slot resultSlot
    • lastSoundTime

      private long lastSoundTime
    • inputContainer

      private final Container inputContainer
    • outputContainer

      private final Container outputContainer
  • Constructor Details

  • Method Details

    • isPatternItem

      private static boolean isPatternItem(ItemStack itemStack)
    • isDyeItem

      private static boolean isDyeItem(ItemStack itemStack)
    • stillValid

      public boolean stillValid(Player player)
      Determines whether supplied player can use this container
      Specified by:
      stillValid in class AbstractContainerMenu
    • clickMenuButton

      public boolean clickMenuButton(Player player, int buttonId)
      Handles the given Button-click on the server, currently only used by enchanting. Name is for legacy.
      Overrides:
      clickMenuButton in class AbstractContainerMenu
    • getSelectablePatterns

      private List<Holder<BannerPattern>> getSelectablePatterns(ItemStack patternStack)
    • isValidPatternIndex

      private boolean isValidPatternIndex(int selectedPattern)
    • slotsChanged

      public void slotsChanged(Container container)
      Callback for when the crafting matrix is changed.
      Overrides:
      slotsChanged in class AbstractContainerMenu
    • getSelectablePatterns

      public List<Holder<BannerPattern>> getSelectablePatterns()
    • getSelectedBannerPatternIndex

      public int getSelectedBannerPatternIndex()
    • registerUpdateListener

      public void registerUpdateListener(Runnable slotUpdateListener)
    • quickMoveStack

      public ItemStack quickMoveStack(Player player, int slotIndex)
      Handle when the stack in slot index is shift-clicked. Normally this moves the stack between the player inventory and the other inventory(s).
      Specified by:
      quickMoveStack in class AbstractContainerMenu
    • removed

      public void removed(Player player)
      Called when the container is closed.
      Overrides:
      removed in class AbstractContainerMenu
    • setupResultSlot

      private void setupResultSlot(Holder<BannerPattern> pattern)
      Creates an output banner ItemStack based on the patterns, dyes, etc. in the loom.
    • getBannerSlot

      public Slot getBannerSlot()
    • getDyeSlot

      public Slot getDyeSlot()
    • getPatternSlot

      public Slot getPatternSlot()
    • getResultSlot

      public Slot getResultSlot()