mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-11 11:49:12 +00:00
Cache BukkitVersion in getServerBukkitVersion
This commit is contained in:
parent
417fe29e21
commit
7e1d258dd3
1 changed files with 6 additions and 1 deletions
|
@ -23,8 +23,13 @@ public class VersionUtil {
|
|||
|
||||
private static final Set<BukkitVersion> supportedVersions = ImmutableSet.of(v1_8_8_R01, v1_9_4_R01, v1_10_2_R01, v1_11_2_R01, v1_12_2_R01, v1_13_2_R01);
|
||||
|
||||
private static BukkitVersion serverVersion = null;
|
||||
|
||||
public static BukkitVersion getServerBukkitVersion() {
|
||||
return BukkitVersion.fromString(Bukkit.getServer().getBukkitVersion());
|
||||
if (serverVersion == null) {
|
||||
serverVersion = BukkitVersion.fromString(Bukkit.getServer().getBukkitVersion());
|
||||
}
|
||||
return serverVersion;
|
||||
}
|
||||
|
||||
public static boolean isServerSupported() {
|
||||
|
|
Loading…
Reference in a new issue