Skip to content

Commit

Permalink
Merge pull request #431 from TownyAdvanced/v0.7.2
Browse files Browse the repository at this point in the history
Use Towny's internal CommentedConfiguration.
  • Loading branch information
LlmDl authored Dec 30, 2021
2 parents 2b253bb + 0587fcf commit 9ed4c04
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 238 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.gmail.goosius</groupId>
<artifactId>SiegeWar</artifactId>
<version>0.7.1</version>
<version>0.7.2</version>
<name>siegewar</name> <!-- Leave lower-cased -->

<properties>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import com.gmail.goosius.siegewar.utils.FileMgmt;
import com.gmail.goosius.siegewar.utils.SiegeWarBattleSessionUtil;
import com.palmergames.bukkit.config.CommentedConfiguration;
import com.palmergames.util.TimeTools;

public class Settings {
Expand Down Expand Up @@ -61,7 +62,7 @@ public static void loadConfig(String filepath, String version) throws Exception
File file = new File(filepath);

// read the config.yml into memory
config = new CommentedConfiguration(file);
config = new CommentedConfiguration(file.toPath());
if (!config.load())
throw new IOException("Failed to load Config!");

Expand Down Expand Up @@ -98,7 +99,7 @@ public static String getLastRunVersion(String currentVersion) {
*/
private static void setDefaults(String version, File file) {

newConfig = new CommentedConfiguration(file);
newConfig = new CommentedConfiguration(file.toPath());
newConfig.load();

for (ConfigNodes root : ConfigNodes.values()) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.gmail.goosius.siegewar.settings;

import com.gmail.goosius.siegewar.SiegeWar;
import com.palmergames.bukkit.config.CommentedConfiguration;
import com.palmergames.bukkit.towny.command.HelpMenu;
import com.palmergames.bukkit.util.Colors;
import com.palmergames.util.StringMgmt;
Expand Down Expand Up @@ -29,10 +30,10 @@ public static void loadLanguage(String filepath, String defaultRes) throws Excep
File file = FileMgmt.unpackResourceFile(fullPath, res, defaultRes);

// read the (language).yml into memory
language = new CommentedConfiguration(file);
language = new CommentedConfiguration(file.toPath());
language.load();
HelpMenu.loadMenus();
CommentedConfiguration newLanguage = new CommentedConfiguration(file);
CommentedConfiguration newLanguage = new CommentedConfiguration(file.toPath());

try {
newLanguage.loadFromString(FileMgmt.convertStreamToString("/" + res));
Expand Down

0 comments on commit 9ed4c04

Please sign in to comment.