Interface RevivalService


public interface RevivalService
Teammate revival state and operations. Methods touching players or locations must be called on the Bukkit main thread. An API override takes precedence over every later phase toggle until clearOverride(ZentrixGame) is called.
Since:
1.6.0
  • Method Details

    • isAllowed

      boolean isAllowed(@NotNull @NotNull ZentrixGame game)
    • getOverride

      @NotNull @NotNull Optional<Boolean> getOverride(@NotNull @NotNull ZentrixGame game)
    • setOverride

      void setOverride(@NotNull @NotNull ZentrixGame game, boolean allowed)
    • clearOverride

      void clearOverride(@NotNull @NotNull ZentrixGame game)
    • recordElimination

      void recordElimination(@NotNull @NotNull ZentrixGame game, @NotNull @NotNull org.bukkit.entity.Player player, @Nullable @Nullable org.bukkit.inventory.ItemStack[] lostLoot)
    • clearElimination

      void clearElimination(@NotNull @NotNull UUID playerId)
    • getElimination

      @NotNull @NotNull Optional<EliminationSnapshot> getElimination(@NotNull @NotNull ZentrixGame game, @NotNull @NotNull UUID playerId)
    • getEligibleTeammates

      @NotNull @NotNull List<org.bukkit.entity.Player> getEligibleTeammates(@NotNull @NotNull ZentrixGame game, @NotNull @NotNull org.bukkit.entity.Player reviver)
    • isReviverEligible

      boolean isReviverEligible(@NotNull @NotNull ZentrixGame game, @NotNull @NotNull org.bukkit.entity.Player reviver)
    • isTargetEligible

      boolean isTargetEligible(@NotNull @NotNull ZentrixGame game, @NotNull @NotNull org.bukkit.entity.Player reviver, @NotNull @NotNull org.bukkit.entity.Player target)
    • findSafeLocation

      @NotNull @NotNull Optional<org.bukkit.Location> findSafeLocation(@NotNull @NotNull org.bukkit.entity.Player reviver)
    • revive

      @NotNull @NotNull RevivalResult revive(@NotNull @NotNull ZentrixGame game, @NotNull @NotNull org.bukkit.entity.Player reviver, @NotNull @NotNull org.bukkit.entity.Player target, @NotNull @NotNull RevivalOptions options)
    • revive

      @NotNull default @NotNull RevivalResult revive(@NotNull @NotNull ZentrixGame game, @NotNull @NotNull org.bukkit.entity.Player reviver, @NotNull @NotNull org.bukkit.entity.Player target)
    • restoreLoadout

      @NotNull @NotNull RevivalRestoration restoreLoadout(@NotNull @NotNull ZentrixGame game, @NotNull @NotNull org.bukkit.entity.Player player, @Nullable @Nullable org.bukkit.inventory.ItemStack[] lostLoot, @NotNull @NotNull RevivalOptions options)
      Hands a player back whatever arena-management.revival allows, without reviving them.

      This is the restoration half of a revival on its own, for anything that returns a player to a match by its own route — a scenario that takes a death over, a life system, a role that respawns. The player is expected to be in the match already and to have an empty inventory, exactly as a death leaves them.

      The configured options decide what happens, so a mechanic built on this stays in step with the server's revival settings instead of inventing restoration rules of its own. RevivalOptions.restoreClassItems() and RevivalOptions.restoreLostLoot() override the configuration for one call when a caller genuinely needs to; RevivalOptions.destination() is ignored here, because nobody is being moved.

      The lost loot is restored slot by slot where it fits and added or dropped where it does not. The class kit is granted afterwards and only fills what is still free, so the two never fight over the same slots.

      Parameters:
      game - the match the player belongs to
      player - the player to restore, already in the match
      lostLoot - the inventory they died with, slot by slot; null when nothing was captured, in which case there is no loot to hand back
      options - per-call overrides; RevivalOptions.defaults() follows the configuration exactly
      Returns:
      what was handed back
      Since:
      1.6.0
    • restoreLoadout

      @NotNull default @NotNull RevivalRestoration restoreLoadout(@NotNull @NotNull ZentrixGame game, @NotNull @NotNull org.bukkit.entity.Player player, @Nullable @Nullable org.bukkit.inventory.ItemStack[] lostLoot)
      Restores a player exactly as arena-management.revival is configured.