Class LoomScreen

All Implemented Interfaces:
Drawable, Element, ParentElement, ScreenHandlerProvider<LoomScreenHandler>, TickableElement

@Environment(CLIENT)
public class LoomScreen
extends HandledScreen<LoomScreenHandler>
  • Field Details

    • TEXTURE

      private static final Identifier TEXTURE
    • PATTERN_BUTTON_ROW_COUNT

      private static final int PATTERN_BUTTON_ROW_COUNT
    • bannerField

      private final ModelPart bannerField
    • field_21841

      @Nullable private List<com.mojang.datafixers.util.Pair<BannerPattern,​DyeColor>> field_21841
    • dye

      private ItemStack dye
    • pattern

      private ItemStack pattern
    • canApplyDyePattern

      private boolean canApplyDyePattern
    • canApplySpecialPattern

      private boolean canApplySpecialPattern
    • hasTooManyPatterns

      private boolean hasTooManyPatterns
    • scrollPosition

      private float scrollPosition
    • scrollbarClicked

      private boolean scrollbarClicked
    • firstPatternButtonId

      private int firstPatternButtonId
  • Constructor Details

  • Method Details

    • render

      public void render​(MatrixStack matrices, int mouseX, int mouseY, float delta)
      Specified by:
      render in interface Drawable
      Overrides:
      render in class HandledScreen<LoomScreenHandler>
    • drawBackground

      protected void drawBackground​(MatrixStack matrices, float delta, int mouseX, int mouseY)
      Specified by:
      drawBackground in class HandledScreen<LoomScreenHandler>
    • method_22692

      private void method_22692​(int int2, int int3, int int4)
    • mouseClicked

      public boolean mouseClicked​(double mouseX, double mouseY, int button)
      Callback for when a mouse button down event has been captured. The button number is identified by the constants in GLFW class.
      Specified by:
      mouseClicked in interface Element
      Specified by:
      mouseClicked in interface ParentElement
      Overrides:
      mouseClicked in class HandledScreen<LoomScreenHandler>
      Parameters:
      mouseX - the X coordinate of the mouse
      mouseY - the Y coordinate of the mouse
      button - the mouse button number
      Returns:
      true to indicate that the event handling is successful/valid
      See Also:
      Mouse.onMouseButton(long, int, int, int), GLFW.GLFW_MOUSE_BUTTON_1
    • mouseDragged

      public boolean mouseDragged​(double mouseX, double mouseY, int button, double deltaX, double deltaY)
      Callback for when a mouse button drag event has been captured. The button number is identified by the constants in GLFW class.
      Specified by:
      mouseDragged in interface Element
      Specified by:
      mouseDragged in interface ParentElement
      Overrides:
      mouseDragged in class HandledScreen<LoomScreenHandler>
      Parameters:
      mouseX - the current X coordinate of the mouse
      mouseY - the current Y coordinate of the mouse
      button - the mouse button number
      deltaX - the difference of the current X with the previous X coordinate
      deltaY - the difference of the current Y with the previous Y coordinate
      Returns:
      true to indicate that the event handling is successful/valid
      See Also:
      Mouse.onCursorPos(long, double, double), GLFW.GLFW_MOUSE_BUTTON_1
    • mouseScrolled

      public boolean mouseScrolled​(double mouseX, double mouseY, double amount)
      Callback for when a mouse button scroll event has been captured.
      Parameters:
      mouseX - the X coordinate of the mouse
      mouseY - the Y coordinate of the mouse
      amount - value is > 1 if scrolled down, < 1 if scrolled up
      Returns:
      true to indicate that the event handling is successful/valid
      See Also:
      Mouse.onMouseScroll(long, double, double)
    • isClickOutsideBounds

      protected boolean isClickOutsideBounds​(double mouseX, double mouseY, int left, int top, int button)
      Overrides:
      isClickOutsideBounds in class HandledScreen<LoomScreenHandler>
    • onInventoryChanged

      private void onInventoryChanged()