mirror of
https://github.com/darksaid98/AlathranWars.git
synced 2026-12-01 14:38:55 +00:00
refactor: rename main package
This commit is contained in:
92 files changed
+379
-398
No files matched your search
@@ -0,0 +1,47 @@
|
||||
package com.github.alathra.alathranwars.config;
|
||||
|
||||
import com.github.alathra.alathranwars.AlathranWars;
|
||||
import com.github.alathra.alathranwars.Reloadable;
|
||||
import com.github.milkdrinkers.Crate.Config;
|
||||
|
||||
import javax.inject.Singleton;
|
||||
|
||||
/**
|
||||
* A class that generates/loads & provides access to a configuration file.
|
||||
*/
|
||||
@Singleton
|
||||
public class ConfigHandler implements Reloadable {
|
||||
private final AlathranWars alathranWars;
|
||||
private Config cfg;
|
||||
|
||||
/**
|
||||
* Instantiates a new Config handler.
|
||||
*
|
||||
* @param alathranWars the plugin instance
|
||||
*/
|
||||
public ConfigHandler(AlathranWars alathranWars) {
|
||||
this.alathranWars = alathranWars;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
cfg = new Config("config", alathranWars.getDataFolder().getPath(), alathranWars.getResource("config.yml")); // Create a config file from the template in our resources folder
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEnable() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDisable() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets alathranWars config object.
|
||||
*
|
||||
* @return the alathranWars config object
|
||||
*/
|
||||
public Config getConfig() {
|
||||
return cfg;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user