Skip to content

Commit 22afea9

Browse files
Provide generic fix.
1 parent 6037a4b commit 22afea9

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

src/main/java/me/flame/menus/util/VersionHelper.java

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
11
package me.flame.menus.util;
22

3-
import com.google.common.primitives.Ints;
4-
import me.flame.menus.exceptions.MenuException;
53
import org.bukkit.Bukkit;
64
import org.bukkit.OfflinePlayer;
7-
import org.jetbrains.annotations.NotNull;
85

96
import java.util.regex.Pattern;
107
import java.util.regex.Matcher;
118

12-
// changed
13-
149
public class VersionHelper {
1510
// Unbreakable change
1611
private static final int V1_11 = 1110;
@@ -57,8 +52,9 @@ public class VersionHelper {
5752
* @return A protocol like number representing the version, for example 1.16.5 - 1165
5853
*/
5954
private static int getCurrentVersion() {
60-
String bukkitVersion = Bukkit.getBukkitVersion();
61-
Matcher matcher = Pattern.compile("(\\d+\\.\\d+)(\\.\\d+)?").matcher(bukkitVersion);
55+
Matcher matcher = Pattern
56+
.compile("(\\d+\\.\\d+)(\\.\\d+)?")
57+
.matcher(Bukkit.getBukkitVersion());
6258

6359
if (matcher.find()) {
6460
String version = matcher.group(1).replace(".", "");
@@ -67,6 +63,9 @@ private static int getCurrentVersion() {
6763
return Integer.parseInt(version + patch, 10);
6864
}
6965

70-
throw new RuntimeException("Could not retrieve server version!");
66+
throw new RuntimeException(
67+
"Could not retrieve server version!" +
68+
"\nFix: Install the server properly or add a WORKING version/jar."
69+
);
7170
}
7271
}

0 commit comments

Comments
 (0)