mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-29 04:17:44 +01:00
JavaPlugin now loads the configuration file on load. getConfiguration() now is much cheaper to call.
By: sk89q <the.sk89q@gmail.com>
This commit is contained in:
parent
ab5b99600c
commit
df7a15f4f9
@ -19,6 +19,7 @@ public abstract class JavaPlugin implements Plugin {
|
||||
private final PluginDescriptionFile description;
|
||||
private final File dataFolder;
|
||||
private final ClassLoader classLoader;
|
||||
private final Configuration config;
|
||||
|
||||
/**
|
||||
* Constructs a new Java plugin instance
|
||||
@ -39,6 +40,8 @@ public abstract class JavaPlugin implements Plugin {
|
||||
description = desc;
|
||||
dataFolder = folder;
|
||||
classLoader = cLoader;
|
||||
config = new Configuration(new File(dataFolder, "config.yml"));
|
||||
config.load();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -105,9 +108,6 @@ public abstract class JavaPlugin implements Plugin {
|
||||
* @return
|
||||
*/
|
||||
public Configuration getConfiguration() {
|
||||
Configuration config =
|
||||
new Configuration(new File(dataFolder, "config.yml"));
|
||||
config.load();
|
||||
return config;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user