Skip to content

Commit

Permalink
Automatically add version to yml
Browse files Browse the repository at this point in the history
  • Loading branch information
HimaJyun committed Nov 20, 2018
1 parent 1312c64 commit dc7e033
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>jp.jyn</groupId>
<artifactId>Jecon</artifactId>
<version>1.1.2</version>
<version>1.1.3</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/jp/jyn/jecon/config/ConfigStruct.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@ public ConfigStruct reloadConfig() {
// 設定を取得
conf = customconfig.getConfig();

// バージョンがない->1.1.3未満
if (!conf.contains("version", true)) {
conf.set("version", 1);
customconfig.saveConfig();
}

// ロード
createAccountOnJoin = conf.getBoolean("CreateAccountOnJoin", false);
defaultBalance = conf.getDouble("DefaultBalance", 0);
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/jp/jyn/jecon/config/MessageStruct.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@ public MessageStruct reloadConfig() {
// 設定を取得
conf = customconfig.getConfig();

// バージョンがない->1.1.3未満
if (!conf.contains("version", true)) {
conf.set("version", 1);
customconfig.saveConfig();
}

dontHavePermission = customconfig.replaceColor(PREFIX + conf.getString("DontHavePermission"));
accountNotFount = customconfig.replaceColor(PREFIX + conf.getString("AccountNotFound"));
invalidAmount = customconfig.replaceColor(PREFIX + conf.getString("InvalidAmount"));
Expand Down

0 comments on commit dc7e033

Please sign in to comment.