1
1
package me .flame .menus .util ;
2
2
3
- import com .google .common .primitives .Ints ;
4
- import me .flame .menus .exceptions .MenuException ;
5
3
import org .bukkit .Bukkit ;
6
4
import org .bukkit .OfflinePlayer ;
7
- import org .jetbrains .annotations .NotNull ;
8
5
9
6
import java .util .regex .Pattern ;
10
7
import java .util .regex .Matcher ;
11
8
12
- // changed
13
-
14
9
public class VersionHelper {
15
10
// Unbreakable change
16
11
private static final int V1_11 = 1110 ;
@@ -57,8 +52,9 @@ public class VersionHelper {
57
52
* @return A protocol like number representing the version, for example 1.16.5 - 1165
58
53
*/
59
54
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 ());
62
58
63
59
if (matcher .find ()) {
64
60
String version = matcher .group (1 ).replace ("." , "" );
@@ -67,6 +63,9 @@ private static int getCurrentVersion() {
67
63
return Integer .parseInt (version + patch , 10 );
68
64
}
69
65
70
- throw new RuntimeException ("Could not retrieve server version!" );
66
+ throw new RuntimeException (
67
+ "Could not retrieve server version!" +
68
+ "\n Fix: Install the server properly or add a WORKING version/jar."
69
+ );
71
70
}
72
71
}
0 commit comments