mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2025-02-05 22:31:26 +01:00
Changed config file constructor
This commit is contained in:
parent
3f7f537fc0
commit
b702801d2b
@ -24,6 +24,9 @@ import cc.co.evenprime.bukkit.nocheat.actions.LogAction;
|
||||
*/
|
||||
public class NoCheatConfiguration {
|
||||
|
||||
|
||||
public final String configFile = "plugins/NoCheat/nocheat.yml";
|
||||
|
||||
// Our personal logger
|
||||
private final String loggerName = "cc.co.evenprime.nocheat";
|
||||
public final Logger logger = Logger.getLogger(loggerName);
|
||||
@ -43,19 +46,21 @@ public class NoCheatConfiguration {
|
||||
|
||||
private final NoCheatPlugin plugin;
|
||||
|
||||
public NoCheatConfiguration(File configurationFile, NoCheatPlugin plugin) {
|
||||
public NoCheatConfiguration(NoCheatPlugin plugin) {
|
||||
|
||||
this.plugin = plugin;
|
||||
|
||||
config(configurationFile);
|
||||
config();
|
||||
}
|
||||
|
||||
/**
|
||||
* Read the configuration file and assign either standard values or whatever is declared in the file
|
||||
* @param configurationFile
|
||||
*/
|
||||
public void config(File configurationFile) {
|
||||
public void config() {
|
||||
|
||||
File configurationFile = new File(configFile);
|
||||
|
||||
if(!configurationFile.exists()) {
|
||||
createStandardConfigFile(configurationFile);
|
||||
}
|
||||
|
@ -1,6 +1,5 @@
|
||||
package cc.co.evenprime.bukkit.nocheat;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.logging.Level;
|
||||
@ -298,9 +297,9 @@ public class NoCheatPlugin extends JavaPlugin {
|
||||
*/
|
||||
private void setupConfig() {
|
||||
if(this.config == null)
|
||||
this.config = new NoCheatConfiguration(new File("plugins/NoCheat/nocheat.yml"), this);
|
||||
this.config = new NoCheatConfiguration(this);
|
||||
else
|
||||
this.config.config(new File("plugins/NoCheat/nocheat.yml"));
|
||||
this.config.config();
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user