Package io.github.slaim36.emoteschat.api
Class Emote
java.lang.Object
io.github.slaim36.emoteschat.api.Emote
Represents an emote object.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
canUse
(org.bukkit.entity.Player player) Check if a player can use the current emote.getCode()
Returns current emote code.getEmote()
Returns current emote.getEmoteWithPAPI
(org.bukkit.OfflinePlayer player) Returns current emote with parsed placeholders (if PAPI installed).getName()
Returns current emote name.
-
Constructor Details
-
Emote
Returns a new emote by just searching for its name in a config file.The path to search is "config.emotes.%name%.%property%" where name is the emote name and property is the property to search.
- Parameters:
name
- Name of the emote.config
- Config file.- Since:
- 1.2
-
Emote
Returns a new emote by inputting each property.- Parameters:
name
- Name of the emote.code
- Code of the emote.emote
- Emote (string to replace code).permission
- Permission of the emote (maybe null if not needed).- Since:
- 1.2
-
-
Method Details
-
getCode
Returns current emote code. Example: ":happy:"- Returns:
- Current emote code.
- Since:
- 1.2
-
getEmote
Returns current emote. Example: "☺"- Returns:
- Current emote.
- Since:
- 1.2
-
getEmoteWithPAPI
Returns current emote with parsed placeholders (if PAPI installed). Example: "☺"- Parameters:
player
- The player used to parse placeholders (can be null).- Returns:
- Current emote with parsed placeholders (if PAPI installed).
- Since:
- 1.3
-
getName
Returns current emote name. Example: "happy"- Returns:
- Current emote name.
- Since:
- 1.2
-
canUse
public boolean canUse(org.bukkit.entity.Player player) Check if a player can use the current emote.- Parameters:
player
- The player used to check permission.- Returns:
- True if the player has permission to use the current emote, or if it doesn't need any permission to be used.
- Since:
- 1.2
-