From 77802758a9d1889d1f4dea5f8b858ef8e5375474 Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Wed, 22 Dec 2021 11:44:37 +0000 Subject: [PATCH] Fix parsing of build in FaweVersion --- .../src/main/java/com/fastasyncworldedit/core/FaweVersion.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/FaweVersion.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/FaweVersion.java index 2298d491b..6ce56a244 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/FaweVersion.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/FaweVersion.java @@ -36,7 +36,8 @@ public class FaweVersion { } this.semver = ver; this.snapshot = split.length > 1 && split[1].toLowerCase(Locale.ROOT).contains("snapshot"); - this.build = version.contains("-") ? Integer.parseInt(version.substring(version.indexOf('-') + 10)) : 0; + int buildIndex = this.snapshot ? 2 : 1; + this.build = split.length == buildIndex + 1 ? Integer.parseInt(split[buildIndex]) : 0; this.hash = Integer.parseInt(commit.substring(commit.indexOf('=') + 1), 16); String[] split2 = date.substring(date.indexOf('=') + 1).split("\\."); this.year = Integer.parseInt(split2[0]);