public class Config
extends java.lang.Object
| Constructor and Description |
|---|
Config(java.io.File file)
Creates a new Config Object for the specified File
|
Config(org.bukkit.plugin.Plugin plugin)
Creates a new Config Object for the config.yml File of
the specified Plugin
|
Config(java.lang.String path)
Creates a new Config Object for the File with in
the specified Location
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(java.lang.String path)
Checks whether the Config contains the specified Path
|
void |
createFile()
Recreates the File of this Config
|
boolean |
getBoolean(java.lang.String path)
Returns the Boolean at the specified Path
|
org.bukkit.Chunk |
getChunk(java.lang.String path)
Returns the Chunk at the specified Path
|
org.bukkit.configuration.file.FileConfiguration |
getConfiguration()
Converts this Config Object into a plain FileConfiguration Object
|
java.util.Date |
getDate(java.lang.String path)
Returns the Date at the specified Path
|
java.lang.Double |
getDouble(java.lang.String path)
Returns the Double at the specified Path
|
java.io.File |
getFile()
Returns the File the Config is handling
|
java.lang.Float |
getFloat(java.lang.String path)
Returns the Float at the specified Path
|
int |
getInt(java.lang.String path)
Returns the Integer at the specified Path
|
java.util.List<java.lang.Integer> |
getIntList(java.lang.String path)
Returns the IntegerList at the specified Path
|
org.bukkit.inventory.Inventory |
getInventory(java.lang.String path,
int size,
java.lang.String title)
Gets the Contents of an Inventory at the specified Path
|
org.bukkit.inventory.ItemStack |
getItem(java.lang.String path)
Returns the ItemStack at the specified Path
|
java.util.List<org.bukkit.inventory.ItemStack> |
getItemList(java.lang.String path)
Returns the ItemList at the specified Path
|
java.util.Set<java.lang.String> |
getKeys()
Returns all Paths in this Config
|
java.util.Set<java.lang.String> |
getKeys(java.lang.String path)
Returns all Sub-Paths in this Config
|
org.bukkit.Location |
getLocation(java.lang.String path)
Returns the Location at the specified Path
|
java.lang.Long |
getLong(java.lang.String path)
Returns the Long at the specified Path
|
int |
getRandomIntfromList(java.lang.String path)
Returns a randomly chosen Integer from an
ArrayList at the specified Path
|
java.lang.String |
getRandomStringfromList(java.lang.String path)
Returns a randomly chosen String from an
ArrayList at the specified Path
|
org.bukkit.Sound |
getSound(java.lang.String path)
Returns the Sound at the specified Path
|
java.lang.String |
getString(java.lang.String path)
Returns the String at the specified Path
|
java.util.List<java.lang.String> |
getStringList(java.lang.String path)
Returns the StringList at the specified Path
|
java.util.UUID |
getUUID(java.lang.String path)
Returns the UUID at the specified Path
|
java.lang.Object |
getValue(java.lang.String path)
Returns the Object at the specified Path
|
org.bukkit.World |
getWorld(java.lang.String path)
Returns the World at the specified Path
|
void |
reload()
Reloads the Configuration File
|
void |
save()
Saves the Config Object to its File
|
void |
save(java.io.File file)
Saves the Config Object to a File
|
void |
setDefaultValue(java.lang.String path,
java.lang.Object value)
Sets the Value for the specified Path
(IF the Path does not yet exist)
|
void |
setInventory(java.lang.String path,
org.bukkit.inventory.Inventory inventory)
Deprecated.
|
void |
setLocation(java.lang.String path,
org.bukkit.Location location)
Deprecated.
|
void |
setValue(java.lang.String path,
java.lang.Object value)
Sets the Value for the specified Path
|
public Config(org.bukkit.plugin.Plugin plugin)
plugin - The Instance of the Plugin, the config.yml is referring topublic Config(java.io.File file)
file - The File for which the Config object is created forpublic Config(java.lang.String path)
path - The Path of the File which the Config object is created forpublic java.io.File getFile()
public org.bukkit.configuration.file.FileConfiguration getConfiguration()
public void setValue(java.lang.String path,
java.lang.Object value)
path - The path in the Config Filevalue - The Value for that Pathpublic void save()
public void save(java.io.File file)
file - The File you are saving this Config topublic void setDefaultValue(java.lang.String path,
java.lang.Object value)
path - The path in the Config Filevalue - The Value for that Pathpublic boolean contains(java.lang.String path)
path - The path in the Config Filepublic java.lang.Object getValue(java.lang.String path)
path - The path in the Config Filepublic org.bukkit.inventory.ItemStack getItem(java.lang.String path)
path - The path in the Config Filepublic java.lang.String getRandomStringfromList(java.lang.String path)
path - The path in the Config Filepublic int getRandomIntfromList(java.lang.String path)
path - The path in the Config Filepublic java.lang.String getString(java.lang.String path)
path - The path in the Config Filepublic int getInt(java.lang.String path)
path - The path in the Config Filepublic boolean getBoolean(java.lang.String path)
path - The path in the Config Filepublic java.util.List<java.lang.String> getStringList(java.lang.String path)
path - The path in the Config Filepublic java.util.List<org.bukkit.inventory.ItemStack> getItemList(java.lang.String path)
path - The path in the Config Filepublic java.util.List<java.lang.Integer> getIntList(java.lang.String path)
path - The path in the Config Filepublic void createFile()
public java.lang.Float getFloat(java.lang.String path)
path - The path in the Config Filepublic java.lang.Long getLong(java.lang.String path)
path - The path in the Config Filepublic org.bukkit.Sound getSound(java.lang.String path)
path - The path in the Config Filepublic java.util.Date getDate(java.lang.String path)
path - The path in the Config Filepublic org.bukkit.Chunk getChunk(java.lang.String path)
path - The path in the Config Filepublic java.util.UUID getUUID(java.lang.String path)
path - The path in the Config Filepublic org.bukkit.World getWorld(java.lang.String path)
path - The path in the Config Filepublic java.lang.Double getDouble(java.lang.String path)
path - The path in the Config Filepublic org.bukkit.Location getLocation(java.lang.String path)
path - The path in the Config File@Deprecated
public void setLocation(java.lang.String path,
org.bukkit.Location location)
@Deprecated
public void setInventory(java.lang.String path,
org.bukkit.inventory.Inventory inventory)
public org.bukkit.inventory.Inventory getInventory(java.lang.String path,
int size,
java.lang.String title)
path - The path in the Config Filesize - The Size of the Inventorytitle - The Title of the Inventorypublic java.util.Set<java.lang.String> getKeys()
public java.util.Set<java.lang.String> getKeys(java.lang.String path)
path - The path in the Config Filepublic void reload()