Class ChatLogic

java.lang.Object
us.talabrek.ultimateskyblock.chat.ChatLogic

public class ChatLogic extends Object
The primary logic of uSkyBlocks chat-handling
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull String
    getFormat(us.talabrek.ultimateskyblock.api.event.IslandChatEvent.Type type)
    Gets the message format for the given IslandChatEvent.Type.
    @NotNull List<org.bukkit.entity.Player>
    getRecipients(org.bukkit.entity.Player sender, us.talabrek.ultimateskyblock.api.event.IslandChatEvent.Type chatType)
    Gets a List containing Player's with all the recipients that should receive the given message IslandChatEvent.Type from the sending Player.
    @Nullable us.talabrek.ultimateskyblock.api.event.IslandChatEvent.Type
    getToggle(org.bukkit.entity.Player player)
    Gets the current IslandChatEvent.Type toggle for the given Player, or null if none exists.
    void
    sendMessage(org.bukkit.entity.Player sender, us.talabrek.ultimateskyblock.api.event.IslandChatEvent.Type type, String message)
    Sends the given message to all online partymembers or island visitors on the given Player's island, depending on the given IslandChatEvent.Type.
    boolean
    toggle(org.bukkit.entity.Player player, us.talabrek.ultimateskyblock.api.event.IslandChatEvent.Type type)
    Toggle the IslandChatEvent.Type on or off for the given Player, returns true if it is toggled on.

    Methods inherited from class java.lang.Object

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

    • ChatLogic

      public ChatLogic(uSkyBlock plugin)
  • Method Details

    • getRecipients

      @NotNull public @NotNull List<org.bukkit.entity.Player> getRecipients(org.bukkit.entity.Player sender, us.talabrek.ultimateskyblock.api.event.IslandChatEvent.Type chatType)
      Gets a List containing Player's with all the recipients that should receive the given message IslandChatEvent.Type from the sending Player. Returns an empty list when there are no recipients.
      Parameters:
      sender - Player sending the message.
      chatType - Message type that the player is sending.
      Returns:
      List of all recipients, or an empty list if there are none.
    • sendMessage

      public void sendMessage(org.bukkit.entity.Player sender, us.talabrek.ultimateskyblock.api.event.IslandChatEvent.Type type, String message)
      Sends the given message to all online partymembers or island visitors on the given Player's island, depending on the given IslandChatEvent.Type.
      Parameters:
      sender - Player sending the message.
      type - Message type to send.
      message - Message to send.
    • getFormat

      @NotNull public @NotNull String getFormat(us.talabrek.ultimateskyblock.api.event.IslandChatEvent.Type type)
      Gets the message format for the given IslandChatEvent.Type.
      Parameters:
      type - Island chat type to lookup.
      Returns:
      Message format.
    • toggle

      public boolean toggle(org.bukkit.entity.Player player, us.talabrek.ultimateskyblock.api.event.IslandChatEvent.Type type)
      Toggle the IslandChatEvent.Type on or off for the given Player, returns true if it is toggled on.
      Parameters:
      player - Player to toggle the chat type for.
      type - Chat type to toggle.
      Returns:
      True if it is toggled on, false otherwise.
    • getToggle

      @Nullable public @Nullable us.talabrek.ultimateskyblock.api.event.IslandChatEvent.Type getToggle(org.bukkit.entity.Player player)
      Gets the current IslandChatEvent.Type toggle for the given Player, or null if none exists.
      Parameters:
      player - Player to lookup.
      Returns:
      The current Type toggle, or null if none exists.