mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-01 14:38:56 +00:00
I wonder... Also, version check.
This commit is contained in:
1 parent
3ff22b8b42
commit
2c8ebdc135
3 files changed
+22
-6
No files matched your search
@@ -83,7 +83,7 @@ public class Anticheat extends JavaPlugin
|
||||
{
|
||||
logger.log(Level.INFO, "Setup the config.");
|
||||
}
|
||||
checkForUpdate();
|
||||
checkForUpdate();
|
||||
eventList.add(new PlayerListener());
|
||||
eventList.add(new BlockListener());
|
||||
eventList.add(new EntityListener());
|
||||
@@ -209,6 +209,24 @@ public class Anticheat extends JavaPlugin
|
||||
logger.log(Level.INFO, "Data for " + player.getName() + " re-applied from flatfile");
|
||||
}
|
||||
}
|
||||
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.");
|
||||
System.out.println("[WARNING] Please update your server to be build #2287 or higher at http://dl.bukkit.org/downloads/craftbukkit/");
|
||||
System.out.println("[WARNING] AntiCheat will now disable itself, and your server will not be protected until you update.");
|
||||
getServer().getPluginManager().disablePlugin(this);
|
||||
}
|
||||
}
|
||||
if (verbose)
|
||||
{
|
||||
logger.log(Level.INFO, "Finished loading.");
|
||||
|
||||
@@ -35,7 +35,7 @@ public class EventListener implements Listener
|
||||
private static final Anticheat PLUGIN = Anticheat.getManager().getPlugin();
|
||||
private static final PlayerManager PLAYER_MANAGER = Anticheat.getManager().getPlayerManager();
|
||||
|
||||
public void log(String message, Player player, CheckType type)
|
||||
public static void log(String message, Player player, CheckType type)
|
||||
{
|
||||
if (PLAYER_MANAGER.increaseLevel(player,type))
|
||||
{
|
||||
@@ -45,7 +45,7 @@ public class EventListener implements Listener
|
||||
logCheat(type, player);
|
||||
}
|
||||
|
||||
private void logCheat(CheckType type, Player player)
|
||||
private static void logCheat(CheckType type, Player player)
|
||||
{
|
||||
USAGE_LIST.put(type, getCheats(type) + 1);
|
||||
type.logUse(player);
|
||||
@@ -60,7 +60,7 @@ public class EventListener implements Listener
|
||||
USAGE_LIST.put(type, 0);
|
||||
}
|
||||
|
||||
public int getCheats(CheckType type)
|
||||
public static int getCheats(CheckType type)
|
||||
{
|
||||
int x = 0;
|
||||
if (USAGE_LIST.get(type) != null)
|
||||
|
||||
@@ -74,9 +74,7 @@ public class PlayerManager
|
||||
return false;
|
||||
|
||||
final String name = player.getName();
|
||||
|
||||
|
||||
|
||||
if (level.get(name) == null || level.get(name) == 0)
|
||||
{
|
||||
level.put(name, 1);
|
||||
|
||||
Reference in new issue
Block a user