Interface MaintenanceModule

All Superinterfaces:
org.incendo.cloud.execution.CommandExecutionHandler<FPlayer>, ModuleCommand, ModuleLocalization, ModuleSimple

public interface MaintenanceModule extends ModuleCommand
The /maintenance command, which closes the server to everyone but the allowed players.
  • Method Details

    • config

      Description copied from interface: ModuleCommand
      The config section for this command, which also holds its aliases.
      Specified by:
      config in interface ModuleCommand
      Specified by:
      config in interface ModuleSimple
      Returns:
      the command settings
    • permission

      Description copied from interface: ModuleSimple
      The permission that gates this module.
      Specified by:
      permission in interface ModuleSimple
      Returns:
      the permission
    • localization

      Description copied from interface: ModuleLocalization
      The localization section for a player, picked from their chosen language.
      Specified by:
      localization in interface ModuleLocalization
      Parameters:
      fPlayer - the player the text is for
      Returns:
      the localization settings
    • isAllowed

      boolean isAllowed(FPlayer fPlayer)
      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

      Optional<Moderation> turn(FPlayer fPlayer, @Nullable String reason, long time, boolean turned)
      Switches maintenance on or off.
      Parameters:
      fPlayer - the moderator
      reason - the stated reason, may be null
      time - when it ends in milliseconds, or -1 for indefinite
      turned - whether to switch it on
      Returns:
      the stored entry, or empty when switching off
    • kickOnlinePlayers

      void kickOnlinePlayers(@NonNull Moderation maintenance)
      Disconnects everyone who is not allowed to stay.
      Parameters:
      maintenance - the maintenance entry