Class Resolvers

java.lang.Object
adhdmc.simplepms.handling.Resolvers

public class Resolvers extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static Resolvers
     
    (package private) net.kyori.adventure.text.minimessage.MiniMessage
     
    (package private) boolean
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static 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
    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>

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • instance

      private static Resolvers instance
    • papiEnabled

      boolean papiEnabled
    • miniMessage

      net.kyori.adventure.text.minimessage.MiniMessage miniMessage
  • Constructor Details

    • Resolvers

      private Resolvers()
  • Method Details

    • getInstance

      public static Resolvers 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 - String
      initiator - Player
      target - Player
      messageContent - 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 - String
      initiator - Component
      target - Player
      messageContent - 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 - String
      initiator - Player
      target - Component
      messageContent - String
      Returns:
      Component
    • parsePluginPrefix

      public 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>
      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 - String
      placeholderName - String
      string - String
      Returns:
      Component