Class MessageUtils.Placeholders

java.lang.Object
me.devtec.amazingtags.utils.MessageUtils.Placeholders
Enclosing class:
MessageUtils

public static class MessageUtils.Placeholders extends Object
Utility class used in our MessageUtils class methods.
Add placeholders like %player%, %money% and this class will handle the replacing!
In String text placeholders looks like %your_placeholder% but "%" is added automatically when you are adding placeholder!!
  • Constructor Details

    • Placeholders

      public Placeholders()
  • Method Details

    • c

      public static MessageUtils.Placeholders c()
    • add

      public MessageUtils.Placeholders add(String placeholder, Object replace)
      Method used to add new replaceable placeholder
      Parameters:
      placeholder - - Placeholder in the message (example: %player% as player)
      replace - - What the placeholder should be replaced with
      Returns:
      Method returns this instance
    • addPlayer

      public MessageUtils.Placeholders addPlayer(String placeholder, org.bukkit.entity.Player player)
      Method used to add new replaceable player placeholder. Placeholder %player_...% is replaced automatically!
      Parameters:
      placeholder - - Placeholder in the message (example: %target% as some other player)
      replace - - Which player the placeholder should be replaced with
      Returns:
      Method returns this instance
    • addPlayer

      public MessageUtils.Placeholders addPlayer(String placeholder, org.bukkit.command.CommandSender player)
      Method used to add new replaceable player placeholder. Placeholder %player_...% is replaced automatically!
      Parameters:
      placeholder - - Placeholder in the message (example: %target% as some other player)
      replace - - Which player the placeholder should be replaced with
      Returns:
      Method returns this instance
    • addOffline

      public MessageUtils.Placeholders addOffline(String palceholder, String player)
      Method used to add new replaceable offline player placeholder. Placeholder %player_...% is replaced automatically!
      Parameters:
      placeholder - - Placeholder in the message (example: %target% as some other player)
      replace - - Which player the placeholder should be replaced with
      Returns:
      Method returns this instance
    • replace

      public MessageUtils.Placeholders replace(String placeholder, Object replace)
      Method used to add new replaceable placeholder
      Parameters:
      placeholder - - Placeholder in the message (example: %player% as player)
      replace - - What the placeholder should be replaced with
      Returns:
      Method returns this instance
    • apply

      public String apply(String text)
      Method used to apply placeholders in message
      Parameters:
      sender - - The player to whom you are sending the message
      text - - Message where you want to replace placeholders
      placeholders -
      Returns:
      Returning edited text