mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-01 22:14:49 +00:00
Added and tested backwards compatibility for 1.13 and 1.14.
This commit is contained in:
1 parent
f77d45a78d
commit
6afe0049c5
11 files changed
+78
-45
No files matched your search
@@ -31,7 +31,7 @@ import org.bukkit.potion.PotionEffectType;
|
||||
public class VersionUtil {
|
||||
|
||||
private static final List<String> SUPPORTED_VERSIONS = Arrays
|
||||
.asList(new String[] { "v1_15" });
|
||||
.asList(new String[] { "v1_15", "v1_14", "v1_13" });
|
||||
|
||||
public static String getVersion() {
|
||||
return Bukkit.getServer().getClass().getPackage().getName().replace(".", ",").split(",")[3];
|
||||
@@ -46,6 +46,14 @@ public class VersionUtil {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean isOfVersion(String versionId) {
|
||||
if (getVersion().startsWith(versionId)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
public static boolean isFlying(Player p) {
|
||||
return p.isFlying() || p.isGliding() || p.hasPotionEffect(PotionEffectType.LEVITATION);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user