Package dev.deepcore.challenge
Class ChallengeAdminFacade
java.lang.Object
dev.deepcore.challenge.ChallengeAdminFacade
Facade for challenge command orchestration across manager/session/world
flows.
-
Constructor Summary
ConstructorsConstructorDescriptionChallengeAdminFacade(DeepCorePlugin plugin, ChallengeManager challengeManager, ChallengeSessionManager challengeSessionManager, WorldResetManager worldResetManager, DeepCoreLogger logger) Creates an admin facade wiring challenge manager, session, and world reset services. -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyComponentOperation(ChallengeComponent component, String operation) Applies a component operation (`on`, `off`, or `toggle`).booleanReturns whether challenge settings can currently be edited.voidEnds an active challenge and transitions back to prep state.Returns current component toggle values.getMode()Returns the active challenge mode.Returns the current session phase name.intReturns current ready player count.intReturns current ready target count.booleanReturns whether challenge mode is enabled.booleanisComponentEnabled(ChallengeComponent component) Returns whether a specific challenge component is enabled.booleanReturns whether the session is currently in paused phase.booleanReturns whether the session is currently in prep phase.booleanReturns whether the session is currently in running phase.booleanpauseChallenge(org.bukkit.command.CommandSender sender) Attempts to pause the active challenge run.booleanReloads config and applies settings immediately when in prep phase.voidResets component toggles to defaults of the active mode.voidresetWorlds(org.bukkit.command.CommandSender sender) Triggers an immediate world reset.booleanresumeChallenge(org.bukkit.command.CommandSender sender) Attempts to resume a paused challenge run.voidsetEnabled(boolean enabled) Enables or disables challenge mode and reapplies world rules.voidsetMode(ChallengeMode mode) Sets the active challenge mode and reapplies dependent state.voidstopChallenge(org.bukkit.command.CommandSender sender) Stops challenge flow and triggers a world reset.
-
Constructor Details
-
ChallengeAdminFacade
public ChallengeAdminFacade(DeepCorePlugin plugin, ChallengeManager challengeManager, ChallengeSessionManager challengeSessionManager, WorldResetManager worldResetManager, DeepCoreLogger logger) Creates an admin facade wiring challenge manager, session, and world reset services.- Parameters:
plugin- plugin instance used for config operationschallengeManager- challenge configuration managerchallengeSessionManager- session lifecycle coordinatorworldResetManager- world reset orchestration servicelogger- logger used for command and config operations
-
-
Method Details
-
canEditSettings
public boolean canEditSettings()Returns whether challenge settings can currently be edited.- Returns:
- true when session state allows settings modifications
-
setEnabled
public void setEnabled(boolean enabled) Enables or disables challenge mode and reapplies world rules.- Parameters:
enabled- true to enable challenge mode, false to disable it
-
setMode
Sets the active challenge mode and reapplies dependent state.- Parameters:
mode- challenge mode to activate
-
resetComponentsToModeDefaults
public void resetComponentsToModeDefaults()Resets component toggles to defaults of the active mode. -
applyComponentOperation
Applies a component operation (`on`, `off`, or `toggle`).- Parameters:
component- challenge component to mutateoperation- requested operation name- Throws:
IllegalArgumentException- when operation is not one of on/off/toggle
-
isPrepPhase
public boolean isPrepPhase()Returns whether the session is currently in prep phase.- Returns:
- true when the challenge session is in prep phase
-
isRunningPhase
public boolean isRunningPhase()Returns whether the session is currently in running phase.- Returns:
- true when the challenge session is actively running
-
isPausedPhase
public boolean isPausedPhase()Returns whether the session is currently in paused phase.- Returns:
- true when the challenge session is paused
-
endChallengeAndReturnToPrep
public void endChallengeAndReturnToPrep()Ends an active challenge and transitions back to prep state. -
stopChallenge
public void stopChallenge(org.bukkit.command.CommandSender sender) Stops challenge flow and triggers a world reset.- Parameters:
sender- command sender requesting the stop action
-
pauseChallenge
public boolean pauseChallenge(org.bukkit.command.CommandSender sender) Attempts to pause the active challenge run.- Parameters:
sender- command sender requesting pause- Returns:
- true when pause was accepted and applied
-
resumeChallenge
public boolean resumeChallenge(org.bukkit.command.CommandSender sender) Attempts to resume a paused challenge run.- Parameters:
sender- command sender requesting resume- Returns:
- true when resume was accepted and applied
-
resetWorlds
public void resetWorlds(org.bukkit.command.CommandSender sender) Triggers an immediate world reset.- Parameters:
sender- command sender requesting world reset
-
reloadConfigAndApply
public boolean reloadConfigAndApply()Reloads config and applies settings immediately when in prep phase.- Returns:
- true when reload and apply were fully completed
-
isChallengeEnabled
public boolean isChallengeEnabled()Returns whether challenge mode is enabled.- Returns:
- true when challenge mode is currently enabled
-
getPhaseName
Returns the current session phase name.- Returns:
- lowercase session phase name
-
getReadyCount
public int getReadyCount()Returns current ready player count.- Returns:
- number of participants currently marked ready
-
getReadyTargetCount
public int getReadyTargetCount()Returns current ready target count.- Returns:
- number of participants required for ready completion
-
getMode
Returns the active challenge mode.- Returns:
- currently configured challenge mode
-
getComponentToggles
Returns current component toggle values.- Returns:
- map of each challenge component and its enabled state
-
isComponentEnabled
Returns whether a specific challenge component is enabled.- Parameters:
component- component to query- Returns:
- true when the requested component is enabled
-