Interface MaintenanceModule
- All Superinterfaces:
org.incendo.cloud.execution.CommandExecutionHandler<FPlayer>, ModuleCommand, ModuleLocalization, ModuleSimple
The /maintenance command, which closes the server to everyone but the allowed players.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.incendo.cloud.execution.CommandExecutionHandler
org.incendo.cloud.execution.CommandExecutionHandler.FutureCommandExecutionHandler<C> -
Method Summary
Modifier and TypeMethodDescriptionconfig()The config section for this command, which also holds its aliases.booleanWhether a player may join while maintenance is on.booleanWhether maintenance is currently on.voidkickOnlinePlayers(@NonNull Moderation maintenance) Disconnects everyone who is not allowed to stay.localization(FPlayer fPlayer) The localization section for a player, picked from their chosen language.The permission that gates this module.Switches maintenance on or off.Methods inherited from interface org.incendo.cloud.execution.CommandExecutionHandler
executeFutureMethods inherited from interface ModuleCommand
execute, executeMethods inherited from interface ModuleLocalization
cooldown, cooldownOrThrow, permissions, sound, soundOrThrow
-
Method Details
-
config
Command.Maintenance config()Description copied from interface:ModuleCommandThe config section for this command, which also holds its aliases.- Specified by:
configin interfaceModuleCommand- Specified by:
configin interfaceModuleSimple- Returns:
- the command settings
-
permission
Permission.Command.Maintenance permission()Description copied from interface:ModuleSimpleThe permission that gates this module.- Specified by:
permissionin interfaceModuleSimple- Returns:
- the permission
-
localization
Description copied from interface:ModuleLocalizationThe localization section for a player, picked from their chosen language.- Specified by:
localizationin interfaceModuleLocalization- Parameters:
fPlayer- the player the text is for- Returns:
- the localization settings
-
isAllowed
Whether a player may join while maintenance is on.- Parameters:
fPlayer- the connecting player- Returns:
- true if they are allowed in
-
isTurnedOn
boolean isTurnedOn()Whether maintenance is currently on.- Returns:
- true if the server is closed
-
turn
Switches maintenance on or off.- Parameters:
fPlayer- the moderatorreason- the stated reason, may be nulltime- when it ends in milliseconds, or -1 for indefiniteturned- whether to switch it on- Returns:
- the stored entry, or empty when switching off
-
kickOnlinePlayers
Disconnects everyone who is not allowed to stay.- Parameters:
maintenance- the maintenance entry
-