Class LegacyPapiHookerImpl

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
      LegacyPapiHookerImpl() 启用低版本PlaceholderAPI挂钩
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      String papi(OfflinePlayer player, String text) 解析一段文本中的papi变量, 不解析其中的颜色代码 在以往的众多版本中, papi都会强制解析文本中的代码 在2.11.
      String toSection(String text) 将文本中的所有papi变量改写为papi节点, 仅转换已注册的papi变量
      Boolean hasPapi(String text) 判断文本中是否存在有效papi变量
      String request(OfflinePlayer player, String identifier, String parameters) 例:%player_name% identifier -> player parameters -> name
      Unit unregisterExpansion(PlaceholderExpansion expansion) 卸载papi扩展
      • Methods inherited from class pers.neige.neigeitems.hook.placeholderapi.PapiHooker

        newPlaceholderExpansion, toSection
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LegacyPapiHookerImpl

        LegacyPapiHookerImpl()
        启用低版本PlaceholderAPI挂钩
    • Method Detail

      • papi

         String papi(OfflinePlayer player, String text)

        解析一段文本中的papi变量, 不解析其中的颜色代码 在以往的众多版本中, papi都会强制解析文本中的代码 在2.11.2版本中, papi移除了该功能 不过, 管他呢, 自己实现就完事儿了

        Parameters:
        player - 用于解析PAPI变量的玩家对象
        text - 待解析文本
        Returns:

        解析后文本

      • toSection

         String toSection(String text)

        将文本中的所有papi变量改写为papi节点, 仅转换已注册的papi变量

        Parameters:
        text - 待转换文本
        Returns:

        转换后文本

      • hasPapi

         Boolean hasPapi(String text)

        判断文本中是否存在有效papi变量

        Parameters:
        text - 待检测文本
        Returns:

        是否存在有效papi变量

      • request

         String request(OfflinePlayer player, String identifier, String parameters)

        例:%player_name% identifier -> player parameters -> name

        Parameters:
        player - 用于解析PAPI变量的玩家对象
        identifier - PAPI标识符
        parameters - PAPI参数
        Returns:

        解析后文本