Class StaffChatManager

java.lang.Object
me.remigio07.chatplugin.api.server.chat.StaffChatManager
All Implemented Interfaces:
ChatPluginManager

public abstract class StaffChatManager extends Object implements ChatPluginManager
Manager that handles the Staff chat.
See Also:
  • Constructor Details

    • StaffChatManager

      public StaffChatManager()
  • Method Details

    • isEnabled

      public boolean isEnabled()
      Checks if this manager is enabled.

      Found at: "chat.staff-chat.enabled" in ConfigurationType.CHAT

      Specified by:
      isEnabled in interface ChatPluginManager
      Returns:
      Whether this manager is enabled
    • getPlayerChatFormat

      public String getPlayerChatFormat()
      Gets the chat format displayed to Staff members when a player sends a message using the Staff chat.

      Found at: "chat.staff-chat.format.player.chat" in ConfigurationType.CHAT

      Returns:
      Players' chat format
    • getPlayerTerminalFormat

      public String getPlayerTerminalFormat()
      Gets the chat format displayed in the terminal when a player sends a message using the Staff chat.

      Found at: "chat.staff-chat.format.player.terminal" in ConfigurationType.CHAT

      Returns:
      Players' terminal format
    • getConsoleChatFormat

      public String getConsoleChatFormat()
      Gets the chat format displayed to Staff members when the console sends a message using the Staff chat.

      Found at: "chat.staff-chat.format.console.chat" in ConfigurationType.CHAT

      Returns:
      Console's chat format
    • getConsoleTerminalFormat

      public String getConsoleTerminalFormat()
      Gets the chat format displayed in the terminal when the console sends a message using the Staff chat.

      Found at: "chat.staff-chat.format.console.terminal" in ConfigurationType.CHAT

      Returns:
      Console's terminal format
    • getPlaceholderTypes

      public List<PlaceholderType> getPlaceholderTypes()
      Gets the list of placeholder types used to translate messages sent using the Staff chat.

      Found at: "chat.staff-chat.placeholder-types" in ConfigurationType.CHAT

      Returns:
      Placeholders used to translate messages
    • getPlayers

      public List<UUID> getPlayers()
      Gets the list of who has the Staff chat mode enabled.

      Do not modify the returned list. Use addPlayer(UUID), removePlayer(UUID), clearPlayers() and isUsingStaffChat(UUID) to interact with it.

      Returns:
      Staff chat's users' list
    • addPlayer

      public void addPlayer(UUID player)
      Adds a player to getPlayers().
      Parameters:
      player - Player to add
    • removePlayer

      public void removePlayer(UUID player)
      Removes a player from getPlayers().
      Parameters:
      player - Player to remove
    • clearPlayers

      public void clearPlayers()
      Clears getPlayers().
    • isUsingStaffChat

      public boolean isUsingStaffChat(UUID player)
      Checks if the specified player has the Staff chat mode enabled.
      Parameters:
      player - Player to check
      Returns:
      Whether the specified player is using the Staff chat
    • getInstance

      public static StaffChatManager getInstance()
      Gets this manager's instance.
      Returns:
      Manager's instance
    • sendPlayerMessage

      public abstract void sendPlayerMessage(ChatPluginServerPlayer player, String message)
      Makes a player send a message using the Staff chat.
      Parameters:
      player - Message's sender
      message - Message to send
      See Also:
    • sendConsoleMessage

      public abstract void sendConsoleMessage(String message)
      Makes the console send a message using the Staff chat.
      Parameters:
      message - Message to send
      Throws:
      IllegalStateException - If !Environment.isProxy() && ProxyManager.isEnabled() && PlayerAdapter.getOnlinePlayers().size() == 0
      See Also: