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 pCauseOfDeath, boolean pHardcore)
  • 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 pGuiGraphics, int pMouseX, int pMouseY, float pPartialTick)
      Renders the graphical user interface (GUI) element.
      Specified by:
      render in interface Renderable
      Overrides:
      render in class Screen
      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.
    • renderBackground

      public void renderBackground(GuiGraphics pGuiGraphics, int pMouseX, int pMouseY, float pPartialTick)
      Overrides:
      renderBackground in class Screen
    • renderDeathBackground

      static void renderDeathBackground(GuiGraphics pGuiGraphics, int pWidth, int pHeight)
    • getClickedComponentStyleAt

      @Nullable private Style getClickedComponentStyleAt(int pX)
    • mouseClicked

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

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

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

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

      private void setButtonsActive(boolean pActive)