Class ChatData
java.lang.Object
studio.magemonkey.codex.mccore.chat.ChatData
- All Implemented Interfaces:
ISavable
Contains player data for the chat
-
Method Summary
Modifier and TypeMethodDescriptionvoidclearPluginPrefix(String pluginName) Clears the prefix assigned to the plugin with the given nameRetrieves the player's chat tag (e.g.Retrieves the current prefix used by the playerRetrieves the current prefix for the given plugingetUnlockedPrefixes(String pluginName) Retrieves a list of all prefixes unlocked through a pluginbooleanChecks if the prefix has been obtained for the given pluginbooleanremovePrefix(String pluginName, String prefixText) Removes the prefix from the player, making them unable to use it anymorevoidremovePrefixes(String pluginName) Removes all prefixes unlocked through the given pluginvoidSaves the player data to the config filevoidsetDisplayName(String displayName) Sets the player's display namevoidsetPluginPrefix(Prefix prefix) Sets the prefix for a plugin Use this only for game-changing prefixes.booleanunlockPrefix(Prefix prefix, boolean apply) Unlocks the given prefix
-
Method Details
-
getChatTag
Retrieves the player's chat tag (e.g. <[Prefix] DisplayName>)- Returns:
- the player's chat tag
-
getDisplayName
- Returns:
- player display name
-
setDisplayName
Sets the player's display name- Parameters:
displayName- display name
-
getPrefix
Retrieves the current prefix used by the player- Returns:
- prefix chosen by player or null if none are applied
-
getPrefix
Retrieves the current prefix for the given plugin- Parameters:
pluginName- name of the plugin- Returns:
- prefix currently assigned by the plugin
-
getUnlockedPrefixes
Retrieves a list of all prefixes unlocked through a plugin- Parameters:
pluginName- name of the plugin that gives the prefixes- Returns:
- list of all unlocked prefixes from the plugin
-
unlockPrefix
Unlocks the given prefix- Parameters:
prefix- prefix to unlockapply- whether or not to apply it right away- Returns:
- true if successful, false if already unlocked
-
removePrefix
Removes the prefix from the player, making them unable to use it anymore- Parameters:
pluginName- name of the plugin that gives the prefixprefixText- prefix text (with or without color)- Returns:
- true if removed, false if it wasn't unlocked
-
removePrefixes
Removes all prefixes unlocked through the given plugin- Parameters:
pluginName- name of the plugin with the prefixes
-
setPluginPrefix
Sets the prefix for a plugin Use this only for game-changing prefixes. If it doesn't need to be displayed, use unlockPrefix(CPrefix, boolean) instead.- Parameters:
prefix- prefix data
-
clearPluginPrefix
Clears the prefix assigned to the plugin with the given name- Parameters:
pluginName- name of the plugin with the prefix
-
hasPrefix
Checks if the prefix has been obtained for the given plugin- Parameters:
prefixText- the text of the prefix (with or without color)- Returns:
- true if the prefix is unlocked
-
save
Saves the player data to the config file
-