Class SessionPlayerLifecycleService

java.lang.Object
dev.deepcore.challenge.session.SessionPlayerLifecycleService

public final class SessionPlayerLifecycleService extends Object
Coordinates player lifecycle events across prep/countdown/run phases.
  • Constructor Details

    • SessionPlayerLifecycleService

      public SessionPlayerLifecycleService(org.bukkit.plugin.java.JavaPlugin plugin, DeepCoreLogger log, ChallengeManager challengeManager, SessionState sessionState, Set<UUID> readyPlayers, Set<UUID> participants, Set<UUID> eliminatedPlayers, Set<UUID> recentlyDeadPlayers, PlayerLobbyStateService playerLobbyStateService, PreviewAnchorService previewAnchorService, PreviewOrchestratorService previewOrchestratorService, WorldClassificationService worldClassificationService, PrepAreaService prepAreaService, PrepBookService prepBookService, PrepGuiCoordinatorService prepGuiCoordinatorService, PrepReadinessService prepReadinessService, RunPauseResumeService runPauseResumeService, RespawnRoutingService respawnRoutingService, SessionFailureService sessionFailureService, RunStatusService runStatusService, SharedInventorySyncService sharedInventorySyncService, BooleanSupplier isSharedInventoryEnabled, Predicate<org.bukkit.entity.Player> isChallengeActive, Supplier<List<org.bukkit.entity.Player>> onlineParticipantsSupplier, Consumer<org.bukkit.entity.Player> enforceInventorySlotCap, Consumer<org.bukkit.entity.Player> clearLockedBarrierSlots, Consumer<org.bukkit.entity.Player> applyInitialHalfHeart, Consumer<org.bukkit.entity.Player> restoreDefaultMaxHealth, Runnable syncWorldRules, Runnable refreshLobbyPreview, Runnable refreshOpenPrepGuis, Runnable startRun, Runnable endChallengeAndReturnToPrep, Runnable syncSharedInventoryFromFirstParticipant, Runnable syncSharedHealthFromFirstParticipant, Runnable syncSharedHungerFromMostFilledParticipant, BooleanSupplier isDiscoPreviewBlockingChallengeStart, Runnable announceDiscoPreviewStartBlocked)
      Creates a session player lifecycle coordination service.
      Parameters:
      plugin - plugin scheduler and lifecycle owner
      log - challenge logger for player/admin messaging
      challengeManager - challenge settings and component manager
      sessionState - mutable session phase/state container
      readyPlayers - players marked ready during prep
      participants - active run participants
      eliminatedPlayers - hardcore-eliminated participants
      recentlyDeadPlayers - recently dead participants for failure checks
      playerLobbyStateService - lobby inventory/gamemode state service
      previewAnchorService - lobby teleport anchor resolver
      previewOrchestratorService - lobby preview orchestration service
      worldClassificationService - world classification helper service
      prepAreaService - prep area border and region service
      prepBookService - prep guide book service
      prepGuiCoordinatorService - prep GUI interaction coordinator
      prepReadinessService - readiness/countdown coordinator service
      runPauseResumeService - pause/resume run coordinator service
      respawnRoutingService - respawn routing service
      sessionFailureService - failure-condition transition service
      runStatusService - run status/timing announcer service
      sharedInventorySyncService - shared inventory synchronization service
      isSharedInventoryEnabled - supplier indicating shared inventory mode
      isChallengeActive - predicate testing participant challenge activity
      onlineParticipantsSupplier - supplier for currently online participants
      enforceInventorySlotCap - consumer applying inventory slot cap
      clearLockedBarrierSlots - consumer clearing locked barrier slots
      applyInitialHalfHeart - consumer applying half-heart health mode
      restoreDefaultMaxHealth - consumer restoring default max health
      syncWorldRules - runnable that reapplies world rule policies
      refreshLobbyPreview - runnable that refreshes lobby preview state
      refreshOpenPrepGuis - runnable that refreshes open prep GUIs
      startRun - runnable that starts a challenge run
      endChallengeAndReturnToPrep - runnable that stops the current challenge and returns to prep
      syncSharedInventoryFromFirstParticipant - runnable syncing shared inventory
      syncSharedHealthFromFirstParticipant - runnable syncing shared health
      syncSharedHungerFromMostFilledParticipant - runnable syncing shared hunger
      isDiscoPreviewBlockingChallengeStart - supplier for disco-start blocking state
      announceDiscoPreviewStartBlocked - runnable announcing disco start block
  • Method Details

    • handlePlayerJoin

      public void handlePlayerJoin(org.bukkit.event.player.PlayerJoinEvent event)
      Handles player joins and applies session-phase specific onboarding state.
      Parameters:
      event - join event for the connected player
    • handlePlayerQuit

      public void handlePlayerQuit(org.bukkit.event.player.PlayerQuitEvent event)
      Handles player quits and updates readiness/countdown or pause state as needed.
      Parameters:
      event - quit event for the disconnecting player
    • handlePlayerDeath

      public void handlePlayerDeath(org.bukkit.event.entity.PlayerDeathEvent event)
      Handles participant death bookkeeping and failure-path transitions.
      Parameters:
      event - death event for a participant
    • handlePlayerRespawn

      public void handlePlayerRespawn(org.bukkit.event.player.PlayerRespawnEvent event)
      Handles participant respawn routing and post-respawn challenge sync actions.
      Parameters:
      event - respawn event for a participant
    • handlePlayerChangedWorld

      public void handlePlayerChangedWorld(org.bukkit.event.player.PlayerChangedWorldEvent event)
      Handles world transitions and updates lobby/run state for the player.
      Parameters:
      event - world-change event for a participant