Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void Setup() throws IOException {
- /*
- YAML initialize
- */
- mainDir = main.getDataFolder();
- // load as file
- configFile = new File(mainDir, "config.yml");
- messagesFile = new File(mainDir, "messages.yml");
- // directories
- if(!mainDir.exists()){
- mainDir.mkdirs();
- }
- // files exist
- if(!configFile.exists()){
- configFile.createNewFile();
- try{
- DefaultConfig();
- }catch (Exception e){
- e.printStackTrace();
- }
- }
- if(!messagesFile.exists()){
- configFile.createNewFile();
- try {
- DefaultMessages();
- }catch (Exception e){
- e.printStackTrace();
- }
- }
- // load configs
- YAMLParse yamlParse = new YAMLParse(main);
- // INIT settings
- settings.SetMap(yamlParse.ParseConfig(configFile.getName().replace(".yml", "") + ".yml"));
- // INIT lang
- //-------
- lang.SetMap(yamlParse.ParseConfig(messagesFile.getName().replace(".yml", "") + ".yml"));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement