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 pGuiGraphics, int pMouseX, int pMouseY, float pPartialTick)
      Renders the graphical user interface (GUI) element.
      Specified by:
      render in interface Renderable
      Overrides:
      render in class AbstractContainerScreen<LoomMenu>
      Parameters:
      pGuiGraphics - the GuiGraphics object used for rendering.
      pMouseX - the x-coordinate of the mouse cursor.
      pMouseY - the y-coordinate of the mouse cursor.
      pPartialTick - the partial tick time.
    • totalRowCount

      private int totalRowCount()
    • renderBg

      protected void renderBg(GuiGraphics pGuiGraphics, float pPartialTick, int pMouseX, int pMouseY)
      Specified by:
      renderBg in class AbstractContainerScreen<LoomMenu>
    • renderPattern

      private void renderPattern(GuiGraphics pGuiGraphics, Holder<BannerPattern> pPatern, int pX, int pY)
    • mouseClicked

      public boolean mouseClicked(double pMouseX, double pMouseY, int pButton)
      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:
      pMouseX - the X coordinate of the mouse.
      pMouseY - the Y coordinate of the mouse.
      pButton - the button that was clicked.
      Returns:
      true if the event is consumed, false otherwise.
    • mouseDragged

      public boolean mouseDragged(double pMouseX, double pMouseY, int pButton, double pDragX, double pDragY)
      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:
      pMouseX - the X coordinate of the mouse.
      pMouseY - the Y coordinate of the mouse.
      pButton - the button that is being dragged.
      pDragX - the X distance of the drag.
      pDragY - the Y distance of the drag.
      Returns:
      true if the event is consumed, false otherwise.
    • mouseScrolled

      public boolean mouseScrolled(double pMouseX, double pMouseY, double pScrollX, double pScrollY)
    • hasClickedOutside

      protected boolean hasClickedOutside(double pMouseX, double pMouseY, int pGuiLeft, int pGuiTop, int pMouseButton)
      Overrides:
      hasClickedOutside in class AbstractContainerScreen<LoomMenu>
    • containerChanged

      private void containerChanged()