Package studio.magemonkey.genesis.api
Class GenesisAddonConfig
java.lang.Object
studio.magemonkey.genesis.api.GenesisAddonConfig
- All Implemented Interfaces:
GenesisAddonStorage
-
Field Summary
Fields inherited from interface studio.magemonkey.genesis.api.GenesisAddonStorage
TYPE_LOCAL_FILE -
Constructor Summary
ConstructorsConstructorDescriptionGenesisAddonConfig(org.bukkit.plugin.Plugin plugin, File file) GenesisAddonConfig(org.bukkit.plugin.Plugin plugin, String fileName) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDefault(String path, Object value) Add a default path to the configbooleancontainsPath(String key) Check if a config contains a pathvoidDelete all parts of a sectionbooleangetBoolean(String path, boolean def) Get a boolean from the configorg.bukkit.configuration.file.FileConfigurationGet the addon configdoubleGet a double from the configgetFile()Get the config fileintGet an int from the configGet a string from the configgetStringList(String path) Get a string list from the configList all keys in a section of a configbooleanpasteContentFrom(GenesisAddonStorage source) Copy a file to a new filebooleanreload()Reload the addon configbooleansave()Save the addon configvoidSave the addon config asyncvoidSet a path for the config
-
Constructor Details
-
GenesisAddonConfig
-
GenesisAddonConfig
-
-
Method Details
-
save
public boolean save()Save the addon config- Specified by:
savein interfaceGenesisAddonStorage- Returns:
- saved or not
-
saveAsync
public void saveAsync()Save the addon config async- Specified by:
saveAsyncin interfaceGenesisAddonStorage
-
reload
public boolean reload()Reload the addon config- Returns:
- reloaded or not
-
getConfig
public org.bukkit.configuration.file.FileConfiguration getConfig()Get the addon config- Returns:
- addon config
-
getFile
Get the config file- Returns:
- file
-
set
Set a path for the config- Specified by:
setin interfaceGenesisAddonStorage- Parameters:
path- pathvalue- value
-
getString
Get a string from the config- Specified by:
getStringin interfaceGenesisAddonStorage- Parameters:
path- pathdef- default- Returns:
- string
-
getInt
Get an int from the config- Specified by:
getIntin interfaceGenesisAddonStorage- Parameters:
path- pathdef- default- Returns:
- int
-
getDouble
Get a double from the config- Specified by:
getDoublein interfaceGenesisAddonStorage- Parameters:
path- pathdef- default- Returns:
- double
-
getBoolean
Get a boolean from the config- Specified by:
getBooleanin interfaceGenesisAddonStorage- Parameters:
path- pathdef- default- Returns:
- boolean
-
getStringList
Get a string list from the config- Specified by:
getStringListin interfaceGenesisAddonStorage- Parameters:
path- path- Returns:
- string list
-
addDefault
Add a default path to the config- Parameters:
path- pathvalue- value
-
containsPath
Check if a config contains a path- Specified by:
containsPathin interfaceGenesisAddonStorage- Parameters:
key- path- Returns:
- contains or not
-
listKeys
List all keys in a section of a config- Specified by:
listKeysin interfaceGenesisAddonStorage- Parameters:
section- the section to checkdeep- subkeys or not- Returns:
- list of keys
-
deleteAll
Delete all parts of a section- Specified by:
deleteAllin interfaceGenesisAddonStorage- Parameters:
section- section to delete
-
pasteContentFrom
Copy a file to a new file- Specified by:
pasteContentFromin interfaceGenesisAddonStorage- Parameters:
source- the source- Returns:
- new file
-