Class RespawnPage


Respawn Page

An interactive custom UI specifically for the respawning of the player. Its note bar can show the personal hardcore lives the player has left. With a permadeath message it is instead the dismissable death screen for a player already converted to their death gamemode type: the note bar shows the message and the respawn button becomes a spectate button that just closes the page.

  • Method Details

    • forRespawn

      @Nonnull public static RespawnPage forRespawn(@Nonnull PlayerRef playerRef, @Nullable Message deathReason, boolean displayDataOnDeathScreen, DeathItemLoss deathItemLoss, int livesRemaining)
      Creates the death screen for the normal respawn flow. A positive livesRemaining shows the hardcore lives the player has left in the note bar.
      Parameters:
      playerRef - The player affiliated with the respawn page
      deathReason - The reason in which the player died
      displayDataOnDeathScreen - Whether to display the data on the death screen
      deathItemLoss - The data related to the items lost on death
      livesRemaining - The hardcore lives the player has left, or 0 for no note
    • forPermadeath

      @Nonnull public static RespawnPage forPermadeath(@Nonnull PlayerRef playerRef, @Nullable Message deathReason, boolean displayDataOnDeathScreen, DeathItemLoss deathItemLoss, @Nonnull Message permadeathMessage)
      Creates the dismissable death screen for a player already converted to their death gamemode type: the note bar shows the message and the respawn button becomes a spectate button.
      Parameters:
      playerRef - The player affiliated with the respawn page
      deathReason - The reason in which the player died
      displayDataOnDeathScreen - Whether to display the data on the death screen
      deathItemLoss - The data related to the items lost on death
      permadeathMessage - The permadeath note
    • build

      public void build(@Nonnull Ref<EntityStore> ref, @Nonnull UICommandBuilder commandBuilder, @Nonnull UIEventBuilder eventBuilder, @Nonnull Store<EntityStore> store)
      Description copied from class: CustomUIPage
      Called to build this page
      Specified by:
      build in class CustomUIPage
      Parameters:
      ref - The entity ref of the affiliated player
      commandBuilder - The command builder used while building this UI
      eventBuilder - The event builder used while building this UI
      store - The entity store for component access
    • handleDataEvent

      public void handleDataEvent(@Nonnull Ref<EntityStore> ref, @Nonnull Store<EntityStore> store, @Nonnull RespawnPage.RespawnPageEventData data)
      Description copied from class: InteractiveCustomUIPage
      Called to handle a data event for this page
      Overrides:
      handleDataEvent in class InteractiveCustomUIPage<RespawnPage.RespawnPageEventData>
      Parameters:
      ref - The entity reference of the affiliated entity
      store - The entity store for component access
      data - The data event to handle
    • onDismiss

      public void onDismiss(@Nonnull Ref<EntityStore> ref, @Nonnull Store<EntityStore> store)
      Description copied from class: CustomUIPage
      Called when this page is dismissed
      Overrides:
      onDismiss in class CustomUIPage