Skip to content

Commit

Permalink
Fix version parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
Brokkonaut committed May 2, 2019
1 parent 82d61d5 commit 503541a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main/java/de/diddiz/LogBlock/Updater.java
Expand Up @@ -847,7 +847,12 @@ public void updateMaterialsPost1_13() {
ComparableVersion comparablePreviousMinecraftVersion = new ComparableVersion(previousMinecraftVersion);
String currentMinecraftVersion = logblock.getServer().getVersion();
currentMinecraftVersion = currentMinecraftVersion.substring(currentMinecraftVersion.indexOf("(MC: ") + 5);
currentMinecraftVersion = currentMinecraftVersion.substring(0, currentMinecraftVersion.indexOf(" "));
int currentVersionEnd = currentMinecraftVersion.indexOf(" ");
int currentVersionEnd2 = currentMinecraftVersion.indexOf(")");
if(currentVersionEnd2 >= 0 && (currentVersionEnd < 0 || currentVersionEnd2 < currentVersionEnd)) {
currentVersionEnd = currentVersionEnd2;
}
currentMinecraftVersion = currentMinecraftVersion.substring(0, currentVersionEnd);
logblock.getLogger().info("[Updater] Current Minecraft Version: '" + currentMinecraftVersion + "'");
ComparableVersion comparableCurrentMinecraftVersion = new ComparableVersion(currentMinecraftVersion);

Expand Down

0 comments on commit 503541a

Please sign in to comment.