Class PlaceholderService
java.lang.Object
com.github.darksoulq.abyssallib.server.translation.PlaceholderService
Provides integration between the translation system and PlaceholderAPI (PAPI).
This service allows the use of PAPI placeholders within MiniMessage tags
via the <papi:placeholder_name> syntax.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
PlaceholderService
public PlaceholderService()
-
-
Method Details
-
resolve
public static net.kyori.adventure.text.minimessage.tag.resolver.TagResolver resolve(@Nullable @Nullable org.bukkit.entity.Player player) Creates aTagResolverthat handles thepapitag.Usage in MiniMessage:
<papi:player_name>- Parameters:
player- ThePlayercontext for placeholder parsing.- Returns:
- A
TagResolverif PAPI is enabled and player is non-null, otherwise an empty resolver.
-
apply
public static String apply(@Nullable @Nullable org.bukkit.entity.Player player, @NotNull @NotNull String text) Applies PlaceholderAPI parsing to a raw string.- Parameters:
player- ThePlayercontext.text- The raw text containing%placeholder%markers.- Returns:
- The parsed string, or the original text if PAPI is unavailable.
-