Package org.leralix.lib.utils.config
Class ConfigUtil
java.lang.Object
org.leralix.lib.utils.config.ConfigUtil
This class is used for config related utilities.
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
addCustomConfig
(org.bukkit.plugin.Plugin plugin, String fileName, ConfigTag tag) Load a custom config file into the memorystatic org.bukkit.configuration.file.FileConfiguration
getCustomConfig
(ConfigTag tag) Get a custom config by its name.static void
saveAndUpdateResource
(org.bukkit.plugin.Plugin plugin, String fileName) static void
saveAndUpdateResource
(org.bukkit.plugin.Plugin plugin, String fileName, Collection<String> sectionBlacklist) Save and update a resource file.
-
Method Details
-
getCustomConfig
Get a custom config by its name.- Parameters:
tag
- The tag of the config file.- Returns:
- The
FileConfiguration
object.
-
addCustomConfig
Load a custom config file into the memory- Parameters:
fileName
- The name of the file to load
-
saveAndUpdateResource
-
saveAndUpdateResource
public static void saveAndUpdateResource(org.bukkit.plugin.Plugin plugin, String fileName, Collection<String> sectionBlacklist) Save and update a resource file. If some lines are missing in the current file, they will be added at the correct position.- Parameters:
fileName
- The name of the resource file.
-