Class Chat

java.lang.Object
fr.prodrivers.bukkit.commons.chat.Chat

public class Chat extends Object
Chat helper for Prodrivers plugins.

Expose more advanced functions to send messages to players. Handles prefix and colors directly.

  • Constructor Summary

    Constructors
    Constructor
    Description
    Chat(@NonNull MessageSender messageSender)
    Constructor for the Chat helper for Prodrivers plugins
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    error(@NonNull UUID receiverPlayerUniqueId, @NonNull String message)
    Error message receiver, that potentially supports non-local players
    void
    error(@NonNull UUID receiverPlayerUniqueId, @NonNull String message, @NonNull String prefix)
    Error message receiver, that potentially supports non-local players, using a defined prefix
    void
    error(@NonNull UUID receiverPlayerUniqueId, @NonNull net.md_5.bungee.api.chat.BaseComponent[] message)
    Error message receiver, that potentially supports non-local players
    void
    error(@NonNull UUID receiverPlayerUniqueId, @NonNull net.md_5.bungee.api.chat.BaseComponent[] message, @NonNull String prefix)
    Error message receiver, that potentially supports non-local players, using a defined prefix
    void
    error(@NonNull org.bukkit.command.CommandSender receiver, @NonNull String message)
    Error message receiver
    void
    error(@NonNull org.bukkit.command.CommandSender receiver, @NonNull String message, @NonNull String prefix)
    Error message receiver, using a defined prefix
    void
    error(@NonNull org.bukkit.command.CommandSender receiver, @NonNull net.md_5.bungee.api.chat.BaseComponent[] message)
    Error message receiver
    void
    error(@NonNull org.bukkit.command.CommandSender receiver, @NonNull net.md_5.bungee.api.chat.BaseComponent[] message, @NonNull String prefix)
    Error message receiver, using a defined prefix
    void
    load(@NonNull Messages messages)
    Load prefix from a message instance
    void
    send(@NonNull UUID receiverPlayerUniqueId, @NonNull String message)
    Generic message receiver, that potentially supports non-local players
    void
    send(@NonNull UUID receiverPlayerUniqueId, @NonNull String message, @NonNull String prefix)
    Generic message receiver, that potentially supports non-local players, using a defined prefix
    void
    send(@NonNull UUID receiverPlayerUniqueId, @NonNull net.md_5.bungee.api.chat.BaseComponent[] message)
    Generic message receiver, that potentially supports non-local players
    void
    send(@NonNull UUID receiverPlayerUniqueId, @NonNull net.md_5.bungee.api.chat.BaseComponent[] message, @NonNull String prefix)
    Generic message receiver, that potentially supports non-local players, using a defined prefix
    void
    send(@NonNull org.bukkit.command.CommandSender receiver, @NonNull String message)
    Generic message receiver
    void
    send(@NonNull org.bukkit.command.CommandSender receiver, @NonNull String message, @NonNull String prefix)
    Generic message receiver, using a defined prefix
    void
    send(@NonNull org.bukkit.command.CommandSender receiver, @NonNull net.md_5.bungee.api.chat.BaseComponent[] message)
    Generic message receiver
    void
    send(@NonNull org.bukkit.command.CommandSender receiver, @NonNull net.md_5.bungee.api.chat.BaseComponent[] message, @NonNull String prefix)
    Generic message receiver, using a defined prefix
    void
    setName(@NonNull String name)
    Set the default name to use in prefix when a custom prefix is not specified
    void
    success(@NonNull UUID receiverPlayerUniqueId, @NonNull String message)
    Success message receiver, that potentially supports non-local players
    void
    success(@NonNull UUID receiverPlayerUniqueId, @NonNull String message, @NonNull String prefix)
    Success message receiver, that potentially supports non-local players, using a defined prefix
    void
    success(@NonNull UUID receiverPlayerUniqueId, @NonNull net.md_5.bungee.api.chat.BaseComponent[] message)
    Success message receiver, that potentially supports non-local players
    void
    success(@NonNull UUID receiverPlayerUniqueId, @NonNull net.md_5.bungee.api.chat.BaseComponent[] message, @NonNull String prefix)
    Success message receiver, that potentially supports non-local players, using a defined prefix
    void
    success(@NonNull org.bukkit.command.CommandSender receiver, @NonNull String message)
    Success message receiver
    void
    success(@NonNull org.bukkit.command.CommandSender receiver, @NonNull String message, @NonNull String prefix)
    Success message receiver, using a defined prefix
    void
    success(@NonNull org.bukkit.command.CommandSender receiver, @NonNull net.md_5.bungee.api.chat.BaseComponent[] message)
    Success message receiver
    void
    success(@NonNull org.bukkit.command.CommandSender receiver, @NonNull net.md_5.bungee.api.chat.BaseComponent[] message, @NonNull String prefix)
    Success message receiver, using a defined prefix

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Chat

      public Chat(@NonNull MessageSender messageSender)
      Constructor for the Chat helper for Prodrivers plugins
      Parameters:
      messageSender - MessageSender instance to use as backend
  • Method Details

    • setName

      public void setName(@NonNull String name)
      Set the default name to use in prefix when a custom prefix is not specified
      Parameters:
      name - Name to be used in prefix
    • load

      public void load(@NonNull Messages messages)
      Load prefix from a message instance
      Parameters:
      messages - Message instance
    • send

      public void send(@NonNull org.bukkit.command.CommandSender receiver, @NonNull String message)
      Generic message receiver
      Parameters:
      receiver - Receiving entity
      message - Message to send
    • send

      public void send(@NonNull org.bukkit.command.CommandSender receiver, @NonNull String message, @NonNull String prefix)
      Generic message receiver, using a defined prefix
      Parameters:
      receiver - Receiving entity
      message - Message to send
      prefix - Prefix to use
    • success

      public void success(@NonNull org.bukkit.command.CommandSender receiver, @NonNull String message)
      Success message receiver
      Parameters:
      receiver - Receiving entity
      message - Success message to send
    • success

      public void success(@NonNull org.bukkit.command.CommandSender receiver, @NonNull String message, @NonNull String prefix)
      Success message receiver, using a defined prefix
      Parameters:
      receiver - Receiving entity
      message - Message to send
      prefix - Prefix to use
    • error

      public void error(@NonNull org.bukkit.command.CommandSender receiver, @NonNull String message)
      Error message receiver
      Parameters:
      receiver - Receiving entity
      message - Error message to send
    • error

      public void error(@NonNull org.bukkit.command.CommandSender receiver, @NonNull String message, @NonNull String prefix)
      Error message receiver, using a defined prefix
      Parameters:
      receiver - Receiving entity
      message - Message to send
      prefix - Prefix to use
    • send

      public void send(@NonNull org.bukkit.command.CommandSender receiver, @NonNull net.md_5.bungee.api.chat.BaseComponent[] message)
      Generic message receiver
      Parameters:
      receiver - Receiving entity
      message - Message to send
    • send

      public void send(@NonNull org.bukkit.command.CommandSender receiver, @NonNull net.md_5.bungee.api.chat.BaseComponent[] message, @NonNull String prefix)
      Generic message receiver, using a defined prefix
      Parameters:
      receiver - Receiving entity
      message - Message to send
      prefix - Prefix to use
    • success

      public void success(@NonNull org.bukkit.command.CommandSender receiver, @NonNull net.md_5.bungee.api.chat.BaseComponent[] message)
      Success message receiver
      Parameters:
      receiver - Receiving entity
      message - Success message to send
    • success

      public void success(@NonNull org.bukkit.command.CommandSender receiver, @NonNull net.md_5.bungee.api.chat.BaseComponent[] message, @NonNull String prefix)
      Success message receiver, using a defined prefix
      Parameters:
      receiver - Receiving entity
      message - Message to send
      prefix - Prefix to use
    • error

      public void error(@NonNull org.bukkit.command.CommandSender receiver, @NonNull net.md_5.bungee.api.chat.BaseComponent[] message)
      Error message receiver
      Parameters:
      receiver - Receiving entity
      message - Error message to send
    • error

      public void error(@NonNull org.bukkit.command.CommandSender receiver, @NonNull net.md_5.bungee.api.chat.BaseComponent[] message, @NonNull String prefix)
      Error message receiver, using a defined prefix
      Parameters:
      receiver - Receiving entity
      message - Message to send
      prefix - Prefix to use
    • send

      public void send(@NonNull UUID receiverPlayerUniqueId, @NonNull String message)
      Generic message receiver, that potentially supports non-local players
      Parameters:
      receiverPlayerUniqueId - Receiving player
      message - Message to send
    • send

      public void send(@NonNull UUID receiverPlayerUniqueId, @NonNull String message, @NonNull String prefix)
      Generic message receiver, that potentially supports non-local players, using a defined prefix
      Parameters:
      receiverPlayerUniqueId - Receiving player
      message - Message to send
      prefix - Prefix to use
    • success

      public void success(@NonNull UUID receiverPlayerUniqueId, @NonNull String message)
      Success message receiver, that potentially supports non-local players
      Parameters:
      receiverPlayerUniqueId - Receiving player
      message - Success message to send
    • success

      public void success(@NonNull UUID receiverPlayerUniqueId, @NonNull String message, @NonNull String prefix)
      Success message receiver, that potentially supports non-local players, using a defined prefix
      Parameters:
      receiverPlayerUniqueId - Receiving player
      message - Success message to send
      prefix - Prefix to use
    • error

      public void error(@NonNull UUID receiverPlayerUniqueId, @NonNull String message)
      Error message receiver, that potentially supports non-local players
      Parameters:
      receiverPlayerUniqueId - Receiving player
      message - Error message to send
    • error

      public void error(@NonNull UUID receiverPlayerUniqueId, @NonNull String message, @NonNull String prefix)
      Error message receiver, that potentially supports non-local players, using a defined prefix
      Parameters:
      receiverPlayerUniqueId - Receiving player
      message - Success message to send
      prefix - Prefix to use
    • send

      public void send(@NonNull UUID receiverPlayerUniqueId, @NonNull net.md_5.bungee.api.chat.BaseComponent[] message)
      Generic message receiver, that potentially supports non-local players
      Parameters:
      receiverPlayerUniqueId - Receiving player
      message - Message to send
    • send

      public void send(@NonNull UUID receiverPlayerUniqueId, @NonNull net.md_5.bungee.api.chat.BaseComponent[] message, @NonNull String prefix)
      Generic message receiver, that potentially supports non-local players, using a defined prefix
      Parameters:
      receiverPlayerUniqueId - Receiving player
      message - Message to send
      prefix - Prefix to use
    • success

      public void success(@NonNull UUID receiverPlayerUniqueId, @NonNull net.md_5.bungee.api.chat.BaseComponent[] message)
      Success message receiver, that potentially supports non-local players
      Parameters:
      receiverPlayerUniqueId - Receiving player
      message - Success message to send
    • success

      public void success(@NonNull UUID receiverPlayerUniqueId, @NonNull net.md_5.bungee.api.chat.BaseComponent[] message, @NonNull String prefix)
      Success message receiver, that potentially supports non-local players, using a defined prefix
      Parameters:
      receiverPlayerUniqueId - Receiving player
      message - Message to send
      prefix - Prefix to use
    • error

      public void error(@NonNull UUID receiverPlayerUniqueId, @NonNull net.md_5.bungee.api.chat.BaseComponent[] message)
      Error message receiver, that potentially supports non-local players
      Parameters:
      receiverPlayerUniqueId - Receiving player
      message - Error message to send
    • error

      public void error(@NonNull UUID receiverPlayerUniqueId, @NonNull net.md_5.bungee.api.chat.BaseComponent[] message, @NonNull String prefix)
      Error message receiver, that potentially supports non-local players, using a defined prefix
      Parameters:
      receiverPlayerUniqueId - Receiving player
      message - Message to send
      prefix - Prefix to use