Package dev.deepcore.challenge.preview
Class PreviewOrchestratorService
java.lang.Object
dev.deepcore.challenge.preview.PreviewOrchestratorService
Orchestrates lobby preview lifecycle, build animation, and cleanup.
-
Constructor Summary
ConstructorsConstructorDescriptionPreviewOrchestratorService(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. -
Method Summary
Modifier and TypeMethodDescriptionvoidCancels preview tasks and clears all tracked lobby preview entities.booleanReturns whether any tracked lobby preview entities are still alive.booleanReturns whether the destroy animation is currently in progress.booleanReturns whether preview rendering is enabled by configuration.voidplayPreviewDestroyAnimationThenReset(org.bukkit.command.CommandSender sender) Plays the preview destroy animation and triggers a world reset on completion.voidRequests an asynchronous refresh of the lobby preview if allowed.voidRemoves tagged preview display entities around the configured lobby spawn.
-
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 ownerconfigView- challenge config value accessorpreviewSampleService- preview terrain sample generatorpreviewAnchorService- preview anchor/respawn resolver servicepreviewRuntimeService- preview task/runtime helper servicepreviewEntityService- preview entity spawn/cleanup serviceworldResetManagerSupplier- supplier for current world reset managerrunningPhaseSupplier- 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
-