Interface PlaceholderReplacer


public interface PlaceholderReplacer
占位符替换器接口 - 处理文本中的占位符替换
Since:
1.0.0
Version:
1.0.0
Author:
Berry_so
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull Set<String>
    getPlaceholders(@NotNull String text)
    获取文本中的所有变量
    boolean
    hasPlaceholders(@NotNull String text)
    检查文本是否包含变量
    @NotNull String
    replace(@NotNull String text, @Nullable org.bukkit.entity.Player player)
    替换文本中的变量
  • Method Details

    • replace

      @NotNull @NotNull String replace(@NotNull @NotNull String text, @Nullable @Nullable org.bukkit.entity.Player player)
      替换文本中的变量
      Parameters:
      text - 原始文本
      player - 玩家对象,可能为null
      Returns:
      替换后的文本
    • hasPlaceholders

      boolean hasPlaceholders(@NotNull @NotNull String text)
      检查文本是否包含变量
      Parameters:
      text - 文本
      Returns:
      true表示包含变量,false表示不包含
    • getPlaceholders

      @NotNull @NotNull Set<String> getPlaceholders(@NotNull @NotNull String text)
      获取文本中的所有变量
      Parameters:
      text - 文本
      Returns:
      变量标识符集合