Package io.github.bakedlibs.dough.config
Class Config
java.lang.Object
io.github.bakedlibs.dough.config.Config
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new Config Object for the specified FileConfig(File file, FileConfiguration config) Creates a new Config Object for the specified File and FileConfigurationCreates a new Config Object for the File with in the specified LocationCreates a new Config Object for the config.yml File of the specified Plugin -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()booleanChecks whether the Config contains the specified pathbooleanRecreates the File of this ConfigbooleangetBoolean(String path) Returns the Boolean at the specified pathReturns the Chunk at the specified pathConverts this Config Object into a plain FileConfiguration ObjectReturns the Date at the specified pathdoubleReturns the Double at the specified pathgetFile()floatReturns the Float at the specified pathintReturns the Integer at the specified pathgetIntList(String path) Returns the IntegerList at the specified pathgetInventory(String path, int size, String title) Gets the Contents of an Inventory at the specified pathgetInventory(String path, String title) Gets the Contents of an Inventory at the specified pathReturns the ItemStack at the specified pathgetKeys()Returns all paths in this ConfigReturns all sub-paths in this ConfiggetLocation(String path) Returns the Location at the specified pathlongReturns the Long at the specified path<T> TgetOrSetDefault(String path, T value) Returns the String at the specified pathgetStringList(String path) Returns the StringList at the specified pathReturns the UUID at the specified pathReturns the Object at the specified path<T> Optional<T>getValueAs(Class<T> c, String path) Returns the World at the specified pathvoidreload()Reloads the Configuration Filevoidsave()voidvoidsetDefaultValue(String path, Object value) Sets the Value for the specified path (If the path does not yet exist)voidvoidvoidSets the Value for the specified pathprotected void
-
Field Details
-
fileConfig
-
-
Constructor Details
-
Config
Creates a new Config Object for the config.yml File of the specified Plugin- Parameters:
plugin- The Instance of the Plugin, the config.yml is referring to
-
Config
-
Config
Creates a new Config Object for the specified File and FileConfiguration- Parameters:
file- The File to save toconfig- The FileConfiguration
-
Config
Creates a new Config Object for the specified File- Parameters:
file- The File for which the Config object is created for
-
Config
Creates a new Config Object for the File with in the specified Location- Parameters:
path- The path of the File which the Config object is created for
-
-
Method Details
-
getFile
-
getHeader
-
setHeader
-
getConfiguration
Converts this Config Object into a plain FileConfiguration Object- Returns:
- The converted FileConfiguration Object
-
setLogger
- Parameters:
logger- YourLoggerinstance
-
clear
public void clear() -
store
-
setValue
Sets the Value for the specified path- Parameters:
path- The path in the Config Filevalue- The Value for that path
-
save
public void save() -
save
-
setDefaultValue
Sets the Value for the specified path (If the path does not yet exist)- Parameters:
path- The path in theConfigfilevalue- The Value for that path
-
getOrSetDefault
-
contains
Checks whether the Config contains the specified path- Parameters:
path- The path in the Config File- Returns:
- True/false
-
getValue
Returns the Object at the specified path- Parameters:
path- The path in the Config File- Returns:
- The Value at that path
-
getValueAs
-
getItem
Returns the ItemStack at the specified path- Parameters:
path- The path in the Config File- Returns:
- The ItemStack at that path
-
getString
Returns the String at the specified path- Parameters:
path- The path in the Config File- Returns:
- The String at that path
-
getInt
Returns the Integer at the specified path- Parameters:
path- The path in the Config File- Returns:
- The Integer at that path
-
getBoolean
Returns the Boolean at the specified path- Parameters:
path- The path in the Config File- Returns:
- The Boolean at that path
-
getStringList
Returns the StringList at the specified path- Parameters:
path- The path in the Config File- Returns:
- The StringList at that path
-
getIntList
Returns the IntegerList at the specified path- Parameters:
path- The path in the Config File- Returns:
- The IntegerList at that path
-
createFile
public boolean createFile()Recreates the File of this Config- Returns:
- Returns if the file was successfully created
-
getFloat
Returns the Float at the specified path- Parameters:
path- The path in the Config File- Returns:
- The Float at that path
-
getLong
Returns the Long at the specified path- Parameters:
path- The path in the Config File- Returns:
- The Long at that path
-
getDate
Returns the Date at the specified path- Parameters:
path- The path in the Config File- Returns:
- The Date at that path
-
getChunk
Returns the Chunk at the specified path- Parameters:
path- The path in the Config File- Returns:
- The Chunk at that path
-
getUUID
Returns the UUID at the specified path- Parameters:
path- The path in the Config File- Returns:
- The UUID at that path
-
getWorld
Returns the World at the specified path- Parameters:
path- The path in the Config File- Returns:
- The World at that path
-
getDouble
Returns the Double at the specified path- Parameters:
path- The path in the Config File- Returns:
- The Double at that path
-
getLocation
Returns the Location at the specified path- Parameters:
path- The path in the Config File- Returns:
- The Location at that path
-
getInventory
Gets the Contents of an Inventory at the specified path- Parameters:
path- The path in the Config Filesize- The Size of the Inventorytitle- The Title of the Inventory- Returns:
- The generated Inventory
-
getInventory
Gets the Contents of an Inventory at the specified path- Parameters:
path- The path in the Config Filetitle- The title of the inventory, this can accept & for color codes.- Returns:
- The generated Inventory
-
getKeys
Returns all paths in this Config- Returns:
- All paths in this Config
-
getKeys
Returns all sub-paths in this Config- Parameters:
path- The path in the Config File- Returns:
- All sub-paths of the specified path
-
reload
public void reload()Reloads the Configuration File
-