Class LoomScreen

All Implemented Interfaces:
ContainerEventHandler, GuiEventListener, Renderable, TabOrderedElement, MenuAccess<LoomMenu>

public class LoomScreen extends AbstractContainerScreen<LoomMenu>
  • Field Details

    • DYE_SLOT_SPRITE

      private static final ResourceLocation DYE_SLOT_SPRITE
    • PATTERN_SLOT_SPRITE

      private static final ResourceLocation PATTERN_SLOT_SPRITE
    • SCROLLER_SPRITE

      private static final ResourceLocation SCROLLER_SPRITE
    • SCROLLER_DISABLED_SPRITE

      private static final ResourceLocation SCROLLER_DISABLED_SPRITE
    • PATTERN_SELECTED_SPRITE

      private static final ResourceLocation PATTERN_SELECTED_SPRITE
    • PATTERN_HIGHLIGHTED_SPRITE

      private static final ResourceLocation PATTERN_HIGHLIGHTED_SPRITE
    • PATTERN_SPRITE

      private static final ResourceLocation PATTERN_SPRITE
    • ERROR_SPRITE

      private static final ResourceLocation ERROR_SPRITE
    • BG_LOCATION

      private static final ResourceLocation BG_LOCATION
    • PATTERN_COLUMNS

      private static final int PATTERN_COLUMNS
      See Also:
    • PATTERN_ROWS

      private static final int PATTERN_ROWS
      See Also:
    • SCROLLER_WIDTH

      private static final int SCROLLER_WIDTH
      See Also:
    • SCROLLER_HEIGHT

      private static final int SCROLLER_HEIGHT
      See Also:
    • PATTERN_IMAGE_SIZE

      private static final int PATTERN_IMAGE_SIZE
      See Also:
    • SCROLLER_FULL_HEIGHT

      private static final int SCROLLER_FULL_HEIGHT
      See Also:
    • PATTERNS_X

      private static final int PATTERNS_X
      See Also:
    • PATTERNS_Y

      private static final int PATTERNS_Y
      See Also:
    • flag

      private ModelPart flag
    • resultBannerPatterns

      @Nullable private BannerPatternLayers resultBannerPatterns
    • bannerStack

      private ItemStack bannerStack
    • dyeStack

      private ItemStack dyeStack
    • patternStack

      private ItemStack patternStack
    • displayPatterns

      private boolean displayPatterns
    • hasMaxPatterns

      private boolean hasMaxPatterns
    • scrollOffs

      private float scrollOffs
    • scrolling

      private boolean scrolling
    • startRow

      private int startRow
  • Constructor Details

  • Method Details

    • init

      protected void init()
      Overrides:
      init in class AbstractContainerScreen<LoomMenu>
    • render

      public void render(GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTick)
      Renders the graphical user interface (GUI) element.
      Specified by:
      render in interface Renderable
      Overrides:
      render in class AbstractContainerScreen<LoomMenu>
      Parameters:
      guiGraphics - the GuiGraphics object used for rendering.
      mouseX - the x-coordinate of the mouse cursor.
      mouseY - the y-coordinate of the mouse cursor.
      partialTick - the partial tick time.
    • totalRowCount

      private int totalRowCount()
    • renderBg

      protected void renderBg(GuiGraphics guiGraphics, float partialTick, int mouseX, int mouseY)
      Specified by:
      renderBg in class AbstractContainerScreen<LoomMenu>
    • renderPattern

      private void renderPattern(GuiGraphics guiGraphics, Holder<BannerPattern> patern, int x, int y)
    • mouseClicked

      public boolean mouseClicked(double mouseX, double mouseY, int button)
      Called when a mouse button is clicked within the GUI element.

      Specified by:
      mouseClicked in interface ContainerEventHandler
      Specified by:
      mouseClicked in interface GuiEventListener
      Overrides:
      mouseClicked in class AbstractContainerScreen<LoomMenu>
      Parameters:
      mouseX - the X coordinate of the mouse.
      mouseY - the Y coordinate of the mouse.
      button - the button that was clicked.
      Returns:
      true if the event is consumed, false otherwise.
    • mouseDragged

      public boolean mouseDragged(double mouseX, double mouseY, int button, double dragX, double dragY)
      Called when the mouse is dragged within the GUI element.

      Specified by:
      mouseDragged in interface ContainerEventHandler
      Specified by:
      mouseDragged in interface GuiEventListener
      Overrides:
      mouseDragged in class AbstractContainerScreen<LoomMenu>
      Parameters:
      mouseX - the X coordinate of the mouse.
      mouseY - the Y coordinate of the mouse.
      button - the button that is being dragged.
      dragX - the X distance of the drag.
      dragY - the Y distance of the drag.
      Returns:
      true if the event is consumed, false otherwise.
    • mouseScrolled

      public boolean mouseScrolled(double mouseX, double mouseY, double scrollX, double scrollY)
    • hasClickedOutside

      protected boolean hasClickedOutside(double mouseX, double mouseY, int guiLeft, int guiTop, int mouseButton)
      Overrides:
      hasClickedOutside in class AbstractContainerScreen<LoomMenu>
    • containerChanged

      private void containerChanged()