Class SavedConfig
-
- All Implemented Interfaces:
-
org.bukkit.configuration.Configuration
,org.bukkit.configuration.ConfigurationSection
public class SavedConfig extends YamlConfiguration
Represents a YamlConfiguration that is backed by a file. Instances of this class should only be obtained using com.github.spigotbasics.core.module.AbstractBasicsModule.getConfig. It is fine to keep this object around and pass it around, it will automatically get updated on module reload instead of replaced.
-
-
Constructor Summary
Constructors Constructor Description SavedConfig(ConfigInstantiationContext context)
-
Method Summary
Modifier and Type Method Description final Unit
save()
Saves this configuration to the file. Unit
load(File file)
final Unit
reload()
final Message
getMessage(String path)
Get a Message from the config. -
Methods inherited from class org.bukkit.configuration.file.FileConfiguration
load, load, save, save
-
Methods inherited from class org.bukkit.configuration.MemorySection
contains, contains, createSection, createSection, get, get, getBoolean, getBoolean, getBooleanList, getByteList, getCharacterList, getColor, getColor, getComments, getConfigurationSection, getCurrentPath, getDefaultSection, getDouble, getDouble, getDoubleList, getFloatList, getInlineComments, getInt, getInt, getIntegerList, getItemStack, getItemStack, getKeys, getList, getList, getLocation, getLocation, getLong, getLong, getLongList, getMapList, getName, getObject, getObject, getOfflinePlayer, getOfflinePlayer, getRoot, getSerializable, getSerializable, getShortList, getString, getString, getStringList, getValues, getVector, getVector, isBoolean, isColor, isConfigurationSection, isDouble, isInt, isItemStack, isList, isLocation, isLong, isOfflinePlayer, isSet, isString, isVector, set, setComments, setInlineComments, toString
-
Methods inherited from class org.bukkit.configuration.MemoryConfiguration
addDefault, addDefaults, addDefaults, getDefaults, getParent, setDefaults
-
Methods inherited from class org.bukkit.configuration.file.YamlConfiguration
loadFromString, options, saveToString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
SavedConfig
SavedConfig(ConfigInstantiationContext context)
-
-
Method Detail
-
getMessage
final Message getMessage(String path)
Get a Message from the config. Messages can be declared as simple String (one line), a list of Strings (multiple lines) or an empty list (disabled message):
<pre> single-line: "<green>This is a single line message" multi-line: - "<green>This is a multi-line message" - "<green>With multiple lines" - "<green>And even more lines" disabled: [] # This message has been disabled </pre>- Parameters:
path
- Path to the message- Returns:
Message
-
-
-
-