public final class WorldConfig extends Object implements DynamicallyTypedMapWithDoubles<WorldConfig.Key>
Modifier and Type | Class and Description |
---|---|
static class |
WorldConfig.Key
An enum containing configuration keys used by the server.
|
Constructor and Description |
---|
WorldConfig(File directory,
File configFile)
Initialize a new ServerConfig and associated settings.
|
Modifier and Type | Method and Description |
---|---|
boolean |
getBoolean(WorldConfig.Key key)
Retrieves an entry as a
boolean . |
org.bukkit.configuration.file.YamlConfiguration |
getConfig()
The actual configuration data.
|
File |
getDirectory()
The directory configurations are stored in.
|
double |
getDouble(WorldConfig.Key key)
Retrieves an entry as a
double . |
float |
getFloat(WorldConfig.Key key)
Retrieves an entry as a
float . |
int |
getInt(WorldConfig.Key key)
Retrieves an entry as an
int . |
String |
getString(WorldConfig.Key key)
Retrieves an entry as a
String . |
void |
load()
Loads the configuration from disk if it exists.
|
void |
save()
Save the configuration back to file.
|
void |
set(WorldConfig.Key key,
Object value)
Change a configuration value at runtime.
|
public void save()
public void set(WorldConfig.Key key, Object value)
key
- the config key to write the value tovalue
- value to write to config keysave()
public String getString(WorldConfig.Key key)
DynamicallyTypedMap
String
.getString
in interface DynamicallyTypedMap<WorldConfig.Key>
key
- the key to look uppublic int getInt(WorldConfig.Key key)
DynamicallyTypedMap
int
.getInt
in interface DynamicallyTypedMap<WorldConfig.Key>
key
- the key to look uppublic double getDouble(WorldConfig.Key key)
DynamicallyTypedMapWithDoubles
double
.getDouble
in interface DynamicallyTypedMapWithDoubles<WorldConfig.Key>
key
- the key to look updouble
public float getFloat(WorldConfig.Key key)
DynamicallyTypedMapWithFloats
float
.getFloat
in interface DynamicallyTypedMapWithFloats<WorldConfig.Key>
key
- the key to look upfloat
public boolean getBoolean(WorldConfig.Key key)
DynamicallyTypedMap
boolean
.getBoolean
in interface DynamicallyTypedMap<WorldConfig.Key>
key
- the key to look uppublic void load()
public File getDirectory()
public org.bukkit.configuration.file.YamlConfiguration getConfig()
Copyright © 2021. All rights reserved.