Skip to content

Commit

Permalink
Migration to fix bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
DxsSucuk committed Jan 30, 2024
1 parent d63e083 commit 7b31beb
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<groupId>de.presti</groupId>
<artifactId>Ree6</artifactId>
<version>3.1.8</version>
<version>3.1.9</version>
<packaging>jar</packaging>

<properties>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/de/presti/ree6/bot/BotWorker.java
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ public static BotVersion getVersion() {
public static String getBuild() {
if (build == null) {
build = Objects.requireNonNullElse(Main.class.getPackage().getImplementationVersion(),
Objects.requireNonNullElse(gitVersion, "3.1.8"));
Objects.requireNonNullElse(gitVersion, "3.1.9"));
}
return build;
}
Expand Down
14 changes: 14 additions & 0 deletions src/main/java/de/presti/ree6/utils/data/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,20 @@ public void migrateOldConfig() {
if (key.startsWith("twitter") && !key.endsWith("bearer")) continue;
}

// Migrate to 3.1.9
if (compareVersion("3.1.9", configVersion)) {

if (key.startsWith("bot.misc.leveling.modules."))
key = key.replace("bot.misc.leveling.modules.", "bot.misc.modules.");

if (key.endsWith("bot.misc.leveling.rankCard."))
key = key.replace("bot.misc.leveling.rankCard.", "bot.misc.rankCard.");

yamlFile.set(key, entry.getValue());
modified = true;
}


if (!modified) {
yamlFile.set(key, entry.getValue());
}
Expand Down

0 comments on commit 7b31beb

Please sign in to comment.