mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-04 14:38:47 +00:00
Handle wrong version string length gracefully
This commit is contained in:
1 parent
874c551350
commit
c74bd5633e
1 file changed
+7
-4
@@ -209,16 +209,16 @@ public class Anticheat extends JavaPlugin
|
||||
logger.log(Level.INFO, "Data for " + player.getName() + " re-applied from flatfile");
|
||||
}
|
||||
}
|
||||
try
|
||||
{
|
||||
if(this.getServer().getVersion().split("-").length >= 7)
|
||||
{
|
||||
String v = this.getServer().getVersion().split("-")[6];
|
||||
if(v.contains("jnks"))
|
||||
{
|
||||
v = v.replaceAll("b", "").replaceAll("jnks", "").split(" ")[0];
|
||||
int build = 0;
|
||||
try
|
||||
{
|
||||
build = Integer.parseInt(v);
|
||||
}
|
||||
catch(Exception ex){ }
|
||||
if(build != 0 && build < 2287)
|
||||
{
|
||||
System.out.println("[WARNING] You are using an UNSUPPORTED version of CraftBukkit that does not contain the API required to run AntiCheat.");
|
||||
@@ -227,6 +227,9 @@ public class Anticheat extends JavaPlugin
|
||||
getServer().getPluginManager().disablePlugin(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(Exception ex){ }
|
||||
if (verbose)
|
||||
{
|
||||
logger.log(Level.INFO, "Finished loading.");
|
||||
|
||||
Reference in new issue
Block a user