Package valorless.valorlessutils.config
Class Config
java.lang.Object
valorless.valorlessutils.config.Config
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionclassRepresents a key-value entry for configuration validation.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidAddValidationEntry(String key, Object value) Adds a key-value pair to the validation list.<T extends Number>
 voidAddValidationEntry(String key, Vector2<T> value) Adds a Vector2 entry to the validation list.<T extends Number>
 voidAddValidationEntry(String key, Vector3<T> value) Adds a Vector3 entry to the validation list.Retrieves a generic object from the config.Retrieves a boolean from the config.org.bukkit.configuration.ConfigurationSectionRetrieves aConfigurationSectionfrom the config.Retrieves a double from the config.GetDoubleList(String key) Retrieves a list of doubles from the config.GetFile()Returns the underlyingYamlFileinstance.Deprecated.This method is outdated and will be removed in future versions.Retrieves an integer from the config.GetIntList(String key) Retrieves a list of integers from the config.org.bukkit.inventory.ItemStackGetItemStack(String key) Retrieves anItemStackfrom the config.List<?>Retrieves a generic list from the config.org.bukkit.MaterialGetMaterial(String key) Retrieves aMaterialfrom the config.Retrieves a String from the config.GetStringList(String key) Retrieves a list of strings from the config.GetVector2(String key) Retrieves aVector2from the config.GetVector3(String key) Retrieves aVector3from the config.Checks if a key exists in the config.voidReload()Reloads the configuration file and validates it.voidSaves the configuration file.voidSets a key-value pair in the config.<T extends Number>
 voidSetVector2(String key, Vector2<T> value) Sets aVector2value in the config.<T extends Number>
 voidSetVector3(String key, Vector3<T> value) Sets aVector3value in the config.voidValidate()Validates the configuration file against the validation list.
- 
Constructor Details- 
ConfigConstructs a new Config object.If the file does not exist, it will be copied from the plugin's resources. - Parameters:
- plugin- The JavaPlugin instance.
- file- The name of the configuration file.
 
 
- 
- 
Method Details- 
SetSets a key-value pair in the config.
- 
SetVector2Sets aVector2value in the config.
- 
SetVector3Sets aVector3value in the config.
- 
GetStringRetrieves a String from the config.
- 
GetBoolRetrieves a boolean from the config.
- 
GetIntRetrieves an integer from the config.
- 
GetFloatDeprecated.This method is outdated and will be removed in future versions.Retrieves a float (double) value from the config.
- 
GetDoubleRetrieves a double from the config.
- 
GetVector2Retrieves aVector2from the config.
- 
GetVector3Retrieves aVector3from the config.
- 
GetMaterialRetrieves aMaterialfrom the config.
- 
GetRetrieves a generic object from the config.
- 
GetStringListRetrieves a list of strings from the config.
- 
GetIntListRetrieves a list of integers from the config.
- 
GetDoubleListRetrieves a list of doubles from the config.
- 
GetListRetrieves a generic list from the config.
- 
GetItemStackRetrieves anItemStackfrom the config.
- 
HasKeyChecks if a key exists in the config.
- 
GetConfigurationSectionRetrieves aConfigurationSectionfrom the config.
- 
GetFileReturns the underlyingYamlFileinstance.
- 
Reloadpublic void Reload()Reloads the configuration file and validates it.
- 
SaveConfigpublic void SaveConfig()Saves the configuration file.
- 
AddValidationEntryAdds a key-value pair to the validation list.
- 
AddValidationEntryAdds a Vector2 entry to the validation list.
- 
AddValidationEntryAdds a Vector3 entry to the validation list.
- 
Validatepublic void Validate()Validates the configuration file against the validation list.Adds missing keys with their default values and saves the file if necessary. Logs any added or missing entries. 
 
-