Package io.github.slaim36.emoteschat.api
Class Emotes
java.lang.Object
io.github.slaim36.emoteschat.api.Emotes
A class that controls the emotes.
- Since:
- 1.2
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Adds and emote to the list.getEmoteByCode
(String code) Returns an emote by its code from the list.getEmoteByName
(String name) Returns an emote by its name from the list.Returns all the emotes in a list.boolean
isEmotePresent
(Emote emote) Checks if an emote is in the list.boolean
isEmotePresentByCode
(String code) Checks if an emote is in the list by its code.boolean
isEmotePresentByName
(String name) Checks if an emote is in the list by its name.Parses a string by adding emojis to it using PAPI (if installed).parseTextWithoutPAPI
(String text, boolean checkPerms, org.bukkit.entity.Player player) Parses a string by adding emojis to it without using PAPI.void
reload
(org.bukkit.configuration.file.FileConfiguration config) Called when emoteschat is reloaded (only internal use)boolean
removeEmote
(Emote emote) Removes and emote from the list.boolean
removeEmoteByCode
(String code) Removes and emote from the list by its code.boolean
removeEmoteByName
(String name) Removes and emote from the list by its name.
-
Field Details
-
instance
The instance of the class- Since:
- 1.2
-
-
Constructor Details
-
Emotes
public Emotes(org.bukkit.configuration.file.FileConfiguration config) Do not use.
Instantiates the emotes class.
- Parameters:
config
- Config file.- Since:
- 1.2
-
-
Method Details
-
addEmote
Adds and emote to the list.- Parameters:
emote
- Emote to add.- Returns:
- True if the emote was added successfully, and it wasn't already in the list.
- Since:
- 1.2
-
reload
public void reload(org.bukkit.configuration.file.FileConfiguration config) Called when emoteschat is reloaded (only internal use)- Parameters:
config
- Plugin config- Since:
- 1.3
-
removeEmote
Removes and emote from the list.- Parameters:
emote
- Emote to remove.- Returns:
- True if the emote was removed successfully, false it wasn't in the list.
- Since:
- 1.2
-
removeEmoteByName
Removes and emote from the list by its name.- Parameters:
name
- Name of the emote to remove.- Returns:
- True if the emote was removed successfully, false it wasn't in the list.
- Since:
- 1.2
-
removeEmoteByCode
Removes and emote from the list by its code.- Parameters:
code
- Code of the emote to remove.- Returns:
- True if the emote was removed successfully, false it wasn't in the list.
- Since:
- 1.2
-
isEmotePresent
Checks if an emote is in the list.- Parameters:
emote
- Emote to check.- Returns:
- True if the emote was in the list.
- Since:
- 1.2
-
isEmotePresentByName
Checks if an emote is in the list by its name.- Parameters:
name
- Name of the emote to check.- Returns:
- True if the emote was in the list.
- Since:
- 1.2
-
isEmotePresentByCode
Checks if an emote is in the list by its code.- Parameters:
code
- Code of the emote to check.- Returns:
- True if the emote was in the list.
- Since:
- 1.2
-
getEmoteByName
Returns an emote by its name from the list.- Parameters:
name
- Name of the emote to search.- Returns:
- An emote.
- Since:
- 1.2
-
getEmoteByCode
Returns an emote by its code from the list.- Parameters:
code
- Code of the emote to search.- Returns:
- An emote.
- Since:
- 1.2
-
getEmotesList
Returns all the emotes in a list.- Returns:
- A list with all emotes.
- Since:
- 1.2
-
parseTextWithoutPAPI
public String parseTextWithoutPAPI(String text, boolean checkPerms, org.bukkit.entity.Player player) Parses a string by adding emojis to it without using PAPI.- Parameters:
text
- The text to parse.checkPerms
- Check the permissions of the provided player in order to verify if they can use each emote.player
- Player to check permission (can be null).- Returns:
- A parsed string.
- Since:
- 1.3
-
parseText
Parses a string by adding emojis to it using PAPI (if installed).- Parameters:
text
- The text to parse.checkPerms
- Check the permissions of the provided player in order to verify if they can use each emote.player
- Player to check permission (can be null).- Returns:
- A parsed string.
- Since:
- 1.3
-