Class TemplateConfig


  • public class TemplateConfig
    extends Object
    The list of template configurations
    • Constructor Detail

      • TemplateConfig

        public TemplateConfig​(File templateFolder)
      • TemplateConfig

        public TemplateConfig​(org.bukkit.plugin.Plugin plugin)
    • Method Detail

      • setIncludeMenuInTemplate

        public void setIncludeMenuInTemplate​(boolean includeMenuInTemplate)
        Should the menu name be included in the template name?
        Parameters:
        includeMenuInTemplate - true if the menu name should be included
      • setup

        public void setup()
        Set up the list
      • getValues

        public Map<String,​Object> getValues​(Map<String,​Object> settingMap,
                                                  List<String> ignoreKeys)
        Get the values of a template with the given setting map. The setting map includes the template name and the variables.
        Parameters:
        settingMap - the setting map
        ignoreKeys - the keys to ignore when getting the values
        Returns:
        the values
      • getValues

        public Map<String,​Object> getValues​(Map<String,​Object> settingMap,
                                                  String... ignoreKeys)
        Get the values of a template with the given setting map. The setting map includes the template name and the variables.
        Parameters:
        settingMap - the setting map
        ignoreKeys - the keys to ignore when getting the values
        Returns:
        the values
      • clear

        public void clear()
        Clear the list
      • get

        public Optional<Map<String,​Object>> get​(String name)
        Get the config values of a template
        Parameters:
        name - the name of the template
        Returns:
        the values as map
      • getAllTemplateNames

        public Collection<String> getAllTemplateNames()
        Get the names of all registered templates
        Returns:
        the names