Class ConfigManager
java.lang.Object
com.andrei1058.bedwars.api.configuration.ConfigManager
- Direct Known Subclasses:
Language
-
Constructor Summary
ConstructorsConstructorDescriptionConfigManager
(org.bukkit.plugin.Plugin plugin, String name, String dir) Create a new configuration file. -
Method Summary
Modifier and TypeMethodDescriptionboolean
compareArenaLoc
(org.bukkit.Location l1, org.bukkit.Location l2) Compare two arena locations Return true if same locationorg.bukkit.Location
convertStringToArenaLocation
(String string) Convert string to arena location syntaxorg.bukkit.Location
getArenaLoc
(String path) Get a location for arena use UsegetConfigLoc(String)
(String)} for locations stored usingsaveConfigLoc(String, Location)
(String, Location)}List<org.bukkit.Location>
getArenaLocations
(String path) Get list of arena locations at given pathboolean
getBoolean
(String path) Get boolean at given pathorg.bukkit.Location
getConfigLoc
(String path) Get a general location UsegetArenaLoc(String)
for locations stored usingsaveArenaLoc(String, Location)
double
int
Get Integer at given pathGet list of strings at given pathgetName()
Get config nameGet string at given pathorg.bukkit.configuration.file.YamlConfiguration
getYml()
Get yml instanceboolean
Check if the config file was created for the first time Can be used to add default valuesvoid
reload()
Reload configuration.void
save()
Save config changes to filevoid
saveArenaLoc
(String path, org.bukkit.Location loc) Save a location for arena usevoid
saveConfigLoc
(String path, org.bukkit.Location loc) Save a general location to the config.void
Set data to configvoid
Change internal name.stringLocationArenaFormat
(org.bukkit.Location loc) Convert a location to an arena location syntaxstringLocationConfigFormat
(org.bukkit.Location loc) Convert a location to a string for general use UsestringLocationArenaFormat(Location)
for arena locations
-
Constructor Details
-
ConfigManager
Create a new configuration file.- Parameters:
plugin
- config owner.name
- config name. Do not include .yml in it.
-
-
Method Details
-
reload
public void reload()Reload configuration. -
stringLocationArenaFormat
Convert a location to an arena location syntax -
stringLocationConfigFormat
Convert a location to a string for general use UsestringLocationArenaFormat(Location)
for arena locations -
saveConfigLoc
Save a general location to the config. UsesaveArenaLoc(String, Location)
for arena locations -
saveArenaLoc
Save a location for arena use -
getConfigLoc
Get a general location UsegetArenaLoc(String)
for locations stored usingsaveArenaLoc(String, Location)
-
getArenaLoc
Get a location for arena use UsegetConfigLoc(String)
(String)} for locations stored usingsaveConfigLoc(String, Location)
(String, Location)} -
convertStringToArenaLocation
Convert string to arena location syntax -
getArenaLocations
Get list of arena locations at given path -
set
Set data to config -
getYml
public org.bukkit.configuration.file.YamlConfiguration getYml()Get yml instance -
save
public void save()Save config changes to file -
getList
Get list of strings at given path- Returns:
- a list of string with colors translated
-
getBoolean
Get boolean at given path -
getInt
Get Integer at given path -
getDouble
-
getString
Get string at given path -
isFirstTime
public boolean isFirstTime()Check if the config file was created for the first time Can be used to add default values -
compareArenaLoc
public boolean compareArenaLoc(org.bukkit.Location l1, org.bukkit.Location l2) Compare two arena locations Return true if same location -
getName
Get config name -
setName
Change internal name.
-