Class StonecutterScreen

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

@Environment(CLIENT)
public class StonecutterScreen
extends HandledScreen<StonecutterScreenHandler>
  • Field Details

    • TEXTURE

      private static final Identifier TEXTURE
    • scrollAmount

      private float scrollAmount
    • mouseClicked

      private boolean mouseClicked
    • scrollOffset

      private int scrollOffset
    • canCraft

      private boolean canCraft
  • 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<StonecutterScreenHandler>
    • drawBackground

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

      protected void drawMouseoverTooltip​(MatrixStack matrices, int x, int y)
      Overrides:
      drawMouseoverTooltip in class HandledScreen<StonecutterScreenHandler>
    • renderRecipeBackground

      private void renderRecipeBackground​(MatrixStack matrixStack, int int2, int int3, int int4, int int5, int int6)
    • renderRecipeIcons

      private void renderRecipeIcons​(int x, int y, int scrollOffset)
    • 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<StonecutterScreenHandler>
      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<StonecutterScreenHandler>
      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)
    • shouldScroll

      private boolean shouldScroll()
    • getMaxScroll

      protected int getMaxScroll()
    • onInventoryChange

      private void onInventoryChange()