Class PlanPlaceholders

    • Constructor Detail

      • PlanPlaceholders

        @Inject
        public PlanPlaceholders​(DBSystem dbSystem,
                                java.util.Set<Placeholders> placeholderRegistries)
    • Method Detail

      • registerStatic

        public void registerStatic​(java.lang.String name,
                                   java.util.function.Supplier<java.io.Serializable> loader)
      • register

        public void register​(java.lang.String name,
                             java.util.function.Function<PlayerContainer,​java.io.Serializable> loader)
      • registerRaw

        public void registerRaw​(java.lang.String name,
                                java.util.function.BiFunction<java.lang.String,​PlayerContainer,​java.io.Serializable> loader)
      • onPlaceholderRequest

        public java.lang.String onPlaceholderRequest​(java.util.UUID uuid,
                                                     java.lang.String placeholder,
                                                     java.util.List<java.lang.String> parameters)
      • onPlaceholderRequest

        public java.lang.String onPlaceholderRequest​(PlayerContainer player,
                                                     java.lang.String placeholder,
                                                     java.util.List<java.lang.String> parameters)
        Look up the placeholder and check if it is registered.
        Parameters:
        player - the player who is viewing the placeholder
        placeholder - the placeholder to look up to.
        parameters - additional placeholder parameters
        Returns:
        the value of the placeholder if found, or empty String if no value found but the placeholder is registered, otherwise null