This also translates hex color codes: {#FFFFFF}
+ * @param message The message to translate + * @return The translated message. + */ + public static String translateColorCodes(String message){ + return UltraChat.plugin.chatColorUtil.translateChatColor(message); + } + + public static String translateColorCodes(Player p, String message){ + return UltraChat.plugin.chatColorUtil.translateChatColor(p, message); + } + + public static ComponentBuilder translateColorCodesChat(String message, PlayerFormatting pf){ + MapThis will return a string Such as &4 or {#FFFFFF}.
+ *Note: The colors interpreted are from the chatcolor.yml file. To also get color data from the use {@link me.ryandw11.ultrachat.util.ChatUtil#translateColorCode(String)}
+ * @param player The player to get the color for * @return color code. */ public String getPlayerColor(Player player){ return plugin.data.getString(player.getUniqueId() + ".color"); } + /** * Set a player's color. - * @param player - * @param color + * @param player The player color to set + * @param color The color to set + *Keep in mind that this color is interpreted from the chatcolor.yml file, not the default colors.
*/ public void setPlayerColor(Player player, String color){ plugin.data.set(player.getUniqueId() + ".color", color); plugin.saveFile(); } + /** * Get the swear word list. * @return Block swear words. */ - @SuppressWarnings("unchecked") - public ArrayListNote: Most methods from this interface are wrapped in the {@link me.ryandw11.ultrachat.util.ChatUtil} class.
+ * @return The chat color utility interface. */ - public boolean legitDefaultChannel(String chan){ - if(plugin.channel.contains(chan)) - return true; - return false; + public ChatColorUtils getChatColorUtil(){ + return plugin.chatColorUtil; } + + /** + * Get the chat color manager. + *Note: Most uses for this class is covered by the {@link me.ryandw11.ultrachat.util.ChatUtil} class.
+ *This class is only available on 1.16+ servers. This WILL return null on any version below 1.16.
+ * @return The chat color manager. + */ + public ChatColorManager getChatColorManager(){ + return plugin.chatColorManager; + } + + public ChannelManager getChannelManager(){ + return new ChannelManager(); + } + /** * Get the current active hooks. - * @return The set witht the names of the plugins. Returns null if no hooks are active. + * @return The set with the names of the plugins. Returns null if no hooks are active. */ public SetNote: Since API Version 2.5 this event is only needed when you want specific ultraChat information.
+ */ public class UltraChatEvent extends Event{ private static final HandlerList handlers = new HandlerList(); @@ -36,7 +40,7 @@ public class UltraChatEvent extends Event{ } /** * Set the recipients. - * @param recipents The set of recipients. + * @param recipients The set of recipients. */ public void setRecipients(SetThe instance of this class can be retrieved from {@link UltraChatAPI#getAddonManager()}
+ */ public class AddonManager { private ListGet the instance of this class from {@link me.ryandw11.ultrachat.api.UltraChatAPI#getChannelManager()}
+ */ public class ChannelManager { private UltraChat plugin; public ChannelManager() { @@ -29,7 +31,7 @@ public class ChannelManager { /** * Grab the player's current channel. - * @param player + * @param player The player to get the channel from. * @return The player's current channel. */ public ChatChannel getPlayerChannel(Player player){ @@ -39,8 +41,8 @@ public class ChannelManager { /** * Grab an offline player's current channel. - * @param player - * @return + * @param player The player to get the channel from. + * @return That UUID's current channel. */ public ChatChannel getPlayerChannel(UUID player) { ChannelBuilder cb = new ChannelBuilder(plugin.data.getString(player + ".channel")); @@ -58,8 +60,8 @@ public class ChannelManager { /** * Set the player's channel. - * @param player - * @param channel + * @param player The player to set. + * @param channel The channel. */ public void setPlayerChannel(Player player, ChatChannel channel){ plugin.data.set(player.getUniqueId() + ".channel", channel.getName()); @@ -68,8 +70,8 @@ public class ChannelManager { /** * Set the player's channel. - * @param player - * @param channel + * @param player The player to set. + * @param channel The channel. */ public void setPlayerChannel(UUID player, ChatChannel channel) { plugin.data.set(player + ".channel", channel.getName()); @@ -79,7 +81,7 @@ public class ChannelManager { /** * Set the default channel - * @param channel + * @param channel The channel. */ public void setDefaultChannel(ChatChannel channel){ plugin.getConfig().set("Default_Config", channel.getName()); @@ -88,7 +90,8 @@ public class ChannelManager { /** * If a given channel exists (In this instance if it is save in the files) - * @param channel + * @param channel The channel to check. + * @return If the channel exists. */ public boolean channelExists(ChatChannel channel) { return plugin.channel.contains(channel.getName()); @@ -96,8 +99,8 @@ public class ChannelManager { /** * If a given channel exists based upon the name. - * @param name - * @return + * @param name The name of the channel to check + * @return If the channel exists. */ public boolean channelExists(String name) { return plugin.channel.contains(name); @@ -105,8 +108,8 @@ public class ChannelManager { /** * Get all online players in a given channel. - * @param channel - * @return + * @param channel The channel to get the players from. + * @return The list of players. (Unmodifiable) */ public ListUpdated for 1.16.1.
+ *Note: You should access manager classes from the {@link me.ryandw11.ultrachat.api.UltraChatAPI} class.
* @author Ryandw11 - * @version 2.4 - * Updated for 1.14. - * (Very few API methods here) + * @version 2.5 */ public class UltraChat extends JavaPlugin { public static UltraChat plugin; - public Permission perms = null; - public Chat chat = null; - public Boolean chatStop = false; - public ChatType md; - public ArrayListNote: All set methods automatically call the {@link #update()} method.
+ */ public class ChatChannel { private String name; @@ -15,7 +19,7 @@ public class ChatChannel { /** * For internal use only. Always use the channel builder. - * @param cb + * @param cb The builder that was used to build the channel. */ public ChatChannel(ChannelBuilder cb) { this.name = cb.getName(); @@ -31,9 +35,9 @@ public class ChatChannel { } /** - * Auto calls the update() method. + * Set the name of the channel. *Note: If this channel is the default channel then you will need to change the default channel name manually
- * @param name + * @param name The name of the channel. */ public void setName(String name) { UltraChat.plugin.channel.set(this.name, null); @@ -41,44 +45,76 @@ public class ChatChannel { update(); } + /** + * Get the prefix of the channel. + * @return The prefix of the channel. + */ public String getPrefix() { return prefix; } + /** + * Set the prefix of the channel. + * @param prefix The prefix of the channel. + */ public void setPrefix(String prefix) { this.prefix = prefix; update(); } + /** + * Get the permission for the channel. + * @return The permission for the channel. + */ public String getPermission() { return permission; } + /** + * Set the permission for the channel. + * @param permission The permission for the channel. + */ public void setPermission(String permission) { this.permission = permission; update(); } + /** + * If the channel always appears. + * @return If the channel always appears. + */ public boolean isAlwaysAppear() { return alwaysAppear; } + /** + * Set if the channel will always appear in chat. + * @param alwaysAppear If the channel will always appear. + */ public void setAlwaysAppear(boolean alwaysAppear) { this.alwaysAppear = alwaysAppear; update(); } + /** + * Get the json of the channel + * @return The json. + */ public ListModifier and Type | +Constant Field | +Value | +
---|---|---|
+
+public static final int |
+B_STATS_VERSION |
+1 |
+
Method and Description | +
---|
me.ryandw11.ultrachat.api.channels.ChatChannel.delete()
+ It is not recommended to use this.
+ |
+
me.ryandw11.ultrachat.api.UltraChatAPI.getPlayerCurrentChannel(UUID)
+ Use the channel manager instead.
+ |
+
me.ryandw11.ultrachat.api.UltraChatAPI.getPlayerFormatting(Player)
+ Construct the
+PlayerFormatting class yourself. |
+
me.ryandw11.ultrachat.api.events.properties.ChatProperties.isComponent()
+ As of version 2.5 this will always be true as the plugin is always in JSON mode.
+ |
+
Each documented package, class and interface has its own Use page. This page describes what packages, classes, methods, constructors and fields use any part of the given class or package. Given a class or interface A, its Use page includes subclasses of A, fields declared as A, methods that return A, and methods and constructors with parameters of type A. You can access this page by first going to the package, class or interface, then clicking on the "Use" link in the navigation bar.
-There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with java.lang.Object
. The interfaces do not inherit from java.lang.Object
.
public class UltraChat
extends org.bukkit.plugin.java.JavaPlugin
-Updated for 1.16.1.
+Note: You should access manager classes from the UltraChatAPI
class.
channel
java.lang.Boolean
channelEnabled
java.io.File
channelFile
java.io.File
channelfile
net.milkbowl.vault.chat.Chat
chat
java.lang.Boolean
chatStop
org.bukkit.configuration.file.FileConfiguration
data
chatColorFC
java.io.File
datafile
chatColorFile
java.lang.String
defaultChannel
ChatColorManager
chatColorManager
ChatColorUtils
chatColorUtil
ChatType
chatType
org.bukkit.configuration.file.FileConfiguration
data
java.io.File
dataFile
java.lang.Boolean
JSON
isChatStopped
static org.bukkit.configuration.file.YamlConfiguration
LANG_FILE
ChatType
md
PlaceHolderAPIHook
papi
net.milkbowl.vault.permission.Permission
perms
static UltraChat
plugin
java.lang.String
prefix
java.util.ArrayList<java.util.UUID>
spytoggle
java.util.ArrayList<java.util.UUID>
stafftoggle
java.util.List<java.util.UUID>
spyToggle
java.lang.Boolean
Vault
java.util.List<java.util.UUID>
staffToggle
me.ryandw11.ultrachat.gui.ColorGUI
ColorGUI
getColorGUI()
void
loadLang()
loadLang()
+void
public static UltraChat plugin- - - -
public net.milkbowl.vault.permission.Permission perms-
public net.milkbowl.vault.chat.Chat chat-
public java.lang.Boolean Vault-
public java.lang.Boolean chatStop-
public java.lang.Boolean channelEnabled-
public java.lang.Boolean JSON-
public ChatType md-
public java.lang.String defaultChannel-
public java.util.ArrayList<java.util.UUID> stafftoggle-
public java.util.ArrayList<java.util.UUID> spytoggle-
public PlaceHolderAPIHook papi-
public java.io.File datafile-
public org.bukkit.configuration.file.FileConfiguration data-
public java.io.File channelfile-
public org.bukkit.configuration.file.FileConfiguration channel-
public java.lang.String prefix-
public static java.io.File LANG_FILE+ + + +
public net.milkbowl.vault.permission.Permission perms+
public net.milkbowl.vault.chat.Chat chat+
public java.lang.Boolean isChatStopped+
public ChatType chatType+
public java.util.List<java.util.UUID> staffToggle+
public java.util.List<java.util.UUID> spyToggle+
public PlaceHolderAPIHook papi+
public java.io.File dataFile+
public org.bukkit.configuration.file.FileConfiguration data+
public java.io.File channelFile+
public org.bukkit.configuration.file.FileConfiguration channel+
public java.io.File chatColorFile+
public org.bukkit.configuration.file.FileConfiguration chatColorFC+
public java.lang.String prefix+
public ChatColorManager chatColorManager+
public AddonManager addonManager+
public AddonManager addonManager+
public ChatColorUtils chatColorUtil
public void loadMethod()+
public ColorGUI getColorGUI()+
public void loadLang()-
public void loadMethod()-
public me.ryandw11.ultrachat.gui.ColorGUI getColorGUI()-
public enum ChatType extends java.lang.Enum<ChatType>+
CHAT_CMD_NOT_VALID
CHAT_COLOR_CHANGE
CHAT_STOP_OFF
CHAT_STOP_ON
CHAT_STOP_PERSONAL
CHAT_UNSTOP_PERSONAL
CMD_SPY_FORMAT
CMD_SPY_OFF
CMD_SPY_ON
COLOR_GUI
CONFIG_RELOAD
CONSOLE_CHAT_LOG
ERROR_CHANNEL_ENABLED
ERROR_CHANNEL_USAGE
HELP_PAGE_ERROR
MENTION
NO_PERM
NO_SWEAR
OTH_CMD_SPY_OFF
OTH_CMD_SPY_ON
PLUGIN_PREFIX
SILENT_JOIN_MESSAGE
SILENT_LEAVE_MESSAGE
SJOIN_HIDE
SJOIN_OTHER_HIDE
SJOIN_OTHER_SHOW
SJOIN_SHOWN
STAFF_CHAT_FORMAT
STAFF_CHAT_OFF
STAFF_CHAT_ON
STOP_CHAT_MESSAGE
public class StaffChatEvent
extends org.bukkit.event.Event
+public class UltraChatEvent
extends org.bukkit.event.Event
+Note: Since API Version 2.5 this event is only needed when you want specific ultraChat information.
recipents
- The set of recipients.recipients
- The set of recipients.isComponent
in interface ChatProperties
Modifier and Type | Method and Description | |
---|---|---|
boolean |
-isComponent() |
+isComponent()
+Deprecated.
+
+As of version 2.5 this will always be true as the plugin is always in JSON mode.
+ |
boolean isComponent()+
isComponent
in interface ChatProperties
isComponent
in interface ChatProperties
GLBOAL
GLOBAL
LOCAL
public static final RangeType WORLD- + @@ -299,7 +298,6 @@ not permitted.)
public class AddonManager
extends java.lang.Object
+The instance of this class can be retrieved from UltraChatAPI.getAddonManager()
void
addAddon(PlaceholderAddon pa)
addAddon(PlaceholderAddon pa)
+java.util.List<PlaceholderAddon>
getAddons()
getAddons()
+java.lang.String
replacePlaceholders(java.lang.String s,
- java.util.UUID p)
public void addAddon(PlaceholderAddon pa)+
pa
- The addon to add.public java.util.List<PlaceholderAddon> getAddons()+
public java.lang.String replacePlaceholders(java.lang.String s, java.util.UUID p)+
s
- The string.p
- The player UUID.public class ChannelManager
extends java.lang.Object
+Get the instance of this class from UltraChatAPI.getChannelManager()
player
- player
- The player to get the channel from.player
- player
- The player to get the channel from.player
- channel
- player
- The player to set.channel
- The channel.player
- channel
- player
- The player to set.channel
- The channel.channel
- channel
- The channel.channel
- channel
- The channel to check.name
- name
- The name of the channel to checkchannel
- channel
- The channel to get the players from.channel
- channel
- The channel to get the UUIDs from.java.lang.String
getCustomFormat(int num)
getCustomFormat(java.lang.String key)
java.lang.String
public java.lang.String getDefaultFormat()- +
public java.lang.String getCustomFormat(int num)+
public java.lang.String getCustomFormat(java.lang.String key)
java.lang.String
getCustomFormat(int num)
getCustomFormat(java.lang.String key)
java.lang.String
public java.lang.String getDefaultFormat()- +
public java.lang.String getCustomFormat(int num)+
public java.lang.String getCustomFormat(java.lang.String key)