diff --git a/src/main/java/pers/xanadu/enderdragon/nms/BossBar/v1_13_R2/BossBarManager.java b/src/main/java/pers/xanadu/enderdragon/nms/BossBar/v1_13_R2/BossBarManager.java index a58c7a6..dd969c4 100644 --- a/src/main/java/pers/xanadu/enderdragon/nms/BossBar/v1_13_R2/BossBarManager.java +++ b/src/main/java/pers/xanadu/enderdragon/nms/BossBar/v1_13_R2/BossBarManager.java @@ -23,6 +23,7 @@ public class BossBarManager implements I_BossBarManager { public void saveBossBarData(List worlds){ File file = new File(plugin.getDataFolder(),"world_data.yml"); YamlConfiguration yml = new YamlConfiguration(); + char split = yml.options().pathSeparator(); worlds.forEach(world -> { try{ Object edb = DragonManager.getEnderDragonBattle(world); @@ -30,10 +31,13 @@ public class BossBarManager implements I_BossBarManager { if(BossBattleServer == null) BossBattleServer = edb.getClass().getDeclaredField("bossBattle"); BossBattleServer.setAccessible(true); BossBattleServer bbs = (BossBattleServer) BossBattleServer.get(edb); - String path = world.getName() + yml.options().pathSeparator(); + String path = world.getName() + split; yml.set(path+"title",bbs.title.getText()); yml.set(path+"color",bbs.color.name()); yml.set(path+"style",bbs.style.name()); + yml.set(path+"create_frog",bbs.isCreateFog()); + yml.set(path+"darken_sky",bbs.isDarkenSky()); + yml.set(path+"play_boss_music",bbs.isPlayMusic()); }catch (ReflectiveOperationException e){ e.printStackTrace(); } @@ -50,6 +54,7 @@ public class BossBarManager implements I_BossBarManager { if(!file.exists()) return; Lang.info("Enabling BossBar fix..."); YamlConfiguration yml = new YamlConfiguration(); + char split = yml.options().pathSeparator(); try{ yml.load(file); }catch (InvalidConfigurationException | IOException e) { @@ -63,10 +68,13 @@ public class BossBarManager implements I_BossBarManager { if(BossBattleServer == null) BossBattleServer = edb.getClass().getDeclaredField("bossBattle"); BossBattleServer.setAccessible(true); BossBattleServer bbs = (BossBattleServer) BossBattleServer.get(edb); - String path = world.getName() + yml.options().pathSeparator(); + String path = world.getName() + split; bbs.title = CraftChatMessage.fromString(yml.getString(path+"title"), true)[0]; bbs.color = BossBattle.BarColor.valueOf(yml.getString(path+"color")); bbs.style = BossBattle.BarStyle.valueOf(yml.getString(path+"style")); + bbs.setCreateFog(yml.getBoolean(path+"create_frog",true)); + bbs.setDarkenSky(yml.getBoolean(path+"darken_sky",true)); + bbs.setPlayMusic(yml.getBoolean(path+"play_boss_music",true)); }catch (ReflectiveOperationException e){ e.printStackTrace(); }