java.lang.Object
studio.magemonkey.codex.mccore.chat.Chat

public class Chat extends Object
Main helper method for the chat resources including accessing player data and sending messages to target groups
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    Clears the plugin prefix for all players
    static ChatData
    getPlayerData(String playerName)
    Retrieves the player with the given name
    static void
    removePrefix(String pluginName, String prefix)
    Removes the prefix for all players
    static void
    sendMessage(String permission, String message)
    Sends a message to all players with the given permission
    static void
    sendMessage(org.bukkit.Location center, int radius, boolean sphere, String message)
    Sends a message to all players within the defined sphere or cylinder
    static void
    sendMessage(org.bukkit.Location point, int width, int height, int depth, String message)
    Sends a message to all players within the defined cuboid
    static void
    sendMessage(org.bukkit.Location point1, org.bukkit.Location point2, String message)
    Sends a message to all players within the defined cuboid
    static void
    unlockPrefix(Prefix prefix, boolean apply)
    Unlocks the prefix for all players

    Methods inherited from class java.lang.Object

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

    • Chat

      public Chat()
  • Method Details

    • getPlayerData

      public static ChatData getPlayerData(String playerName)
      Retrieves the player with the given name
      Parameters:
      playerName - name of the player
      Returns:
      chat data associated with the player
    • unlockPrefix

      public static void unlockPrefix(Prefix prefix, boolean apply)
      Unlocks the prefix for all players
      Parameters:
      prefix - the prefix to unlock
      apply - whether or not to automatically apply it
    • removePrefix

      public static void removePrefix(String pluginName, String prefix)
      Removes the prefix for all players
      Parameters:
      pluginName - name of the plugin with the prefix
      prefix - the text of the prefix (with or without color)
    • clearPluginPrefixes

      public static void clearPluginPrefixes(String pluginName)
      Clears the plugin prefix for all players
      Parameters:
      pluginName - name of the plugin with the prefix
    • sendMessage

      public static void sendMessage(String permission, String message)
      Sends a message to all players with the given permission
      Parameters:
      permission - permission required to get the message
      message - message to send
    • sendMessage

      public static void sendMessage(org.bukkit.Location point1, org.bukkit.Location point2, String message)
      Sends a message to all players within the defined cuboid
      Parameters:
      point1 - the first point
      point2 - the second point
      message - the message to be sent
    • sendMessage

      public static void sendMessage(org.bukkit.Location point, int width, int height, int depth, String message)
      Sends a message to all players within the defined cuboid
      Parameters:
      point - the initial point
      width - width of the cuboid (x direction)
      height - height of the cuboid (y direction)
      depth - depth of the cuboid (z direction)
      message - message to be sent
    • sendMessage

      public static void sendMessage(org.bukkit.Location center, int radius, boolean sphere, String message)
      Sends a message to all players within the defined sphere or cylinder
      Parameters:
      center - the center of the region
      radius - radius of the sphere/cylinder
      sphere - sphere if true, cylinder if false (cylinder contains all y within the defined circle)