Package adhdmc.simplepms.handling
Class Resolvers
java.lang.Object
adhdmc.simplepms.handling.Resolvers
-
Field Summary
Modifier and TypeFieldDescriptionprivate static Resolvers
(package private) net.kyori.adventure.text.minimessage.MiniMessage
(package private) boolean
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Resolvers
@NotNull net.kyori.adventure.text.minimessage.tag.resolver.TagResolver
papiTag
(@NotNull org.bukkit.entity.Player player) Creates a tag resolver capable of resolving PlaceholderAPI tags for a given player.net.kyori.adventure.text.Component
parseMessageConsoleToPlayer
(String message, net.kyori.adventure.text.Component initiator, org.bukkit.entity.Player target, String messageContent) Parses a message from the console to a player.net.kyori.adventure.text.Component
parseMessagePlayerToConsole
(String message, org.bukkit.entity.Player initiator, net.kyori.adventure.text.Component target, String messageContent) Parses a message from a Player to the Console.net.kyori.adventure.text.Component
parseMessagePlayerToPlayer
(String message, org.bukkit.entity.Player initiator, org.bukkit.entity.Player target, String messageContent) Parses a message between 2 players.net.kyori.adventure.text.Component
parsePluginPrefix
(String message) Parses the placeholder for the plugin prefix from the given message Uses the default placeholders:<plugin_prefix>
net.kyori.adventure.text.Component
parsePluginPrefixAndString
(String message, String placeholderName, String string) Parses the plugin prefix and an additional placeholder, using the provided 'placeholderName' and 'string' Uses the default placeholders:<plugin_prefix>
-
Field Details
-
instance
-
papiEnabled
boolean papiEnabled -
miniMessage
net.kyori.adventure.text.minimessage.MiniMessage miniMessage
-
-
Constructor Details
-
Resolvers
private Resolvers()
-
-
Method Details
-
getInstance
-
papiTag
@NotNull public @NotNull net.kyori.adventure.text.minimessage.tag.resolver.TagResolver papiTag(@NotNull @NotNull org.bukkit.entity.Player player) Creates a tag resolver capable of resolving PlaceholderAPI tags for a given player.- Parameters:
player
- the player- Returns:
- the tag resolver
-
parseMessagePlayerToPlayer
public net.kyori.adventure.text.Component parseMessagePlayerToPlayer(String message, org.bukkit.entity.Player initiator, org.bukkit.entity.Player target, String messageContent) Parses a message between 2 players. Will parse PAPI placeholders if placeholderAPI is on the server Uses the default placeholders:<plugin_prefix>
<target>
<initiator>
<message>
- Parameters:
message
- Stringinitiator
- Playertarget
- PlayermessageContent
- String- Returns:
- Component
-
parseMessageConsoleToPlayer
public net.kyori.adventure.text.Component parseMessageConsoleToPlayer(String message, net.kyori.adventure.text.Component initiator, org.bukkit.entity.Player target, String messageContent) Parses a message from the console to a player. Will parse PAPI placeholders if placeholderAPI is on the server Uses the default placeholders:<plugin_prefix>
<target>
<initiator>
<message>
- Parameters:
message
- Stringinitiator
- Componenttarget
- PlayermessageContent
- String- Returns:
- Component
-
parseMessagePlayerToConsole
public net.kyori.adventure.text.Component parseMessagePlayerToConsole(String message, org.bukkit.entity.Player initiator, net.kyori.adventure.text.Component target, String messageContent) Parses a message from a Player to the Console. Will parse PAPI placeholders if placeholderAPI is on the server Uses the default placeholders:<plugin_prefix>
<target>
<initiator>
<message>
- Parameters:
message
- Stringinitiator
- Playertarget
- ComponentmessageContent
- String- Returns:
- Component
-
parsePluginPrefix
Parses the placeholder for the plugin prefix from the given message Uses the default placeholders:<plugin_prefix>
- Parameters:
message
- String- Returns:
- Component
-
parsePluginPrefixAndString
public net.kyori.adventure.text.Component parsePluginPrefixAndString(String message, String placeholderName, String string) Parses the plugin prefix and an additional placeholder, using the provided 'placeholderName' and 'string' Uses the default placeholders:<plugin_prefix>
- Parameters:
message
- StringplaceholderName
- Stringstring
- String- Returns:
- Component
-