Class DeathScreen

All Implemented Interfaces:
ContainerEventHandler, GuiEventListener, Renderable, TabOrderedElement

public class DeathScreen extends Screen
  • Field Details

    • DRAFT_REPORT_SPRITE

      private static final ResourceLocation DRAFT_REPORT_SPRITE
    • delayTicker

      private int delayTicker
      The integer value containing the number of ticks that have passed since the player's death
    • causeOfDeath

      private final Component causeOfDeath
    • hardcore

      private final boolean hardcore
    • deathScore

      private Component deathScore
    • exitButtons

      private final List<Button> exitButtons
    • exitToTitleButton

      @Nullable private Button exitToTitleButton
  • Constructor Details

    • DeathScreen

      public DeathScreen(@Nullable Component causeOfDeath, boolean hardcore)
  • Method Details

    • init

      protected void init()
      Overrides:
      init in class Screen
    • shouldCloseOnEsc

      public boolean shouldCloseOnEsc()
      Overrides:
      shouldCloseOnEsc in class Screen
    • handleExitToTitleScreen

      private void handleExitToTitleScreen()
    • exitToTitleScreen

      private void exitToTitleScreen()
    • 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 Screen
      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.
    • renderBackground

      public void renderBackground(GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTick)
      Overrides:
      renderBackground in class Screen
    • renderDeathBackground

      static void renderDeathBackground(GuiGraphics guiGraphics, int width, int height)
    • getClickedComponentStyleAt

      @Nullable private Style getClickedComponentStyleAt(int x)
    • mouseClicked

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

      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.
    • isPauseScreen

      public boolean isPauseScreen()
      Overrides:
      isPauseScreen in class Screen
    • tick

      public void tick()
      Overrides:
      tick in class Screen
    • setButtonsActive

      private void setButtonsActive(boolean active)