Interface RevivalService
clearOverride(ZentrixGame) is called.- Since:
- 1.6.0
-
Method Summary
Modifier and TypeMethodDescriptionvoidclearElimination(@NotNull UUID playerId) voidclearOverride(@NotNull ZentrixGame game) @NotNull Optional<org.bukkit.Location> findSafeLocation(@NotNull org.bukkit.entity.Player reviver) @NotNull List<org.bukkit.entity.Player> getEligibleTeammates(@NotNull ZentrixGame game, @NotNull org.bukkit.entity.Player reviver) @NotNull Optional<EliminationSnapshot> getElimination(@NotNull ZentrixGame game, @NotNull UUID playerId) getOverride(@NotNull ZentrixGame game) booleanisAllowed(@NotNull ZentrixGame game) booleanisReviverEligible(@NotNull ZentrixGame game, @NotNull org.bukkit.entity.Player reviver) booleanisTargetEligible(@NotNull ZentrixGame game, @NotNull org.bukkit.entity.Player reviver, @NotNull org.bukkit.entity.Player target) voidrecordElimination(@NotNull ZentrixGame game, @NotNull org.bukkit.entity.Player player, @Nullable org.bukkit.inventory.ItemStack[] lostLoot) default @NotNull RevivalRestorationrestoreLoadout(@NotNull ZentrixGame game, @NotNull org.bukkit.entity.Player player, @Nullable org.bukkit.inventory.ItemStack[] lostLoot) Restores a player exactly asarena-management.revivalis configured.@NotNull RevivalRestorationrestoreLoadout(@NotNull ZentrixGame game, @NotNull org.bukkit.entity.Player player, @Nullable org.bukkit.inventory.ItemStack[] lostLoot, @NotNull RevivalOptions options) Hands a player back whateverarena-management.revivalallows, without reviving them.default @NotNull RevivalResultrevive(@NotNull ZentrixGame game, @NotNull org.bukkit.entity.Player reviver, @NotNull org.bukkit.entity.Player target) @NotNull RevivalResultrevive(@NotNull ZentrixGame game, @NotNull org.bukkit.entity.Player reviver, @NotNull org.bukkit.entity.Player target, @NotNull RevivalOptions options) voidsetOverride(@NotNull ZentrixGame game, boolean allowed)
-
Method Details
-
isAllowed
-
getOverride
-
setOverride
-
clearOverride
-
recordElimination
void recordElimination(@NotNull @NotNull ZentrixGame game, @NotNull @NotNull org.bukkit.entity.Player player, @Nullable @Nullable org.bukkit.inventory.ItemStack[] lostLoot) -
clearElimination
-
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 whateverarena-management.revivalallows, 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()andRevivalOptions.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 toplayer- the player to restore, already in the matchlostLoot- the inventory they died with, slot by slot; null when nothing was captured, in which case there is no loot to hand backoptions- 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 asarena-management.revivalis configured.
-