Class PreviewOrchestratorService

java.lang.Object
dev.deepcore.challenge.preview.PreviewOrchestratorService

public final class PreviewOrchestratorService extends Object
Orchestrates lobby preview lifecycle, build animation, and cleanup.
  • Constructor Details

    • PreviewOrchestratorService

      public PreviewOrchestratorService(org.bukkit.plugin.java.JavaPlugin plugin, ChallengeConfigView configView, PreviewSampleService previewSampleService, PreviewAnchorService previewAnchorService, PreviewRuntimeService previewRuntimeService, PreviewEntityService previewEntityService, Supplier<WorldResetManager> worldResetManagerSupplier, BooleanSupplier runningPhaseSupplier)
      Creates the preview orchestrator service.
      Parameters:
      plugin - plugin scheduler and lifecycle owner
      configView - challenge config value accessor
      previewSampleService - preview terrain sample generator
      previewAnchorService - preview anchor/respawn resolver service
      previewRuntimeService - preview task/runtime helper service
      previewEntityService - preview entity spawn/cleanup service
      worldResetManagerSupplier - supplier for current world reset manager
      runningPhaseSupplier - supplier indicating active running phase state
  • Method Details

    • refreshLobbyPreview

      public void refreshLobbyPreview()
      Requests an asynchronous refresh of the lobby preview if allowed.
    • playPreviewDestroyAnimationThenReset

      public void playPreviewDestroyAnimationThenReset(org.bukkit.command.CommandSender sender)
      Plays the preview destroy animation and triggers a world reset on completion.
      Parameters:
      sender - command sender that initiated the reset request
    • removeLobbyBlockDisplayEntities

      public void removeLobbyBlockDisplayEntities()
      Removes tagged preview display entities around the configured lobby spawn.
    • clearLobbyPreviewEntities

      public void clearLobbyPreviewEntities()
      Cancels preview tasks and clears all tracked lobby preview entities.
    • hasLiveLobbyPreviewEntities

      public boolean hasLiveLobbyPreviewEntities()
      Returns whether any tracked lobby preview entities are still alive.
      Returns:
      true when any tracked preview display entity remains valid
    • isPreviewDestroying

      public boolean isPreviewDestroying()
      Returns whether the destroy animation is currently in progress.
      Returns:
      true when preview destroy animation is active
    • isPreviewEnabled

      public boolean isPreviewEnabled()
      Returns whether preview rendering is enabled by configuration.
      Returns:
      true when preview rendering is enabled