Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package net.cjservers.resourcegens;
- import java.io.File;
- import net.cjservers.resourcegens.Main;
- import net.cjservers.resourcegens.Commands;
- import org.bukkit.configuration.file.FileConfiguration;
- import org.bukkit.event.Listener;
- import org.bukkit.plugin.java.JavaPlugin;
- public class Main extends JavaPlugin implements Listener {
- private static Main instance;
- private Utils utils;
- public String version;
- public File confYml = new File(getDataFolder(), "config.yml");
- public FileConfiguration conf;
- public File genYml = new File(getDataFolder(), "generators.yml");
- public FileConfiguration genConfig;
- @Override
- public void onEnable(){
- instance = this;
- utils = new Utils(this);
- fixConf();
- conf = Utils.getConfiguration("config.yml");
- genConfig = Utils.getConfiguration("generators.yml");
- version = getDescription().getVersion();
- new DestroyGen(this);
- getServer().getPluginManager().registerEvents(this, this);
- this.getCommand("rg").setExecutor(new Commands(this));
- }
- @Override
- public void onDisable(){
- }
- public static Main getInstance() {
- return instance;
- }
- public Utils getUtils() {
- return utils;
- }
- public void fixConf(){
- if (!(confYml.exists())) {
- saveDefaultConfig();
- System.out.println("[ResourceGens] - Created config.yml");
- }
- if (!(genYml.exists())) {
- Utils.save(genConfig, "generators.yml");
- System.out.println("[ResourceGens] - Created generators.yml");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement