mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-02 14:38:45 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a140afe33e | ||
|
|
08c484bfb1 | ||
|
|
ae66b0ed3c | ||
|
|
0963458be5 | ||
|
|
d9639c81d9 | ||
|
|
0428c4796a | ||
|
|
8e92077bb6 | ||
|
|
9d32c8f2de | ||
|
|
d6917b81f7 | ||
|
|
1a64403223 | ||
|
|
7ae3f010a3 | ||
|
|
06c1eab2e6 | ||
|
|
f609758d28 | ||
|
|
2d064ee849 | ||
|
|
717b7acb67 | ||
|
|
2617aa1225 | ||
|
|
dd8c495ee6 |
No files matched your search
@@ -1,11 +1,10 @@
|
|||||||
AntiCheatReloaded
|
AntiCheatReloaded
|
||||||
=============
|
=============
|
||||||
AntiCheatReloaded is a fork of the old 'AntiCheat' project.
|
AntiCheatReloaded helps server admins easily identify and block malicious users by monitoring and analyzing the behaviour of their players. It is based on one of the oldest anti-cheats in the community, AntiCheat.
|
||||||
AntiCheat helps server admins easily identify and block malicious users by monitoring and analyzing the behaviour of their players.
|
|
||||||
|
|
||||||
###Want to help me out?
|
+ BTC donations: bc1q5qgmzq9e63h7ptf3kneg78uf0mghtwsmvwxt8m
|
||||||
First of all, i've put a lot of time and work in this project, so donations (especially in (m)BTC) are appreciated!
|
+ LTC donations: LYZLe6AGRQZTey5UHe7CCF3e9HAyQooSmh
|
||||||
My BTC address is 1JfyX6hvGUazHTtKVLaNcYaUxnyjR5HtMY
|
+ ETH donations: 0x2a2171fB3600fc67951734c2872E0Ad742741Cf2
|
||||||
|
|
||||||
Bug Reporting
|
Bug Reporting
|
||||||
------------
|
------------
|
||||||
@@ -15,15 +14,15 @@ Issues should be filed by hitting the [issues](https://github.com/Rammelkast/Ant
|
|||||||
Please include the following information with your issue, this allows me to fix it quicker;
|
Please include the following information with your issue, this allows me to fix it quicker;
|
||||||
* The `/anticheat debug` log
|
* The `/anticheat debug` log
|
||||||
* Your AntiCheatReloaded version
|
* Your AntiCheatReloaded version
|
||||||
* Your server software (Bukkit/Spigot/Paper/Taco) and it's version
|
* Your server software (Bukkit/Spigot/Other) and it's version
|
||||||
* When using protocollib, your protocollib version
|
* If you use ProtocolLib, your ProtocolLib version
|
||||||
* If you use protocolhacks (ViaVersion etc.)
|
* Whether or not you are using protocol hacks (ViaVersion etc.)
|
||||||
|
|
||||||
Usage
|
Usage
|
||||||
-------
|
-------
|
||||||
Simply drag and drop the plugin and the ProtoclLib into your Plugins folder.
|
Simply drag and drop the plugin file and the ProtocolLib jar into your Plugins folder.
|
||||||
|
|
||||||
###Hacks blocked
|
Hacks blocked
|
||||||
-------
|
-------
|
||||||
* Blink
|
* Blink
|
||||||
* Flight
|
* Flight
|
||||||
@@ -31,7 +30,7 @@ Simply drag and drop the plugin and the ProtoclLib into your Plugins folder.
|
|||||||
* Jesus
|
* Jesus
|
||||||
* Step
|
* Step
|
||||||
* Criticals
|
* Criticals
|
||||||
* KillAura
|
* KillAura (not available on MC > 1.12.2
|
||||||
* Anti-Knockback
|
* Anti-Knockback
|
||||||
* FastBow
|
* FastBow
|
||||||
* FastDrop
|
* FastDrop
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
theme: jekyll-theme-cayman
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>com.rammelkast.anticheatreloaded</groupId>
|
<groupId>com.rammelkast.anticheatreloaded</groupId>
|
||||||
<artifactId>AntiCheatReloaded</artifactId>
|
<artifactId>AntiCheatReloaded</artifactId>
|
||||||
<version>1.6.1-ALPHA</version>
|
<version>1.7.0-ALPHA</version>
|
||||||
<name>AntiCheatReloaded</name>
|
<name>AntiCheatReloaded</name>
|
||||||
<url>https://rammelkast.com</url>
|
<url>https://rammelkast.com</url>
|
||||||
<properties>
|
<properties>
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
<repositories>
|
<repositories>
|
||||||
<repository>
|
<repository>
|
||||||
<id>dmulloy2-repo</id>
|
<id>dmulloy2-repo</id>
|
||||||
<url>http://repo.dmulloy2.net/content/groups/public/</url>
|
<url>https://repo.dmulloy2.net/nexus/repository/public/</url>
|
||||||
</repository>
|
</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
<build>
|
<build>
|
||||||
@@ -22,16 +22,16 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<version>3.1</version>
|
<version>3.5</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<source>1.7</source>
|
<source>1.8</source>
|
||||||
<target>1.7</target>
|
<target>1.8</target>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-shade-plugin</artifactId>
|
<artifactId>maven-shade-plugin</artifactId>
|
||||||
<version>1.3</version>
|
<version>3.1.1</version>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<phase>package</phase>
|
<phase>package</phase>
|
||||||
@@ -81,19 +81,12 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.comphenix.protocol</groupId>
|
<groupId>com.comphenix.protocol</groupId>
|
||||||
<artifactId>ProtocolLib</artifactId>
|
<artifactId>ProtocolLib</artifactId>
|
||||||
<version>4.2.1-SNAPSHOT</version>
|
<version>4.5.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>junit</groupId>
|
<groupId>org.spigotmc</groupId>
|
||||||
<artifactId>junit</artifactId>
|
<artifactId>spigot</artifactId>
|
||||||
<version>4.11</version>
|
<version>1.15.2-R0.1-SNAPSHOT</version>
|
||||||
<type>jar</type>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.bukkit</groupId>
|
|
||||||
<artifactId>craftbukkit</artifactId>
|
|
||||||
<version>1.11.2-R0.1-SNAPSHOT</version>
|
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|||||||
+82
-27
@@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* AntiCheat for Bukkit.
|
* AntiCheatReloaded for Bukkit and Spigot.
|
||||||
* Copyright (C) 2012-2014 AntiCheat Team | http://gravitydevelopment.net
|
* Copyright (c) 2012-2015 AntiCheat Team
|
||||||
|
* Copyright (c) 2016-2020 Rammelkast
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -18,11 +19,13 @@
|
|||||||
|
|
||||||
package com.rammelkast.anticheatreloaded;
|
package com.rammelkast.anticheatreloaded;
|
||||||
|
|
||||||
|
import java.security.SecureRandom;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
@@ -43,21 +46,22 @@ import com.rammelkast.anticheatreloaded.metrics.Metrics;
|
|||||||
import com.rammelkast.anticheatreloaded.util.User;
|
import com.rammelkast.anticheatreloaded.util.User;
|
||||||
import com.rammelkast.anticheatreloaded.util.VersionUtil;
|
import com.rammelkast.anticheatreloaded.util.VersionUtil;
|
||||||
|
|
||||||
public class AntiCheat extends JavaPlugin {
|
public class AntiCheatReloaded extends JavaPlugin {
|
||||||
|
|
||||||
private static AntiCheatManager manager;
|
private static AntiCheatManager manager;
|
||||||
private static AntiCheat plugin;
|
private static AntiCheatReloaded plugin;
|
||||||
private static List<Listener> eventList = new ArrayList<Listener>();
|
private static List<Listener> eventList = new ArrayList<Listener>();
|
||||||
private static Configuration config;
|
private static Configuration config;
|
||||||
private static boolean verbose;
|
private static boolean verbose;
|
||||||
private static boolean developer;
|
private static boolean developer;
|
||||||
private static ProtocolManager protocolManager;
|
private static ProtocolManager protocolManager;
|
||||||
private static boolean protocolLib = false;
|
private static SecureRandom random;
|
||||||
private static Long loadTime;
|
private static Long loadTime;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onEnable() {
|
public void onEnable() {
|
||||||
plugin = this;
|
plugin = this;
|
||||||
|
random = new SecureRandom();
|
||||||
loadTime = System.currentTimeMillis();
|
loadTime = System.currentTimeMillis();
|
||||||
manager = new AntiCheatManager(this, getLogger());
|
manager = new AntiCheatManager(this, getLogger());
|
||||||
eventList.add(new PlayerListener());
|
eventList.add(new PlayerListener());
|
||||||
@@ -67,21 +71,30 @@ public class AntiCheat extends JavaPlugin {
|
|||||||
eventList.add(new InventoryListener());
|
eventList.add(new InventoryListener());
|
||||||
// Order is important in some cases, don't screw with these unless
|
// Order is important in some cases, don't screw with these unless
|
||||||
// needed, especially config
|
// needed, especially config
|
||||||
setupConfig();
|
this.setupConfig();
|
||||||
setupEvents();
|
this.setupEvents();
|
||||||
setupCommands();
|
this.setupCommands();
|
||||||
setupProtocol();
|
|
||||||
// Enterprise must come before levels
|
// Enterprise must come before levels
|
||||||
setupEnterprise();
|
this.setupEnterprise();
|
||||||
restoreLevels();
|
this.restoreLevels();
|
||||||
|
|
||||||
if (Bukkit.getPluginManager().getPlugin("ProtocolLib") != null) {
|
if (Bukkit.getPluginManager().getPlugin("ProtocolLib") != null) {
|
||||||
|
this.setupProtocol();
|
||||||
|
} else {
|
||||||
|
Bukkit.getConsoleSender().sendMessage("[ACR] " + ChatColor.RED + "Shutting down, ProtocolLib not found!");
|
||||||
|
Bukkit.getPluginManager().disablePlugin(this);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
getLogger().info("NMS version is " + VersionUtil.getVersion());
|
||||||
|
if (!VersionUtil.isSupported()) {
|
||||||
|
Bukkit.getConsoleSender().sendMessage("[ACR] " + ChatColor.RED + "The version of this server is NOT supported by ACR! The plugin will be buggy!");
|
||||||
|
}
|
||||||
getLogger().info("Found ProtocolLib, enabling checks that use ProtcolLib...");
|
getLogger().info("Found ProtocolLib, enabling checks that use ProtcolLib...");
|
||||||
// Enable packetlisteners
|
// Enable packetlisteners
|
||||||
KillAuraCheck.listenPackets();
|
KillAuraCheck.listenPackets();
|
||||||
BlinkCheck.startTimer();
|
BlinkCheck.startTimer();
|
||||||
BlinkCheck.listenPackets();
|
BlinkCheck.listenPackets();
|
||||||
}
|
|
||||||
|
|
||||||
// Check if other AC's are installed
|
// Check if other AC's are installed
|
||||||
Bukkit.getScheduler().runTaskLater(this, new Runnable() {
|
Bukkit.getScheduler().runTaskLater(this, new Runnable() {
|
||||||
@@ -93,6 +106,13 @@ public class AntiCheat extends JavaPlugin {
|
|||||||
getLogger().severe("Please remove or disable NoCheatPlus to silence this warning.");
|
getLogger().severe("Please remove or disable NoCheatPlus to silence this warning.");
|
||||||
getLogger().severe("*----------------------------------------------*");
|
getLogger().severe("*----------------------------------------------*");
|
||||||
}
|
}
|
||||||
|
if (Bukkit.getPluginManager().getPlugin("Matrix") != null) {
|
||||||
|
getLogger().severe("*----------------------------------------------*");
|
||||||
|
getLogger().severe("You are also running Matrix!");
|
||||||
|
getLogger().severe("Multiple anticheats create false cheat detections.");
|
||||||
|
getLogger().severe("Please remove or disable NoCheatPlus to silence this warning.");
|
||||||
|
getLogger().severe("*----------------------------------------------*");
|
||||||
|
}
|
||||||
if (Bukkit.getPluginManager().getPlugin("AAC") != null) {
|
if (Bukkit.getPluginManager().getPlugin("AAC") != null) {
|
||||||
getLogger().severe("*----------------------------------------------*");
|
getLogger().severe("*----------------------------------------------*");
|
||||||
getLogger().severe("You are also running AAC!");
|
getLogger().severe("You are also running AAC!");
|
||||||
@@ -100,7 +120,21 @@ public class AntiCheat extends JavaPlugin {
|
|||||||
getLogger().severe("Please remove or disable AAC to silence this warning.");
|
getLogger().severe("Please remove or disable AAC to silence this warning.");
|
||||||
getLogger().severe("*----------------------------------------------*");
|
getLogger().severe("*----------------------------------------------*");
|
||||||
}
|
}
|
||||||
if (Bukkit.getPluginManager().getPlugin("AntiCheat") != null) {
|
if (Bukkit.getPluginManager().getPlugin("Spartan") != null) {
|
||||||
|
getLogger().severe("*----------------------------------------------*");
|
||||||
|
getLogger().severe("You are also running Spartan!");
|
||||||
|
getLogger().severe("Multiple anticheats create false cheat detections.");
|
||||||
|
getLogger().severe("Please remove or disable AAC to silence this warning.");
|
||||||
|
getLogger().severe("*----------------------------------------------*");
|
||||||
|
}
|
||||||
|
if (Bukkit.getPluginManager().getPlugin("NoAura") != null) {
|
||||||
|
getLogger().severe("*----------------------------------------------*");
|
||||||
|
getLogger().severe("You are also running NoAura!");
|
||||||
|
getLogger().severe("Multiple anticheats create false cheat detections.");
|
||||||
|
getLogger().severe("Please remove or disable AAC to silence this warning.");
|
||||||
|
getLogger().severe("*----------------------------------------------*");
|
||||||
|
}
|
||||||
|
if (Bukkit.getPluginManager().getPlugin("AntiCheat") != null || Bukkit.getPluginManager().getPlugin("AntiCheatPlus") != null) {
|
||||||
getLogger().severe("*----------------------------------------------*");
|
getLogger().severe("*----------------------------------------------*");
|
||||||
getLogger().severe("You are also running AntiCheat!");
|
getLogger().severe("You are also running AntiCheat!");
|
||||||
getLogger().severe("Multiple anticheats create false cheat detections.");
|
getLogger().severe("Multiple anticheats create false cheat detections.");
|
||||||
@@ -108,11 +142,10 @@ public class AntiCheat extends JavaPlugin {
|
|||||||
getLogger().severe("*----------------------------------------------*");
|
getLogger().severe("*----------------------------------------------*");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, 60L);
|
}, 90L);
|
||||||
|
|
||||||
// End tests
|
// End tests
|
||||||
verboseLog("Finished loading.");
|
verboseLog("Finished loading.");
|
||||||
getLogger().info("Running NMS version " + VersionUtil.getVersion() + "...");
|
|
||||||
|
|
||||||
// Metrics
|
// Metrics
|
||||||
try {
|
try {
|
||||||
@@ -120,19 +153,40 @@ public class AntiCheat extends JavaPlugin {
|
|||||||
metrics.addCustomChart(new Metrics.SingleLineChart("cheaters_kicked") {
|
metrics.addCustomChart(new Metrics.SingleLineChart("cheaters_kicked") {
|
||||||
@Override
|
@Override
|
||||||
public int getValue() {
|
public int getValue() {
|
||||||
return playersKicked;
|
int kicked = playersKicked;
|
||||||
|
// Reset so we don't keep sending the same value
|
||||||
|
playersKicked = 0;
|
||||||
|
return kicked;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
metrics.addCustomChart(new Metrics.SingleLineChart("killaura_violations") {
|
metrics.addCustomChart(new Metrics.SingleLineChart("killaura_violations") {
|
||||||
@Override
|
@Override
|
||||||
public int getValue() {
|
public int getValue() {
|
||||||
return killauraViolations;
|
int violations = killauraViolations;
|
||||||
|
// Reset so we don't keep sending the same value
|
||||||
|
killauraViolations = 0;
|
||||||
|
return violations;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
metrics.addCustomChart(new Metrics.SingleLineChart("glide_violations") {
|
metrics.addCustomChart(new Metrics.SingleLineChart("glide_violations") {
|
||||||
@Override
|
@Override
|
||||||
public int getValue() {
|
public int getValue() {
|
||||||
return glideViolations;
|
int violations = glideViolations;
|
||||||
|
// Reset so we don't keep sending the same value
|
||||||
|
glideViolations = 0;
|
||||||
|
return violations;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
metrics.addCustomChart(new Metrics.SimplePie("protocollib_version") {
|
||||||
|
@Override
|
||||||
|
public String getValue() {
|
||||||
|
return Bukkit.getPluginManager().getPlugin("ProtocolLib").getDescription().getVersion();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
metrics.addCustomChart(new Metrics.SimplePie("nms_version") {
|
||||||
|
@Override
|
||||||
|
public String getValue() {
|
||||||
|
return VersionUtil.getVersion();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@@ -151,12 +205,9 @@ public class AntiCheat extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void setupProtocol() {
|
private void setupProtocol() {
|
||||||
if (Bukkit.getPluginManager().getPlugin("ProtocolLib") != null) {
|
|
||||||
protocolLib = true;
|
|
||||||
protocolManager = ProtocolLibrary.getProtocolManager();
|
protocolManager = ProtocolLibrary.getProtocolManager();
|
||||||
verboseLog("Hooked into ProtocolLib");
|
verboseLog("Hooked into ProtocolLib");
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private void setupEvents() {
|
private void setupEvents() {
|
||||||
for (Listener listener : eventList) {
|
for (Listener listener : eventList) {
|
||||||
@@ -196,7 +247,7 @@ public class AntiCheat extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static AntiCheat getPlugin() {
|
public static AntiCheatReloaded getPlugin() {
|
||||||
return plugin;
|
return plugin;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -204,6 +255,10 @@ public class AntiCheat extends JavaPlugin {
|
|||||||
return manager;
|
return manager;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static SecureRandom getRandom() {
|
||||||
|
return random;
|
||||||
|
}
|
||||||
|
|
||||||
public static String getVersion() {
|
public static String getVersion() {
|
||||||
return manager.getPlugin().getDescription().getVersion();
|
return manager.getPlugin().getDescription().getVersion();
|
||||||
}
|
}
|
||||||
@@ -222,10 +277,6 @@ public class AntiCheat extends JavaPlugin {
|
|||||||
developer = b;
|
developer = b;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isUsingProtocolLib() {
|
|
||||||
return protocolLib;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void debugLog(final String string) {
|
public static void debugLog(final String string) {
|
||||||
Bukkit.getScheduler().runTask(getPlugin(), new Runnable() {
|
Bukkit.getScheduler().runTask(getPlugin(), new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
@@ -276,7 +327,11 @@ public class AntiCheat extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void onGlideViolation() {
|
public void onGlideViolation() {
|
||||||
this.killauraViolations++;
|
this.glideViolations++;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void sendToMainThread(Runnable runnable) {
|
||||||
|
Bukkit.getServer().getScheduler().runTask(AntiCheatReloaded.getPlugin(), runnable);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* AntiCheat for Bukkit.
|
* AntiCheatReloaded for Bukkit and Spigot.
|
||||||
* Copyright (C) 2012-2014 AntiCheat Team | http://gravitydevelopment.net
|
* Copyright (c) 2012-2015 AntiCheat Team
|
||||||
|
* Copyright (c) 2016-2020 Rammelkast
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -22,7 +23,7 @@ import java.util.List;
|
|||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.rammelkast.anticheatreloaded.AntiCheat;
|
import com.rammelkast.anticheatreloaded.AntiCheatReloaded;
|
||||||
import com.rammelkast.anticheatreloaded.check.CheckType;
|
import com.rammelkast.anticheatreloaded.check.CheckType;
|
||||||
import com.rammelkast.anticheatreloaded.manage.AntiCheatManager;
|
import com.rammelkast.anticheatreloaded.manage.AntiCheatManager;
|
||||||
import com.rammelkast.anticheatreloaded.manage.CheckManager;
|
import com.rammelkast.anticheatreloaded.manage.CheckManager;
|
||||||
@@ -34,8 +35,8 @@ import com.rammelkast.anticheatreloaded.util.Group;
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
public class AntiCheatAPI {
|
public class AntiCheatAPI {
|
||||||
private static CheckManager chk = AntiCheat.getManager().getCheckManager();
|
private static CheckManager chk = AntiCheatReloaded.getManager().getCheckManager();
|
||||||
private static UserManager umr = AntiCheat.getManager().getUserManager();
|
private static UserManager umr = AntiCheatReloaded.getManager().getUserManager();
|
||||||
|
|
||||||
// CheckManager API
|
// CheckManager API
|
||||||
|
|
||||||
@@ -44,7 +45,7 @@ public class AntiCheatAPI {
|
|||||||
*
|
*
|
||||||
* @param type Check to start watching for
|
* @param type Check to start watching for
|
||||||
*/
|
*/
|
||||||
public static void activateCheck(CheckType type, Class caller) {
|
public static void activateCheck(CheckType type, Class<?> caller) {
|
||||||
chk.activateCheck(type, caller.getName());
|
chk.activateCheck(type, caller.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -53,7 +54,7 @@ public class AntiCheatAPI {
|
|||||||
*
|
*
|
||||||
* @param type Check to stop watching for
|
* @param type Check to stop watching for
|
||||||
*/
|
*/
|
||||||
public static void deactivateCheck(CheckType type, Class caller) {
|
public static void deactivateCheck(CheckType type, Class<?> caller) {
|
||||||
chk.deactivateCheck(type, caller.getName());
|
chk.deactivateCheck(type, caller.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -73,7 +74,7 @@ public class AntiCheatAPI {
|
|||||||
* @param player Player to stop watching
|
* @param player Player to stop watching
|
||||||
* @param type Check to stop watching for
|
* @param type Check to stop watching for
|
||||||
*/
|
*/
|
||||||
public static void exemptPlayer(Player player, CheckType type, Class caller) {
|
public static void exemptPlayer(Player player, CheckType type, Class<?> caller) {
|
||||||
chk.exemptPlayer(player, type, caller.getName());
|
chk.exemptPlayer(player, type, caller.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -83,7 +84,7 @@ public class AntiCheatAPI {
|
|||||||
* @param player Player to start watching
|
* @param player Player to start watching
|
||||||
* @param type Check to start watching for
|
* @param type Check to start watching for
|
||||||
*/
|
*/
|
||||||
public static void unexemptPlayer(Player player, CheckType type, Class caller) {
|
public static void unexemptPlayer(Player player, CheckType type, Class<?> caller) {
|
||||||
chk.unexemptPlayer(player, type, caller.getName());
|
chk.unexemptPlayer(player, type, caller.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -111,31 +112,6 @@ public class AntiCheatAPI {
|
|||||||
|
|
||||||
// PlayerManager API
|
// PlayerManager API
|
||||||
|
|
||||||
/**
|
|
||||||
* Get a player's integer hack level
|
|
||||||
*
|
|
||||||
* @param player Player to check
|
|
||||||
* @return player's hack level
|
|
||||||
* @deprecated see {@link #getGroup(org.bukkit.entity.Player)}
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
public static int getLevel(Player player) {
|
|
||||||
return umr.safeGetLevel(player.getUniqueId());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set a player's hack level
|
|
||||||
*
|
|
||||||
* @param player Player to set
|
|
||||||
* @param level Group to set to
|
|
||||||
* @deprecated see {@link #resetPlayer(org.bukkit.entity.Player)}
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
public static void setLevel(Player player, int level) {
|
|
||||||
umr.safeSetLevel(player.getUniqueId(), level);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reset a player's hack level to 0
|
* Reset a player's hack level to 0
|
||||||
*
|
*
|
||||||
@@ -173,7 +149,7 @@ public class AntiCheatAPI {
|
|||||||
* @return the AntiCheat Manager
|
* @return the AntiCheat Manager
|
||||||
*/
|
*/
|
||||||
public static AntiCheatManager getManager() {
|
public static AntiCheatManager getManager() {
|
||||||
return AntiCheat.getManager();
|
return AntiCheatReloaded.getManager();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* AntiCheat for Bukkit.
|
* AntiCheatReloaded for Bukkit and Spigot.
|
||||||
* Copyright (C) 2012-2014 AntiCheat Team | http://gravitydevelopment.net
|
* Copyright (c) 2012-2015 AntiCheat Team
|
||||||
|
* Copyright (c) 2016-2020 Rammelkast
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* AntiCheat for Bukkit.
|
* AntiCheatReloaded for Bukkit and Spigot.
|
||||||
* Copyright (C) 2012-2014 AntiCheat Team | http://gravitydevelopment.net
|
* Copyright (c) 2012-2015 AntiCheat Team
|
||||||
|
* Copyright (c) 2016-2020 Rammelkast
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -18,6 +19,7 @@
|
|||||||
|
|
||||||
package com.rammelkast.anticheatreloaded.check;
|
package com.rammelkast.anticheatreloaded.check;
|
||||||
|
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
@@ -25,7 +27,6 @@ import java.util.List;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import org.bukkit.ChatColor;
|
|
||||||
import org.bukkit.GameMode;
|
import org.bukkit.GameMode;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
@@ -37,7 +38,7 @@ import org.bukkit.entity.Player;
|
|||||||
import org.bukkit.event.player.PlayerToggleSprintEvent;
|
import org.bukkit.event.player.PlayerToggleSprintEvent;
|
||||||
import org.bukkit.potion.PotionEffectType;
|
import org.bukkit.potion.PotionEffectType;
|
||||||
|
|
||||||
import com.rammelkast.anticheatreloaded.AntiCheat;
|
import com.rammelkast.anticheatreloaded.AntiCheatReloaded;
|
||||||
import com.rammelkast.anticheatreloaded.check.combat.KillAuraCheck;
|
import com.rammelkast.anticheatreloaded.check.combat.KillAuraCheck;
|
||||||
import com.rammelkast.anticheatreloaded.check.combat.VelocityCheck;
|
import com.rammelkast.anticheatreloaded.check.combat.VelocityCheck;
|
||||||
import com.rammelkast.anticheatreloaded.check.movement.BlinkCheck;
|
import com.rammelkast.anticheatreloaded.check.movement.BlinkCheck;
|
||||||
@@ -262,7 +263,7 @@ public class Backend {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public CheckResult checkYSpeed(Player player, double y) {
|
public CheckResult checkYSpeed(Player player, double y) {
|
||||||
if (!isMovingExempt(player) && !player.isInsideVehicle() && !player.isSleeping() && (y > (VersionUtil.isNewYSpeed() ? magic.Y_SPEED_MAX() + 0.05 : magic.Y_SPEED_MAX())) && !isDoing(player, velocitized, magic.VELOCITY_TIME()) && !player.hasPotionEffect(PotionEffectType.JUMP) && !VersionUtil.isFlying(player)) {
|
if (!isMovingExempt(player) && !player.isInsideVehicle() && !player.isSleeping() && (y > magic.Y_SPEED_MAX()) && !isDoing(player, velocitized, magic.VELOCITY_TIME()) && !player.hasPotionEffect(PotionEffectType.JUMP) && !VersionUtil.isFlying(player)) {
|
||||||
return new CheckResult(CheckResult.Result.FAILED, player.getName() + "'s y speed was too high (speed=" + y + ", max=" + magic.Y_SPEED_MAX() + ")");
|
return new CheckResult(CheckResult.Result.FAILED, player.getName() + "'s y speed was too high (speed=" + y + ", max=" + magic.Y_SPEED_MAX() + ")");
|
||||||
} else {
|
} else {
|
||||||
return PASS;
|
return PASS;
|
||||||
@@ -432,7 +433,7 @@ public class Backend {
|
|||||||
public CheckResult checkSwing(Player player, Block block) {
|
public CheckResult checkSwing(Player player, Block block) {
|
||||||
UUID uuid = player.getUniqueId();
|
UUID uuid = player.getUniqueId();
|
||||||
if (!isInstantBreakExempt(player)) {
|
if (!isInstantBreakExempt(player)) {
|
||||||
if (!player.getInventory().getItemInHand().containsEnchantment(Enchantment.DIG_SPEED) && !(player.getInventory().getItemInHand().getType() == Material.SHEARS && block.getType() == Material.LEAVES)) {
|
if (!VersionUtil.getItemInHand(player).containsEnchantment(Enchantment.DIG_SPEED) && !(VersionUtil.getItemInHand(player).getType() == Material.SHEARS && block.getType().name().endsWith("LEAVES"))) {
|
||||||
if (blockPunches.get(uuid) != null && player.getGameMode() != GameMode.CREATIVE) {
|
if (blockPunches.get(uuid) != null && player.getGameMode() != GameMode.CREATIVE) {
|
||||||
int i = blockPunches.get(uuid);
|
int i = blockPunches.get(uuid);
|
||||||
if (i < magic.BLOCK_PUNCH_MIN()) {
|
if (i < magic.BLOCK_PUNCH_MIN()) {
|
||||||
@@ -448,7 +449,7 @@ public class Backend {
|
|||||||
|
|
||||||
public CheckResult checkFastBreak(Player player, Block block) {
|
public CheckResult checkFastBreak(Player player, Block block) {
|
||||||
int violations = magic.FASTBREAK_MAXVIOLATIONS();
|
int violations = magic.FASTBREAK_MAXVIOLATIONS();
|
||||||
long timemax = isInstantBreakExempt(player) ? 0 : Utilities.calcSurvivalFastBreak(player.getInventory().getItemInHand(), block.getType());
|
long timemax = isInstantBreakExempt(player) ? 0 : Utilities.calcSurvivalFastBreak(VersionUtil.getItemInHand(player), block.getType());
|
||||||
if (player.getGameMode() == GameMode.CREATIVE) {
|
if (player.getGameMode() == GameMode.CREATIVE) {
|
||||||
violations = magic.FASTBREAK_MAXVIOLATIONS_CREATIVE();
|
violations = magic.FASTBREAK_MAXVIOLATIONS_CREATIVE();
|
||||||
timemax = magic.FASTBREAK_TIMEMAX_CREATIVE();
|
timemax = magic.FASTBREAK_TIMEMAX_CREATIVE();
|
||||||
@@ -517,14 +518,14 @@ public class Backend {
|
|||||||
fastPlaceViolation.put(uuid, 0);
|
fastPlaceViolation.put(uuid, 0);
|
||||||
}
|
}
|
||||||
} else if (fastPlaceViolation.containsKey(uuid) && fastPlaceViolation.get(uuid) > violations) {
|
} else if (fastPlaceViolation.containsKey(uuid) && fastPlaceViolation.get(uuid) > violations) {
|
||||||
AntiCheat.debugLog("Noted that fastPlaceViolation contains key " + uuid + " with value " + fastPlaceViolation.get(uuid));
|
AntiCheatReloaded.debugLog("Noted that fastPlaceViolation contains key " + uuid + " with value " + fastPlaceViolation.get(uuid));
|
||||||
Long math = System.currentTimeMillis() - lastBlockPlaced.get(uuid);
|
Long math = System.currentTimeMillis() - lastBlockPlaced.get(uuid);
|
||||||
AntiCheat.debugLog("Player lastBlockPlaced value = " + lastBlockPlaced + ", diff=" + math);
|
AntiCheatReloaded.debugLog("Player lastBlockPlaced value = " + lastBlockPlaced + ", diff=" + math);
|
||||||
if (lastBlockPlaced.get(uuid) > 0 && math < magic.FASTPLACE_MAXVIOLATIONTIME()) {
|
if (lastBlockPlaced.get(uuid) > 0 && math < magic.FASTPLACE_MAXVIOLATIONTIME()) {
|
||||||
lastBlockPlaced.put(uuid, time);
|
lastBlockPlaced.put(uuid, time);
|
||||||
return new CheckResult(CheckResult.Result.FAILED, player.getName() + " placed blocks too fast " + fastBreakViolation.get(uuid) + " times in a row (max=" + violations + ")");
|
return new CheckResult(CheckResult.Result.FAILED, player.getName() + " placed blocks too fast " + fastBreakViolation.get(uuid) + " times in a row (max=" + violations + ")");
|
||||||
} else if (lastBlockPlaced.get(uuid) > 0 && math > magic.FASTPLACE_MAXVIOLATIONTIME()) {
|
} else if (lastBlockPlaced.get(uuid) > 0 && math > magic.FASTPLACE_MAXVIOLATIONTIME()) {
|
||||||
AntiCheat.debugLog("Reset facePlaceViolation for " + uuid);
|
AntiCheatReloaded.debugLog("Reset facePlaceViolation for " + uuid);
|
||||||
fastPlaceViolation.put(uuid, 0);
|
fastPlaceViolation.put(uuid, 0);
|
||||||
}
|
}
|
||||||
} else if (lastBlockPlaced.containsKey(uuid)) {
|
} else if (lastBlockPlaced.containsKey(uuid)) {
|
||||||
@@ -585,6 +586,20 @@ public class Backend {
|
|||||||
return PASS;
|
return PASS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public CheckResult checkChatUnicode(Player player, String msg) {
|
||||||
|
UUID uuid = player.getUniqueId();
|
||||||
|
User user = manager.getUserManager().getUser(uuid);
|
||||||
|
if (!isPureAscii(msg)) {
|
||||||
|
return new CheckResult(CheckResult.Result.FAILED, "Unicode chat is not allowed.");
|
||||||
|
}
|
||||||
|
user.addMessage(msg);
|
||||||
|
return PASS;
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean isPureAscii(String v) {
|
||||||
|
return StandardCharsets.US_ASCII.newEncoder().canEncode(v.replaceAll("¡", "!").replaceAll("¿", "?"));
|
||||||
|
}
|
||||||
|
|
||||||
public CheckResult checkCommandSpam(Player player, String cmd) {
|
public CheckResult checkCommandSpam(Player player, String cmd) {
|
||||||
UUID uuid = player.getUniqueId();
|
UUID uuid = player.getUniqueId();
|
||||||
User user = manager.getUserManager().getUser(uuid);
|
User user = manager.getUserManager().getUser(uuid);
|
||||||
@@ -635,8 +650,8 @@ public class Backend {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public CheckResult checkAutoTool(Player player) {
|
public CheckResult checkAutoTool(Player player) {
|
||||||
if (itemInHand.containsKey(player.getUniqueId()) && itemInHand.get(player.getUniqueId()) != player.getItemInHand().getType()) {
|
if (itemInHand.containsKey(player.getUniqueId()) && itemInHand.get(player.getUniqueId()) != VersionUtil.getItemInHand(player).getType()) {
|
||||||
return new CheckResult(CheckResult.Result.FAILED, player.getName() + " switched tools too fast (had " + itemInHand.get(player.getName()) + ", has " + player.getItemInHand().getType() + ")");
|
return new CheckResult(CheckResult.Result.FAILED, player.getName() + " switched tools too fast (had " + itemInHand.get(player.getUniqueId()) + ", has " + VersionUtil.getItemInHand(player).getType() + ")");
|
||||||
} else {
|
} else {
|
||||||
return PASS;
|
return PASS;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* AntiCheat for Bukkit.
|
* AntiCheatReloaded for Bukkit and Spigot.
|
||||||
* Copyright (C) 2012-2014 AntiCheat Team | http://gravitydevelopment.net
|
* Copyright (c) 2012-2015 AntiCheat Team
|
||||||
|
* Copyright (c) 2016-2020 Rammelkast
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* AntiCheat for Bukkit.
|
* AntiCheatReloaded for Bukkit and Spigot.
|
||||||
* Copyright (C) 2012-2014 AntiCheat Team | http://gravitydevelopment.net
|
* Copyright (c) 2012-2015 AntiCheat Team
|
||||||
|
* Copyright (c) 2016-2020 Rammelkast
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -38,7 +39,8 @@ public enum CheckType {
|
|||||||
ZOMBE_FLY(Permission.CHECK_ZOMBE_FLY),
|
ZOMBE_FLY(Permission.CHECK_ZOMBE_FLY),
|
||||||
ZOMBE_NOCLIP(Permission.CHECK_ZOMBE_NOCLIP),
|
ZOMBE_NOCLIP(Permission.CHECK_ZOMBE_NOCLIP),
|
||||||
ZOMBE_CHEAT(Permission.CHECK_ZOMBE_CHEAT),
|
ZOMBE_CHEAT(Permission.CHECK_ZOMBE_CHEAT),
|
||||||
FLY(Permission.CHECK_FLY),
|
FLIGHT(Permission.CHECK_FLIGHT),
|
||||||
|
ELYTRA(Permission.CHECK_FLIGHT),
|
||||||
WATER_WALK(Permission.CHECK_WATERWALK),
|
WATER_WALK(Permission.CHECK_WATERWALK),
|
||||||
NO_SWING(Permission.CHECK_NOSWING),
|
NO_SWING(Permission.CHECK_NOSWING),
|
||||||
FAST_BREAK(Permission.CHECK_FASTBREAK),
|
FAST_BREAK(Permission.CHECK_FASTBREAK),
|
||||||
@@ -62,8 +64,9 @@ public enum CheckType {
|
|||||||
AUTOTOOL(Permission.CHECK_AUTOTOOL),
|
AUTOTOOL(Permission.CHECK_AUTOTOOL),
|
||||||
KILLAURA(Permission.CHECK_KILLAURA),
|
KILLAURA(Permission.CHECK_KILLAURA),
|
||||||
BLINK(Permission.CHECK_BLINK),
|
BLINK(Permission.CHECK_BLINK),
|
||||||
VELOCITY(Permission.VELOCITY),
|
VELOCITY(Permission.CHECK_VELOCITY),
|
||||||
CRITICALS(Permission.CRITICALS);
|
CRITICALS(Permission.CHECK_CRITICALS),
|
||||||
|
CHAT_UNICODE(Permission.CHECK_UNICODE);
|
||||||
|
|
||||||
private final Permission permission;
|
private final Permission permission;
|
||||||
private final Map<UUID, Integer> level = new HashMap<UUID, Integer>();
|
private final Map<UUID, Integer> level = new HashMap<UUID, Integer>();
|
||||||
|
|||||||
@@ -1,3 +1,21 @@
|
|||||||
|
/*
|
||||||
|
* AntiCheatReloaded for Bukkit and Spigot.
|
||||||
|
* Copyright (c) 2012-2015 AntiCheat Team
|
||||||
|
* Copyright (c) 2016-2020 Rammelkast
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
package com.rammelkast.anticheatreloaded.check.combat;
|
package com.rammelkast.anticheatreloaded.check.combat;
|
||||||
|
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
@@ -16,17 +34,24 @@ public class CriticalsCheck {
|
|||||||
public static void doDamageEvent(EntityDamageByEntityEvent e, Player damager) {
|
public static void doDamageEvent(EntityDamageByEntityEvent e, Player damager) {
|
||||||
if (!(e.getDamager() instanceof Player) || e.getCause() != DamageCause.ENTITY_ATTACK)
|
if (!(e.getDamager() instanceof Player) || e.getCause() != DamageCause.ENTITY_ATTACK)
|
||||||
return;
|
return;
|
||||||
Player p = (Player)e.getDamager();
|
Player p = (Player) e.getDamager();
|
||||||
if (isCritical(p)) {
|
if (isCritical(p)) {
|
||||||
if ((p.getLocation().getY() % 1.0 == 0 || p.getLocation().getY() % 0.5 == 0) && p.getLocation().clone().subtract(0, 1.0, 0).getBlock().getType().isSolid()) {
|
if ((p.getLocation().getY() % 1.0 == 0 || p.getLocation().getY() % 0.5 == 0)
|
||||||
|
&& p.getLocation().clone().subtract(0, 1.0, 0).getBlock().getType().isSolid()) {
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
EventListener.log(new CheckResult(CheckResult.Result.FAILED, p.getName() + " failed Criticals, tried to do a critical without needed conditions").getMessage(), p, CheckType.CRITICALS);
|
EventListener.log(new CheckResult(CheckResult.Result.FAILED,
|
||||||
|
p.getName() + " failed Criticals, tried to do a critical without needed conditions")
|
||||||
|
.getMessage(),
|
||||||
|
p, CheckType.CRITICALS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean isCritical(Player player) {
|
private static boolean isCritical(Player player) {
|
||||||
return player.getFallDistance() > 0.0f && !player.isOnGround() && !player.isInsideVehicle() && !player.hasPotionEffect(PotionEffectType.BLINDNESS) && !Utilities.isHoveringOverWater(player.getLocation()) && player.getEyeLocation().getBlock().getType() != Material.LADDER;
|
return player.getFallDistance() > 0.0f && !player.isOnGround() && !player.isInsideVehicle()
|
||||||
|
&& !player.hasPotionEffect(PotionEffectType.BLINDNESS)
|
||||||
|
&& !Utilities.isHoveringOverWater(player.getLocation())
|
||||||
|
&& player.getEyeLocation().getBlock().getType() != Material.LADDER;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,44 +1,50 @@
|
|||||||
package com.rammelkast.anticheatreloaded.check.combat;
|
/*
|
||||||
|
* AntiCheatReloaded for Bukkit and Spigot.
|
||||||
|
* Copyright (c) 2012-2015 AntiCheat Team
|
||||||
|
* Copyright (c) 2016-2020 Rammelkast
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
import java.util.HashMap;
|
package com.rammelkast.anticheatreloaded.check.combat;
|
||||||
import java.util.Map;
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||||
import org.bukkit.event.player.PlayerMoveEvent;
|
import org.bukkit.event.player.PlayerMoveEvent;
|
||||||
|
|
||||||
import com.comphenix.protocol.PacketType;
|
|
||||||
import com.comphenix.protocol.events.ListenerPriority;
|
|
||||||
import com.comphenix.protocol.events.PacketAdapter;
|
|
||||||
import com.comphenix.protocol.events.PacketEvent;
|
|
||||||
import com.rammelkast.anticheatreloaded.AntiCheat;
|
|
||||||
import com.rammelkast.anticheatreloaded.check.CheckResult;
|
|
||||||
import com.rammelkast.anticheatreloaded.check.CheckType;
|
|
||||||
import com.rammelkast.anticheatreloaded.event.EventListener;
|
|
||||||
import com.rammelkast.anticheatreloaded.util.NPC_1_11;
|
|
||||||
import com.rammelkast.anticheatreloaded.util.VersionUtil;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Rammelkast
|
* @author Rammelkast
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
public class KillAuraCheck {
|
public class KillAuraCheck {
|
||||||
|
|
||||||
private static final Map<UUID, NPC_1_11> NPC_LIST = new HashMap<UUID, NPC_1_11>();
|
//private static final Map<UUID, NPC_1_12> NPC_LIST = new HashMap<UUID, NPC_1_12>();
|
||||||
private static final Map<UUID, Integer> VL_COUNT = new HashMap<UUID, Integer>();
|
//private static final Map<UUID, Integer> VL_COUNT = new HashMap<UUID, Integer>();
|
||||||
|
|
||||||
public static void cleanPlayer(Player p) {
|
public static void cleanPlayer(Player p) {
|
||||||
if (!VersionUtil.getVersion().equals("v1_11_R1")) {
|
/*if (!VersionUtil.getVersion().equals("v1_12_R1")) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
NPC_LIST.remove(p.getUniqueId());
|
NPC_LIST.remove(p.getUniqueId());*/
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void listenPackets() {
|
public static void listenPackets() {
|
||||||
if (!VersionUtil.getVersion().equals("v1_11_R1")) {
|
/*if (!VersionUtil.getVersion().equals("v1_12_R1")) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
AntiCheat.getProtocolManager().addPacketListener(new PacketAdapter(AntiCheat.getPlugin(), ListenerPriority.NORMAL, new PacketType[] {PacketType.Play.Client.USE_ENTITY}) {
|
AntiCheatReloaded.getProtocolManager().addPacketListener(new PacketAdapter(AntiCheatReloaded.getPlugin(),
|
||||||
|
ListenerPriority.NORMAL, new PacketType[] { PacketType.Play.Client.USE_ENTITY }) {
|
||||||
@Override
|
@Override
|
||||||
public void onPacketReceiving(PacketEvent e) {
|
public void onPacketReceiving(PacketEvent e) {
|
||||||
Player p = e.getPlayer();
|
Player p = e.getPlayer();
|
||||||
@@ -53,38 +59,42 @@ public class KillAuraCheck {
|
|||||||
if (!VL_COUNT.containsKey(p.getUniqueId())) {
|
if (!VL_COUNT.containsKey(p.getUniqueId())) {
|
||||||
VL_COUNT.put(p.getUniqueId(), 1);
|
VL_COUNT.put(p.getUniqueId(), 1);
|
||||||
NPC_LIST.get(p.getUniqueId()).damage();
|
NPC_LIST.get(p.getUniqueId()).damage();
|
||||||
}else {
|
} else {
|
||||||
VL_COUNT.put(p.getUniqueId(), VL_COUNT.get(p.getUniqueId()) + 1);
|
VL_COUNT.put(p.getUniqueId(), VL_COUNT.get(p.getUniqueId()) + 1);
|
||||||
if (VL_COUNT.get(p.getUniqueId()) >= 5) {
|
if (VL_COUNT.get(p.getUniqueId()) >= 5) {
|
||||||
EventListener.log(new CheckResult(CheckResult.Result.FAILED, p.getName() + " failed KillAura (botcheck), hit the bot " + VL_COUNT.get(p.getUniqueId()) + " times (max=5)").getMessage(), p, CheckType.KILLAURA);
|
EventListener.log(
|
||||||
AntiCheat.getPlugin().onKillAuraViolation();
|
new CheckResult(CheckResult.Result.FAILED,
|
||||||
|
p.getName() + " failed KillAura (botcheck), hit the bot "
|
||||||
|
+ VL_COUNT.get(p.getUniqueId()) + " times (max=5)").getMessage(),
|
||||||
|
p, CheckType.KILLAURA);
|
||||||
|
AntiCheatReloaded.getPlugin().onKillAuraViolation();
|
||||||
VL_COUNT.remove(p.getUniqueId());
|
VL_COUNT.remove(p.getUniqueId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});*/
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void doDamageEvent(EntityDamageByEntityEvent e, Player p) {
|
public static void doDamageEvent(EntityDamageByEntityEvent e, Player p) {
|
||||||
if (!VersionUtil.getVersion().equals("v1_11_R1")) {
|
/*if (!VersionUtil.getVersion().equals("v1_12_R1")) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (NPC_LIST.containsKey(p.getUniqueId()))
|
if (NPC_LIST.containsKey(p.getUniqueId()))
|
||||||
NPC_LIST.get(p.getUniqueId()).damage(e, p);
|
NPC_LIST.get(p.getUniqueId()).damage(e, p);
|
||||||
else {
|
else {
|
||||||
NPC_1_11 npc = new NPC_1_11(p);
|
NPC_1_12 npc = new NPC_1_12(p);
|
||||||
NPC_LIST.put(p.getUniqueId(), npc);
|
NPC_LIST.put(p.getUniqueId(), npc);
|
||||||
npc.spawn();
|
npc.spawn();
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void doMove(PlayerMoveEvent e) {
|
public static void doMove(PlayerMoveEvent e) {
|
||||||
if (!VersionUtil.getVersion().equals("v1_11_R1")) {
|
/*if (!VersionUtil.getVersion().equals("v1_12_R1")) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (NPC_LIST.containsKey(e.getPlayer().getUniqueId())) {
|
if (NPC_LIST.containsKey(e.getPlayer().getUniqueId())) {
|
||||||
NPC_LIST.get(e.getPlayer().getUniqueId()).move(e);
|
NPC_LIST.get(e.getPlayer().getUniqueId()).move(e);
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,3 +1,22 @@
|
|||||||
|
/*
|
||||||
|
* AntiCheatReloaded for Bukkit and Spigot.
|
||||||
|
* Copyright (c) 2012-2015 AntiCheat Team
|
||||||
|
* Copyright (c) 2016-2020 Rammelkast
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
package com.rammelkast.anticheatreloaded.check.combat;
|
package com.rammelkast.anticheatreloaded.check.combat;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@@ -9,7 +28,7 @@ import org.bukkit.entity.Player;
|
|||||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||||
import org.bukkit.scheduler.BukkitRunnable;
|
import org.bukkit.scheduler.BukkitRunnable;
|
||||||
|
|
||||||
import com.rammelkast.anticheatreloaded.AntiCheat;
|
import com.rammelkast.anticheatreloaded.AntiCheatReloaded;
|
||||||
import com.rammelkast.anticheatreloaded.check.CheckResult;
|
import com.rammelkast.anticheatreloaded.check.CheckResult;
|
||||||
import com.rammelkast.anticheatreloaded.check.CheckType;
|
import com.rammelkast.anticheatreloaded.check.CheckType;
|
||||||
import com.rammelkast.anticheatreloaded.event.EventListener;
|
import com.rammelkast.anticheatreloaded.event.EventListener;
|
||||||
@@ -23,7 +42,8 @@ public class VelocityCheck {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void runCheck(EntityDamageByEntityEvent e, final Player p) {
|
public static void runCheck(EntityDamageByEntityEvent e, final Player p) {
|
||||||
if (AntiCheat.getManager().getCheckManager().isOpExempt(p) || AntiCheat.getManager().getCheckManager().isExempt(p, CheckType.VELOCITY))
|
if (AntiCheatReloaded.getManager().getCheckManager().isOpExempt(p)
|
||||||
|
|| AntiCheatReloaded.getManager().getCheckManager().isExempt(p, CheckType.VELOCITY))
|
||||||
return;
|
return;
|
||||||
final Location then = p.getLocation();
|
final Location then = p.getLocation();
|
||||||
new BukkitRunnable() {
|
new BukkitRunnable() {
|
||||||
@@ -36,16 +56,22 @@ public class VelocityCheck {
|
|||||||
VL_COUNT.put(p.getUniqueId(), 1);
|
VL_COUNT.put(p.getUniqueId(), 1);
|
||||||
else {
|
else {
|
||||||
VL_COUNT.put(p.getUniqueId(), VL_COUNT.get(p.getUniqueId()) + 1);
|
VL_COUNT.put(p.getUniqueId(), VL_COUNT.get(p.getUniqueId()) + 1);
|
||||||
if (VL_COUNT.get(p.getUniqueId()) > AntiCheat.getManager().getBackend().getMagic().VELOCITY_AMT()) {
|
if (VL_COUNT.get(p.getUniqueId()) > AntiCheatReloaded.getManager().getBackend().getMagic()
|
||||||
EventListener.log(new CheckResult(CheckResult.Result.FAILED, p.getName() + " failed Velocity, had zero/low velocity " + VL_COUNT.get(p.getUniqueId()) + " times (max=" + AntiCheat.getManager().getBackend().getMagic().VELOCITY_AMT() + ", dist=" + then.distance(p.getLocation()) + ")").getMessage(), p, CheckType.VELOCITY);
|
.VELOCITY_AMT()) {
|
||||||
|
EventListener.log(new CheckResult(CheckResult.Result.FAILED,
|
||||||
|
p.getName() + " failed Velocity, had zero/low velocity "
|
||||||
|
+ VL_COUNT.get(p.getUniqueId()) + " times (max="
|
||||||
|
+ AntiCheatReloaded.getManager().getBackend().getMagic().VELOCITY_AMT()
|
||||||
|
+ ", dist=" + then.distance(p.getLocation()) + ")").getMessage(),
|
||||||
|
p, CheckType.VELOCITY);
|
||||||
VL_COUNT.remove(p.getUniqueId());
|
VL_COUNT.remove(p.getUniqueId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else {
|
} else {
|
||||||
VL_COUNT.remove(p.getUniqueId());
|
VL_COUNT.remove(p.getUniqueId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}.runTaskLater(AntiCheat.getPlugin(), 4);
|
}.runTaskLater(AntiCheatReloaded.getPlugin(), 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,9 +1,29 @@
|
|||||||
|
/*
|
||||||
|
* AntiCheatReloaded for Bukkit and Spigot.
|
||||||
|
* Copyright (c) 2012-2015 AntiCheat Team
|
||||||
|
* Copyright (c) 2016-2020 Rammelkast
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
package com.rammelkast.anticheatreloaded.check.movement;
|
package com.rammelkast.anticheatreloaded.check.movement;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.scheduler.BukkitRunnable;
|
import org.bukkit.scheduler.BukkitRunnable;
|
||||||
@@ -12,10 +32,11 @@ import com.comphenix.protocol.PacketType;
|
|||||||
import com.comphenix.protocol.events.ListenerPriority;
|
import com.comphenix.protocol.events.ListenerPriority;
|
||||||
import com.comphenix.protocol.events.PacketAdapter;
|
import com.comphenix.protocol.events.PacketAdapter;
|
||||||
import com.comphenix.protocol.events.PacketEvent;
|
import com.comphenix.protocol.events.PacketEvent;
|
||||||
import com.rammelkast.anticheatreloaded.AntiCheat;
|
import com.rammelkast.anticheatreloaded.AntiCheatReloaded;
|
||||||
import com.rammelkast.anticheatreloaded.check.CheckResult;
|
import com.rammelkast.anticheatreloaded.check.CheckResult;
|
||||||
import com.rammelkast.anticheatreloaded.check.CheckType;
|
import com.rammelkast.anticheatreloaded.check.CheckType;
|
||||||
import com.rammelkast.anticheatreloaded.event.EventListener;
|
import com.rammelkast.anticheatreloaded.event.EventListener;
|
||||||
|
import com.rammelkast.anticheatreloaded.util.VersionUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Rammelkast
|
* @author Rammelkast
|
||||||
@@ -30,26 +51,54 @@ public class BlinkCheck {
|
|||||||
public void run() {
|
public void run() {
|
||||||
MOVE_COUNT.clear();
|
MOVE_COUNT.clear();
|
||||||
}
|
}
|
||||||
}.runTaskTimer(AntiCheat.getPlugin(), 20, 20);
|
}.runTaskTimer(AntiCheatReloaded.getPlugin(), 100, 20);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void listenPackets() {
|
public static void listenPackets() {
|
||||||
AntiCheat.getProtocolManager().addPacketListener(new PacketAdapter(AntiCheat.getPlugin(), ListenerPriority.NORMAL, new PacketType[] {PacketType.Play.Client.POSITION, PacketType.Play.Client.POSITION_LOOK}) {
|
AntiCheatReloaded.getProtocolManager()
|
||||||
|
.addPacketListener(new PacketAdapter(AntiCheatReloaded.getPlugin(), ListenerPriority.NORMAL,
|
||||||
|
new PacketType[] { PacketType.Play.Client.POSITION, PacketType.Play.Client.POSITION_LOOK }) {
|
||||||
@Override
|
@Override
|
||||||
public void onPacketReceiving(PacketEvent e) {
|
public void onPacketReceiving(PacketEvent e) {
|
||||||
Player p = e.getPlayer();
|
Player p = e.getPlayer();
|
||||||
Location cur = e.getPlayer().getLocation();
|
Location cur = e.getPlayer().getLocation();
|
||||||
if (!MOVE_COUNT.containsKey(p.getUniqueId()))
|
if (!MOVE_COUNT.containsKey(p.getUniqueId())) {
|
||||||
MOVE_COUNT.put(p.getUniqueId(), 1);
|
MOVE_COUNT.put(p.getUniqueId(), 1);
|
||||||
else {
|
} else {
|
||||||
MOVE_COUNT.put(p.getUniqueId(), MOVE_COUNT.get(p.getUniqueId()) + 1);
|
MOVE_COUNT.put(p.getUniqueId(), MOVE_COUNT.get(p.getUniqueId()) + 1);
|
||||||
if (AntiCheat.getManager().getCheckManager().checkInWorld(p) && !AntiCheat.getManager().getCheckManager().isOpExempt(p) && !AntiCheat.getManager().getCheckManager().isExempt(p, CheckType.BLINK)) {
|
if (AntiCheatReloaded.getManager().getCheckManager().checkInWorld(p)
|
||||||
if (MOVE_COUNT.get(p.getUniqueId()) > AntiCheat.getManager().getBackend().getMagic().BLINK_PACKET()) {
|
&& !AntiCheatReloaded.getManager().getCheckManager().isOpExempt(p)
|
||||||
EventListener.log(new CheckResult(CheckResult.Result.FAILED, p.getName() + " failed Blink, sent " + MOVE_COUNT.get(p.getUniqueId()) + " packets in one second (max=" + AntiCheat.getManager().getBackend().getMagic().BLINK_PACKET() + ")").getMessage(), p, CheckType.BLINK);
|
&& !AntiCheatReloaded.getManager().getCheckManager().isExempt(p, CheckType.BLINK)) {
|
||||||
|
int ping = VersionUtil.getPlayerPing(p);
|
||||||
|
int blinkMagic = AntiCheatReloaded.getManager().getBackend()
|
||||||
|
.getMagic().BLINK_PACKET();
|
||||||
|
float pingLeniency = (float) ((ping / 120));
|
||||||
|
if (pingLeniency < 1) pingLeniency = 1;
|
||||||
|
if (pingLeniency > 3) pingLeniency = 3;
|
||||||
|
blinkMagic = Math.round(pingLeniency * blinkMagic);
|
||||||
|
final float finalPingLeniency = pingLeniency;
|
||||||
|
try {
|
||||||
|
if (MOVE_COUNT.get(p.getUniqueId()) > blinkMagic) {
|
||||||
|
final int packets = MOVE_COUNT.get(p.getUniqueId());
|
||||||
MOVE_COUNT.remove(p.getUniqueId());
|
MOVE_COUNT.remove(p.getUniqueId());
|
||||||
|
AntiCheatReloaded.sendToMainThread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
EventListener.log(
|
||||||
|
new CheckResult(CheckResult.Result.FAILED, p.getName()
|
||||||
|
+ " failed Blink, sent " + packets
|
||||||
|
+ " packets in one second (max=" + AntiCheatReloaded.getManager()
|
||||||
|
.getBackend().getMagic().BLINK_PACKET()
|
||||||
|
+ ", leniency=" + finalPingLeniency + ", ping=" + ping + ")").getMessage(),
|
||||||
|
p, CheckType.BLINK);
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
e.getPlayer().teleport(cur);
|
e.getPlayer().teleport(cur);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} catch (NullPointerException nullPointer) {
|
||||||
|
// TODO this is thrown sometimes, might have something to do with line 83
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,58 @@
|
|||||||
|
/*
|
||||||
|
* AntiCheatReloaded for Bukkit and Spigot.
|
||||||
|
* Copyright (c) 2012-2015 AntiCheat Team
|
||||||
|
* Copyright (c) 2016-2020 Rammelkast
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.rammelkast.anticheatreloaded.check.movement;
|
||||||
|
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.block.BlockFace;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import com.rammelkast.anticheatreloaded.AntiCheatReloaded;
|
||||||
|
import com.rammelkast.anticheatreloaded.check.CheckResult;
|
||||||
|
import com.rammelkast.anticheatreloaded.util.Distance;
|
||||||
|
import com.rammelkast.anticheatreloaded.util.Utilities;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TODO
|
||||||
|
*/
|
||||||
|
public class ElytraCheck {
|
||||||
|
|
||||||
|
private static final CheckResult PASS = new CheckResult(CheckResult.Result.PASSED);
|
||||||
|
|
||||||
|
public static CheckResult runCheck(Player player, Distance distance) {
|
||||||
|
if (distance.getYDifference() > AntiCheatReloaded.getManager().getBackend().getMagic().TELEPORT_MIN()) {
|
||||||
|
// This was a teleport, so skip check.
|
||||||
|
return PASS;
|
||||||
|
}
|
||||||
|
/*if (!FlightCheck.isMovingExempt(player) && !Utilities.isHoveringOverWater(player.getLocation(), 1)
|
||||||
|
&& Utilities.cantStandAtExp(player.getLocation())
|
||||||
|
&& Utilities.blockIsnt(player.getLocation().getBlock().getRelative(BlockFace.DOWN),
|
||||||
|
new Material[] { Material.FENCE, Material.FENCE_GATE, Material.COBBLE_WALL,
|
||||||
|
Material.ACACIA_FENCE, Material.ACACIA_FENCE_GATE, Material.BIRCH_FENCE,
|
||||||
|
Material.BIRCH_FENCE_GATE, Material.DARK_OAK_FENCE, Material.DARK_OAK_FENCE_GATE,
|
||||||
|
Material.IRON_FENCE, Material.JUNGLE_FENCE, Material.JUNGLE_FENCE_GATE,
|
||||||
|
Material.fence, Material.SPRUCE_FENCE, Material.SPRUCE_FENCE_GATE, Material.IRON_BARS })) {
|
||||||
|
|
||||||
|
}*/
|
||||||
|
//TODO 1.15 update
|
||||||
|
|
||||||
|
return PASS;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
package com.rammelkast.anticheatreloaded.check.movement;
|
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
|
|
||||||
import com.rammelkast.anticheatreloaded.check.CheckResult;
|
|
||||||
import com.rammelkast.anticheatreloaded.util.Distance;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* TODO
|
|
||||||
*/
|
|
||||||
public class ElytraFly {
|
|
||||||
|
|
||||||
private static final CheckResult PASS = new CheckResult(CheckResult.Result.PASSED);
|
|
||||||
|
|
||||||
public static CheckResult runCheck(Player player, Distance distance) {
|
|
||||||
return PASS;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,3 +1,22 @@
|
|||||||
|
/*
|
||||||
|
* AntiCheatReloaded for Bukkit and Spigot.
|
||||||
|
* Copyright (c) 2012-2015 AntiCheat Team
|
||||||
|
* Copyright (c) 2016-2020 Rammelkast
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
package com.rammelkast.anticheatreloaded.check.movement;
|
package com.rammelkast.anticheatreloaded.check.movement;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@@ -8,15 +27,14 @@ import org.bukkit.Material;
|
|||||||
import org.bukkit.block.BlockFace;
|
import org.bukkit.block.BlockFace;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.rammelkast.anticheatreloaded.AntiCheat;
|
import com.rammelkast.anticheatreloaded.AntiCheatReloaded;
|
||||||
import com.rammelkast.anticheatreloaded.check.CheckResult;
|
import com.rammelkast.anticheatreloaded.check.CheckResult;
|
||||||
import com.rammelkast.anticheatreloaded.util.Distance;
|
import com.rammelkast.anticheatreloaded.util.Distance;
|
||||||
import com.rammelkast.anticheatreloaded.util.Utilities;
|
import com.rammelkast.anticheatreloaded.util.Utilities;
|
||||||
import com.rammelkast.anticheatreloaded.util.VersionUtil;
|
import com.rammelkast.anticheatreloaded.util.VersionUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* @author Rammelkast TODO rewrite this check
|
||||||
* @author Marco TODO rewrite this check
|
|
||||||
*/
|
*/
|
||||||
public class FlightCheck {
|
public class FlightCheck {
|
||||||
|
|
||||||
@@ -26,9 +44,9 @@ public class FlightCheck {
|
|||||||
public static Map<UUID, Long> movingExempt = new HashMap<UUID, Long>();
|
public static Map<UUID, Long> movingExempt = new HashMap<UUID, Long>();
|
||||||
|
|
||||||
public static CheckResult runCheck(Player player, Distance distance) {
|
public static CheckResult runCheck(Player player, Distance distance) {
|
||||||
if (distance.getYDifference() > AntiCheat.getManager().getBackend().getMagic().TELEPORT_MIN()
|
if (distance.getYDifference() > AntiCheatReloaded.getManager().getBackend().getMagic().TELEPORT_MIN()
|
||||||
|| VersionUtil.isFlying(player)) {
|
|| VersionUtil.isFlying(player)) {
|
||||||
// This was a teleport or user is flying/elyta'ing, so we don't care
|
// This was a teleport or user is flying/using elytra, so we don't care
|
||||||
// about it.
|
// about it.
|
||||||
return PASS;
|
return PASS;
|
||||||
}
|
}
|
||||||
@@ -38,7 +56,11 @@ public class FlightCheck {
|
|||||||
if (!isMovingExempt(player) && !Utilities.isHoveringOverWater(player.getLocation(), 1)
|
if (!isMovingExempt(player) && !Utilities.isHoveringOverWater(player.getLocation(), 1)
|
||||||
&& Utilities.cantStandAtExp(player.getLocation())
|
&& Utilities.cantStandAtExp(player.getLocation())
|
||||||
&& Utilities.blockIsnt(player.getLocation().getBlock().getRelative(BlockFace.DOWN),
|
&& Utilities.blockIsnt(player.getLocation().getBlock().getRelative(BlockFace.DOWN),
|
||||||
new Material[] { Material.FENCE, Material.FENCE_GATE, Material.COBBLE_WALL })) {
|
new Material[] { Material.IRON_BARS })
|
||||||
|
&& Utilities.blockIsnt(player.getLocation().getBlock().getRelative(BlockFace.DOWN), new String[] {
|
||||||
|
"FENCE",
|
||||||
|
"FENCE_GATE"
|
||||||
|
})) {
|
||||||
|
|
||||||
if (!blocksOverFlight.containsKey(uuid)) {
|
if (!blocksOverFlight.containsKey(uuid)) {
|
||||||
blocksOverFlight.put(uuid, 0D);
|
blocksOverFlight.put(uuid, 0D);
|
||||||
@@ -51,11 +73,11 @@ public class FlightCheck {
|
|||||||
blocksOverFlight.put(uuid, (blocksOverFlight.get(uuid) - distance.getYDifference()));
|
blocksOverFlight.put(uuid, (blocksOverFlight.get(uuid) - distance.getYDifference()));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (blocksOverFlight.get(uuid) > AntiCheat.getManager().getBackend().getMagic().FLIGHT_BLOCK_LIMIT()
|
if (blocksOverFlight.get(uuid) > AntiCheatReloaded.getManager().getBackend().getMagic().FLIGHT_BLOCK_LIMIT()
|
||||||
&& (y1 <= y2)) {
|
&& (y1 <= y2)) {
|
||||||
return new CheckResult(CheckResult.Result.FAILED,
|
return new CheckResult(CheckResult.Result.FAILED,
|
||||||
player.getName() + " flew over " + blocksOverFlight.get(uuid) + " blocks (max="
|
player.getName() + " flew over " + blocksOverFlight.get(uuid) + " blocks (max="
|
||||||
+ AntiCheat.getManager().getBackend().getMagic().FLIGHT_BLOCK_LIMIT() + ")");
|
+ AntiCheatReloaded.getManager().getBackend().getMagic().FLIGHT_BLOCK_LIMIT() + ")");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
blocksOverFlight.put(uuid, 0D);
|
blocksOverFlight.put(uuid, 0D);
|
||||||
|
|||||||
@@ -1,3 +1,22 @@
|
|||||||
|
/*
|
||||||
|
* AntiCheatReloaded for Bukkit and Spigot.
|
||||||
|
* Copyright (c) 2012-2015 AntiCheat Team
|
||||||
|
* Copyright (c) 2016-2020 Rammelkast
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
package com.rammelkast.anticheatreloaded.check.movement;
|
package com.rammelkast.anticheatreloaded.check.movement;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
@@ -5,17 +24,13 @@ import java.util.HashMap;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import org.bukkit.ChatColor;
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.block.BlockFace;
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.rammelkast.anticheatreloaded.AntiCheat;
|
import com.rammelkast.anticheatreloaded.AntiCheatReloaded;
|
||||||
import com.rammelkast.anticheatreloaded.check.Backend;
|
|
||||||
import com.rammelkast.anticheatreloaded.check.CheckResult;
|
import com.rammelkast.anticheatreloaded.check.CheckResult;
|
||||||
import com.rammelkast.anticheatreloaded.util.Distance;
|
import com.rammelkast.anticheatreloaded.util.Distance;
|
||||||
import com.rammelkast.anticheatreloaded.util.Utilities;
|
|
||||||
import com.rammelkast.anticheatreloaded.util.VersionUtil;
|
import com.rammelkast.anticheatreloaded.util.VersionUtil;
|
||||||
|
|
||||||
public class GlideCheck {
|
public class GlideCheck {
|
||||||
@@ -30,6 +45,9 @@ public class GlideCheck {
|
|||||||
if (VersionUtil.isFlying(player)) {
|
if (VersionUtil.isFlying(player)) {
|
||||||
return PASS;
|
return PASS;
|
||||||
}
|
}
|
||||||
|
if (player.getLocation().getBlock().getType() == Material.LADDER || player.getLocation().getBlock().getRelative(0, 1, 0).getType() == Material.LADDER) {
|
||||||
|
return PASS;
|
||||||
|
}
|
||||||
if (!lastDiff.containsKey(player.getUniqueId())) {
|
if (!lastDiff.containsKey(player.getUniqueId())) {
|
||||||
lastDiff.put(player.getUniqueId(), distance.getYDifference());
|
lastDiff.put(player.getUniqueId(), distance.getYDifference());
|
||||||
return PASS;
|
return PASS;
|
||||||
@@ -44,17 +62,23 @@ public class GlideCheck {
|
|||||||
if (!violations.containsKey(player.getUniqueId())) {
|
if (!violations.containsKey(player.getUniqueId())) {
|
||||||
violations.put(player.getUniqueId(), 1);
|
violations.put(player.getUniqueId(), 1);
|
||||||
} else {
|
} else {
|
||||||
if (violations.get(player.getUniqueId()) + 1 >= AntiCheat.getManager().getBackend().getMagic().GLIDE_LIMIT()) {
|
if (violations.get(player.getUniqueId()) + 1 >= AntiCheatReloaded.getManager().getBackend().getMagic()
|
||||||
|
.GLIDE_LIMIT()) {
|
||||||
violations.remove(player.getUniqueId());
|
violations.remove(player.getUniqueId());
|
||||||
Location to = player.getLocation();
|
Location to = player.getLocation();
|
||||||
to.setY(to.getY() - distanceToFall(to));
|
to.setY(to.getY() - distanceToFall(to));
|
||||||
player.teleport(to);
|
player.teleport(to);
|
||||||
|
// Report glide violation to statistics, just for the lulz jk
|
||||||
|
AntiCheatReloaded.getPlugin().onGlideViolation();
|
||||||
return new CheckResult(CheckResult.Result.FAILED,
|
return new CheckResult(CheckResult.Result.FAILED,
|
||||||
player.getName() + " was set back for gliding (yDiff=" + new BigDecimal(yDiff).setScale(2, BigDecimal.ROUND_UP) + ")");
|
player.getName() + " was set back for gliding (yDiff="
|
||||||
|
+ new BigDecimal(yDiff).setScale(2, BigDecimal.ROUND_UP) + ")");
|
||||||
} else {
|
} else {
|
||||||
violations.put(player.getUniqueId(), violations.get(player.getUniqueId()) + 1);
|
violations.put(player.getUniqueId(), violations.get(player.getUniqueId()) + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
// TODO more sophisticated check
|
||||||
}
|
}
|
||||||
lastDiff.put(player.getUniqueId(), distance.getYDifference());
|
lastDiff.put(player.getUniqueId(), distance.getYDifference());
|
||||||
lastFallDistance.put(player.getUniqueId(), player.getFallDistance());
|
lastFallDistance.put(player.getUniqueId(), player.getFallDistance());
|
||||||
|
|||||||
@@ -1,3 +1,21 @@
|
|||||||
|
/*
|
||||||
|
* AntiCheatReloaded for Bukkit and Spigot.
|
||||||
|
* Copyright (c) 2012-2015 AntiCheat Team
|
||||||
|
* Copyright (c) 2016-2020 Rammelkast
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
package com.rammelkast.anticheatreloaded.check.movement;
|
package com.rammelkast.anticheatreloaded.check.movement;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@@ -8,7 +26,7 @@ import org.bukkit.Material;
|
|||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.potion.PotionEffectType;
|
import org.bukkit.potion.PotionEffectType;
|
||||||
|
|
||||||
import com.rammelkast.anticheatreloaded.AntiCheat;
|
import com.rammelkast.anticheatreloaded.AntiCheatReloaded;
|
||||||
import com.rammelkast.anticheatreloaded.check.CheckResult;
|
import com.rammelkast.anticheatreloaded.check.CheckResult;
|
||||||
import com.rammelkast.anticheatreloaded.util.VersionUtil;
|
import com.rammelkast.anticheatreloaded.util.VersionUtil;
|
||||||
|
|
||||||
@@ -18,51 +36,51 @@ public class SpeedCheck {
|
|||||||
public static Map<UUID, Integer> speedViolation = new HashMap<UUID, Integer>();
|
public static Map<UUID, Integer> speedViolation = new HashMap<UUID, Integer>();
|
||||||
|
|
||||||
public static boolean isSpeedExempt(Player player) {
|
public static boolean isSpeedExempt(Player player) {
|
||||||
return AntiCheat.getManager().getBackend().isMovingExempt(player)
|
return AntiCheatReloaded.getManager().getBackend().isMovingExempt(player)
|
||||||
|| AntiCheat.getManager().getBackend().justVelocity(player) || VersionUtil.isFlying(player);
|
|| AntiCheatReloaded.getManager().getBackend().justVelocity(player) || VersionUtil.isFlying(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static CheckResult checkXZSpeed(Player player, double x, double z) {
|
public static CheckResult checkXZSpeed(Player player, double x, double z) {
|
||||||
if (!isSpeedExempt(player) && player.getVehicle() == null) {
|
if (!isSpeedExempt(player) && player.getVehicle() == null) {
|
||||||
String reason = "";
|
String reason = "";
|
||||||
double max = AntiCheat.getManager().getBackend().getMagic().XZ_SPEED_MAX();
|
double max = AntiCheatReloaded.getManager().getBackend().getMagic().XZ_SPEED_MAX();
|
||||||
if (player.getLocation().getBlock().getType() == Material.SOUL_SAND) {
|
if (player.getLocation().getBlock().getType() == Material.SOUL_SAND) {
|
||||||
if (player.isSprinting()) {
|
if (player.isSprinting()) {
|
||||||
reason = "on soulsand while sprinting ";
|
reason = "on soulsand while sprinting ";
|
||||||
max = AntiCheat.getManager().getBackend().getMagic().XZ_SPEED_MAX_SOULSAND_SPRINT();
|
max = AntiCheatReloaded.getManager().getBackend().getMagic().XZ_SPEED_MAX_SOULSAND_SPRINT();
|
||||||
} else if (player.hasPotionEffect(PotionEffectType.SPEED)) {
|
} else if (player.hasPotionEffect(PotionEffectType.SPEED)) {
|
||||||
reason = "on soulsand with speed potion ";
|
reason = "on soulsand with speed potion ";
|
||||||
max = AntiCheat.getManager().getBackend().getMagic().XZ_SPEED_MAX_SOULSAND_POTION();
|
max = AntiCheatReloaded.getManager().getBackend().getMagic().XZ_SPEED_MAX_SOULSAND_POTION();
|
||||||
} else {
|
} else {
|
||||||
reason = "on soulsand ";
|
reason = "on soulsand ";
|
||||||
max = AntiCheat.getManager().getBackend().getMagic().XZ_SPEED_MAX_SOULSAND();
|
max = AntiCheatReloaded.getManager().getBackend().getMagic().XZ_SPEED_MAX_SOULSAND();
|
||||||
}
|
}
|
||||||
} else if (VersionUtil.isFlying(player)) {
|
} else if (VersionUtil.isFlying(player)) {
|
||||||
reason = "while flying ";
|
reason = "while flying ";
|
||||||
max = AntiCheat.getManager().getBackend().getMagic().XZ_SPEED_MAX_FLY();
|
max = AntiCheatReloaded.getManager().getBackend().getMagic().XZ_SPEED_MAX_FLY();
|
||||||
} else if (player.hasPotionEffect(PotionEffectType.SPEED)) {
|
} else if (player.hasPotionEffect(PotionEffectType.SPEED)) {
|
||||||
if (player.isSprinting()) {
|
if (player.isSprinting()) {
|
||||||
reason = "with speed potion while sprinting ";
|
reason = "with speed potion while sprinting ";
|
||||||
max = AntiCheat.getManager().getBackend().getMagic().XZ_SPEED_MAX_POTION_SPRINT();
|
max = AntiCheatReloaded.getManager().getBackend().getMagic().XZ_SPEED_MAX_POTION_SPRINT();
|
||||||
} else {
|
} else {
|
||||||
reason = "with speed potion ";
|
reason = "with speed potion ";
|
||||||
max = AntiCheat.getManager().getBackend().getMagic().XZ_SPEED_MAX_POTION();
|
max = AntiCheatReloaded.getManager().getBackend().getMagic().XZ_SPEED_MAX_POTION();
|
||||||
}
|
}
|
||||||
} else if (player.isSprinting()) {
|
} else if (player.isSprinting()) {
|
||||||
reason = "while sprinting ";
|
reason = "while sprinting ";
|
||||||
max = AntiCheat.getManager().getBackend().getMagic().XZ_SPEED_MAX_SPRINT();
|
max = AntiCheatReloaded.getManager().getBackend().getMagic().XZ_SPEED_MAX_SPRINT();
|
||||||
}
|
}
|
||||||
|
|
||||||
float speed = player.getWalkSpeed();
|
float speed = player.getWalkSpeed();
|
||||||
max += speed > 0 ? player.getWalkSpeed() - 0.2f : 0;
|
max += speed > 0 ? player.getWalkSpeed() - 0.2f : 0;
|
||||||
|
|
||||||
if (x > max || z > max) {
|
if (x > max || z > max) {
|
||||||
int num = AntiCheat.getManager().getBackend().increment(player, speedViolation,
|
int num = AntiCheatReloaded.getManager().getBackend().increment(player, speedViolation,
|
||||||
AntiCheat.getManager().getBackend().getMagic().SPEED_MAX());
|
AntiCheatReloaded.getManager().getBackend().getMagic().SPEED_MAX());
|
||||||
if (num >= AntiCheat.getManager().getBackend().getMagic().SPEED_MAX()) {
|
if (num >= AntiCheatReloaded.getManager().getBackend().getMagic().SPEED_MAX()) {
|
||||||
return new CheckResult(CheckResult.Result.FAILED,
|
return new CheckResult(CheckResult.Result.FAILED,
|
||||||
player.getName() + "'s speed was too high " + reason + num + " times in a row (max="
|
player.getName() + "'s speed was too high " + reason + num + " times in a row (max="
|
||||||
+ AntiCheat.getManager().getBackend().getMagic().SPEED_MAX() + ", speed="
|
+ AntiCheatReloaded.getManager().getBackend().getMagic().SPEED_MAX() + ", speed="
|
||||||
+ (x > z ? x : z) + ", max speed=" + max + ")");
|
+ (x > z ? x : z) + ", max speed=" + max + ")");
|
||||||
} else {
|
} else {
|
||||||
return PASS;
|
return PASS;
|
||||||
|
|||||||
@@ -1,3 +1,22 @@
|
|||||||
|
/*
|
||||||
|
* AntiCheatReloaded for Bukkit and Spigot.
|
||||||
|
* Copyright (c) 2012-2015 AntiCheat Team
|
||||||
|
* Copyright (c) 2016-2020 Rammelkast
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
package com.rammelkast.anticheatreloaded.check.movement;
|
package com.rammelkast.anticheatreloaded.check.movement;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -11,9 +30,10 @@ import org.bukkit.block.Block;
|
|||||||
import org.bukkit.block.BlockFace;
|
import org.bukkit.block.BlockFace;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.rammelkast.anticheatreloaded.AntiCheat;
|
import com.rammelkast.anticheatreloaded.AntiCheatReloaded;
|
||||||
import com.rammelkast.anticheatreloaded.check.CheckResult;
|
import com.rammelkast.anticheatreloaded.check.CheckResult;
|
||||||
import com.rammelkast.anticheatreloaded.util.Utilities;
|
import com.rammelkast.anticheatreloaded.util.Utilities;
|
||||||
|
import com.rammelkast.anticheatreloaded.util.VersionUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This check seems to be broken/outdated
|
* This check seems to be broken/outdated
|
||||||
@@ -27,36 +47,35 @@ public class WaterWalkCheck {
|
|||||||
public static Map<UUID, Integer> waterSpeedViolation = new HashMap<UUID, Integer>();
|
public static Map<UUID, Integer> waterSpeedViolation = new HashMap<UUID, Integer>();
|
||||||
public static Map<UUID, Integer> waterAscensionViolation = new HashMap<UUID, Integer>();
|
public static Map<UUID, Integer> waterAscensionViolation = new HashMap<UUID, Integer>();
|
||||||
|
|
||||||
/**
|
|
||||||
* TODO check & fix for 1.11? (see #25)
|
|
||||||
*/
|
|
||||||
public static CheckResult runCheck(Player player, double x, double y, double z) {
|
public static CheckResult runCheck(Player player, double x, double y, double z) {
|
||||||
Block block = player.getLocation().getBlock();
|
Block block = player.getLocation().getBlock();
|
||||||
UUID uuid = player.getUniqueId();
|
UUID uuid = player.getUniqueId();
|
||||||
|
|
||||||
if (player.getVehicle() == null && !player.isFlying()) {
|
if (player.getVehicle() == null && !player.isFlying() && !VersionUtil.isFrostWalk(player)) {
|
||||||
if (block.isLiquid()) {
|
if (block.isLiquid()) {
|
||||||
if (isInWater.contains(uuid)) {
|
if (isInWater.contains(uuid)) {
|
||||||
if (isInWaterCache.contains(uuid)) {
|
if (isInWaterCache.contains(uuid)) {
|
||||||
if (player.getNearbyEntities(1, 1, 1).isEmpty()) {
|
if (player.getNearbyEntities(1, 1, 1).isEmpty()) {
|
||||||
boolean b;
|
boolean b;
|
||||||
if (!Utilities.sprintFly(player)) {
|
if (!Utilities.sprintFly(player)) {
|
||||||
b = x > AntiCheat.getManager().getBackend().getMagic().XZ_SPEED_MAX_WATER()
|
b = x > AntiCheatReloaded.getManager().getBackend().getMagic().XZ_SPEED_MAX_WATER()
|
||||||
|| z > AntiCheat.getManager().getBackend().getMagic().XZ_SPEED_MAX_WATER();
|
|| z > AntiCheatReloaded.getManager().getBackend().getMagic()
|
||||||
|
.XZ_SPEED_MAX_WATER();
|
||||||
} else {
|
} else {
|
||||||
b = x > AntiCheat.getManager().getBackend().getMagic().XZ_SPEED_MAX_WATER_SPRINT()
|
b = x > AntiCheatReloaded.getManager().getBackend().getMagic()
|
||||||
|| z > AntiCheat.getManager().getBackend().getMagic()
|
.XZ_SPEED_MAX_WATER_SPRINT()
|
||||||
|
|| z > AntiCheatReloaded.getManager().getBackend().getMagic()
|
||||||
.XZ_SPEED_MAX_WATER_SPRINT();
|
.XZ_SPEED_MAX_WATER_SPRINT();
|
||||||
}
|
}
|
||||||
if (!b && !Utilities.isFullyInWater(player.getLocation())
|
if (!b && !Utilities.isFullyInWater(player.getLocation())
|
||||||
&& Utilities.isHoveringOverWater(player.getLocation(), 1) && y == 0D
|
&& Utilities.isHoveringOverWater(player.getLocation(), 1) && y == 0D
|
||||||
&& !block.getType().equals(Material.WATER_LILY)) {
|
&& !block.getType().equals(Material.LILY_PAD)) {
|
||||||
b = true;
|
b = true;
|
||||||
}
|
}
|
||||||
if (b) {
|
if (b) {
|
||||||
if (waterSpeedViolation.containsKey(uuid)) {
|
if (waterSpeedViolation.containsKey(uuid)) {
|
||||||
int v = waterSpeedViolation.get(uuid);
|
int v = waterSpeedViolation.get(uuid);
|
||||||
if (v >= AntiCheat.getManager().getBackend().getMagic()
|
if (v >= AntiCheatReloaded.getManager().getBackend().getMagic()
|
||||||
.WATER_SPEED_VIOLATION_MAX()) {
|
.WATER_SPEED_VIOLATION_MAX()) {
|
||||||
waterSpeedViolation.put(uuid, 0);
|
waterSpeedViolation.put(uuid, 0);
|
||||||
return new CheckResult(CheckResult.Result.FAILED,
|
return new CheckResult(CheckResult.Result.FAILED,
|
||||||
@@ -80,11 +99,11 @@ public class WaterWalkCheck {
|
|||||||
return PASS;
|
return PASS;
|
||||||
}
|
}
|
||||||
} else if (block.getRelative(BlockFace.DOWN).isLiquid()
|
} else if (block.getRelative(BlockFace.DOWN).isLiquid()
|
||||||
&& !AntiCheat.getManager().getBackend().isAscending(player) && Utilities.cantStandAt(block)
|
&& !AntiCheatReloaded.getManager().getBackend().isAscending(player) && Utilities.cantStandAt(block)
|
||||||
&& Utilities.cantStandAt(block.getRelative(BlockFace.DOWN))) {
|
&& Utilities.cantStandAt(block.getRelative(BlockFace.DOWN))) {
|
||||||
if (waterAscensionViolation.containsKey(uuid)) {
|
if (waterAscensionViolation.containsKey(uuid)) {
|
||||||
int v = waterAscensionViolation.get(uuid);
|
int v = waterAscensionViolation.get(uuid);
|
||||||
if (v >= AntiCheat.getManager().getBackend().getMagic().WATER_ASCENSION_VIOLATION_MAX()) {
|
if (v >= AntiCheatReloaded.getManager().getBackend().getMagic().WATER_ASCENSION_VIOLATION_MAX()) {
|
||||||
waterAscensionViolation.put(uuid, 0);
|
waterAscensionViolation.put(uuid, 0);
|
||||||
return new CheckResult(CheckResult.Result.FAILED,
|
return new CheckResult(CheckResult.Result.FAILED,
|
||||||
player.getName() + " stood on water " + v + " times (can't stand on " + block.getType()
|
player.getName() + " stood on water " + v + " times (can't stand on " + block.getType()
|
||||||
|
|||||||
@@ -1,18 +1,35 @@
|
|||||||
|
/*
|
||||||
|
* AntiCheatReloaded for Bukkit and Spigot.
|
||||||
|
* Copyright (c) 2012-2015 AntiCheat Team
|
||||||
|
* Copyright (c) 2016-2020 Rammelkast
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
package com.rammelkast.anticheatreloaded.check.movement;
|
package com.rammelkast.anticheatreloaded.check.movement;
|
||||||
|
|
||||||
import java.util.EnumSet;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import org.bukkit.ChatColor;
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.potion.PotionEffectType;
|
import org.bukkit.potion.PotionEffectType;
|
||||||
|
|
||||||
import com.rammelkast.anticheatreloaded.AntiCheat;
|
import com.rammelkast.anticheatreloaded.AntiCheatReloaded;
|
||||||
import com.rammelkast.anticheatreloaded.check.CheckResult;
|
import com.rammelkast.anticheatreloaded.check.CheckResult;
|
||||||
import com.rammelkast.anticheatreloaded.util.Distance;
|
import com.rammelkast.anticheatreloaded.util.Distance;
|
||||||
import com.rammelkast.anticheatreloaded.util.Utilities;
|
import com.rammelkast.anticheatreloaded.util.Utilities;
|
||||||
@@ -32,7 +49,7 @@ public class YAxisCheck {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static CheckResult runCheck(Player player, Distance distance) {
|
public static CheckResult runCheck(Player player, Distance distance) {
|
||||||
if (distance.getYDifference() > AntiCheat.getManager().getBackend().getMagic().TELEPORT_MIN()
|
if (distance.getYDifference() > AntiCheatReloaded.getManager().getBackend().getMagic().TELEPORT_MIN()
|
||||||
|| distance.getYDifference() < 0 || VersionUtil.isFlying(player)) {
|
|| distance.getYDifference() < 0 || VersionUtil.isFlying(player)) {
|
||||||
return PASS;
|
return PASS;
|
||||||
}
|
}
|
||||||
@@ -52,13 +69,14 @@ public class YAxisCheck {
|
|||||||
lastYtime.put(uuid, System.currentTimeMillis());
|
lastYtime.put(uuid, System.currentTimeMillis());
|
||||||
} else {
|
} else {
|
||||||
if (y1 > lastYcoord.get(uuid)
|
if (y1 > lastYcoord.get(uuid)
|
||||||
&& yAxisViolations.get(uuid) > AntiCheat.getManager().getBackend().getMagic().Y_MAXVIOLATIONS()
|
&& yAxisViolations.get(uuid) > AntiCheatReloaded.getManager().getBackend().getMagic()
|
||||||
&& (System.currentTimeMillis() - yAxisLastViolation.get(uuid)) < AntiCheat.getManager()
|
.Y_MAXVIOLATIONS()
|
||||||
|
&& (System.currentTimeMillis() - yAxisLastViolation.get(uuid)) < AntiCheatReloaded.getManager()
|
||||||
.getBackend().getMagic().Y_MAXVIOTIME()) {
|
.getBackend().getMagic().Y_MAXVIOTIME()) {
|
||||||
Location g = player.getLocation();
|
Location g = player.getLocation();
|
||||||
yAxisViolations.put(uuid, yAxisViolations.get(uuid) + 1);
|
yAxisViolations.put(uuid, yAxisViolations.get(uuid) + 1);
|
||||||
yAxisLastViolation.put(uuid, System.currentTimeMillis());
|
yAxisLastViolation.put(uuid, System.currentTimeMillis());
|
||||||
if (!AntiCheat.getManager().getBackend().silentMode()) {
|
if (!AntiCheatReloaded.getManager().getBackend().silentMode()) {
|
||||||
g.setY(lastYcoord.get(uuid));
|
g.setY(lastYcoord.get(uuid));
|
||||||
if (g.getBlock().getType() == Material.AIR) {
|
if (g.getBlock().getType() == Material.AIR) {
|
||||||
player.teleport(g);
|
player.teleport(g);
|
||||||
@@ -66,34 +84,37 @@ public class YAxisCheck {
|
|||||||
}
|
}
|
||||||
return new CheckResult(CheckResult.Result.FAILED,
|
return new CheckResult(CheckResult.Result.FAILED,
|
||||||
player.getName() + " tried to fly on y-axis " + yAxisViolations.get(uuid) + " times (max ="
|
player.getName() + " tried to fly on y-axis " + yAxisViolations.get(uuid) + " times (max ="
|
||||||
+ AntiCheat.getManager().getBackend().getMagic().Y_MAXVIOLATIONS() + ")");
|
+ AntiCheatReloaded.getManager().getBackend().getMagic().Y_MAXVIOLATIONS() + ")");
|
||||||
} else {
|
} else {
|
||||||
if (yAxisViolations.get(uuid) > AntiCheat.getManager().getBackend().getMagic().Y_MAXVIOLATIONS()
|
if (yAxisViolations.get(uuid) > AntiCheatReloaded.getManager().getBackend().getMagic()
|
||||||
&& (System.currentTimeMillis() - yAxisLastViolation.get(uuid)) > AntiCheat.getManager()
|
.Y_MAXVIOLATIONS()
|
||||||
.getBackend().getMagic().Y_MAXVIOTIME()) {
|
&& (System.currentTimeMillis() - yAxisLastViolation.get(uuid)) > AntiCheatReloaded
|
||||||
|
.getManager().getBackend().getMagic().Y_MAXVIOTIME()) {
|
||||||
yAxisViolations.put(uuid, 0);
|
yAxisViolations.put(uuid, 0);
|
||||||
yAxisLastViolation.put(uuid, 0L);
|
yAxisLastViolation.put(uuid, 0L);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
long i = System.currentTimeMillis() - lastYtime.get(uuid);
|
long i = System.currentTimeMillis() - lastYtime.get(uuid);
|
||||||
double diff = AntiCheat.getManager().getBackend().getMagic().Y_MAXDIFF()
|
double diff = AntiCheatReloaded.getManager().getBackend().getMagic().Y_MAXDIFF()
|
||||||
+ (Utilities.isStair(player.getLocation().add(0, -1, 0).getBlock()) ? 0.5 : 0.0);
|
+ (Utilities.isStair(player.getLocation().add(0, -1, 0).getBlock()) ? 0.5 : 0.0);
|
||||||
if ((y1 - lastYcoord.get(uuid)) > diff && i < AntiCheat.getManager().getBackend().getMagic().Y_TIME()) {
|
if ((y1 - lastYcoord.get(uuid)) > diff
|
||||||
|
&& i < AntiCheatReloaded.getManager().getBackend().getMagic().Y_TIME()) {
|
||||||
Location g = player.getLocation();
|
Location g = player.getLocation();
|
||||||
yAxisViolations.put(uuid, yAxisViolations.get(uuid) + 1);
|
yAxisViolations.put(uuid, yAxisViolations.get(uuid) + 1);
|
||||||
yAxisLastViolation.put(uuid, System.currentTimeMillis());
|
yAxisLastViolation.put(uuid, System.currentTimeMillis());
|
||||||
if (!AntiCheat.getManager().getBackend().silentMode()) {
|
if (!AntiCheatReloaded.getManager().getBackend().silentMode()) {
|
||||||
g.setY(lastYcoord.get(uuid));
|
g.setY(lastYcoord.get(uuid));
|
||||||
if (g.getBlock().getType() == Material.AIR) {
|
if (g.getBlock().getType() == Material.AIR) {
|
||||||
player.teleport(g);
|
player.teleport(g);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return new CheckResult(CheckResult.Result.FAILED, player.getName() + " tried to fly on y-axis in "
|
return new CheckResult(CheckResult.Result.FAILED, player.getName() + " tried to fly on y-axis in "
|
||||||
+ i + " ms (min =" + AntiCheat.getManager().getBackend().getMagic().Y_TIME() + ")");
|
+ i + " ms (min =" + AntiCheatReloaded.getManager().getBackend().getMagic().Y_TIME() + ")");
|
||||||
} else {
|
} else {
|
||||||
if ((y1 - lastYcoord.get(uuid)) > AntiCheat.getManager().getBackend().getMagic().Y_MAXDIFF() + 1
|
if ((y1 - lastYcoord.get(uuid)) > AntiCheatReloaded.getManager().getBackend().getMagic().Y_MAXDIFF()
|
||||||
|| (System.currentTimeMillis() - lastYtime.get(uuid)) > AntiCheat.getManager().getBackend()
|
+ 1
|
||||||
.getMagic().Y_TIME()) {
|
|| (System.currentTimeMillis() - lastYtime.get(uuid)) > AntiCheatReloaded.getManager()
|
||||||
|
.getBackend().getMagic().Y_TIME()) {
|
||||||
lastYtime.put(uuid, System.currentTimeMillis());
|
lastYtime.put(uuid, System.currentTimeMillis());
|
||||||
lastYcoord.put(uuid, y1);
|
lastYcoord.put(uuid, y1);
|
||||||
}
|
}
|
||||||
@@ -105,7 +126,8 @@ public class YAxisCheck {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isMoveUpBlock(Block block) {
|
public static boolean isMoveUpBlock(Block block) {
|
||||||
return VersionUtil.getMoveUpBlocks().contains(block.getType());
|
Material type = block.getType();
|
||||||
|
return type.name().endsWith("STAIRS"); // TODO slabs/others?
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
/*
|
||||||
|
* AntiCheatReloaded for Bukkit and Spigot.
|
||||||
|
* Copyright (c) 2012-2015 AntiCheat Team
|
||||||
|
* Copyright (c) 2016-2020 Rammelkast
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.rammelkast.anticheatreloaded.check.player;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Rammelkast
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class GhosthandCheck {
|
||||||
|
|
||||||
|
public static final Map<UUID, Integer> FLAG_COUNT = new HashMap<UUID, Integer>();
|
||||||
|
public static final int MAX_FLAGS = 3; // TODO config?
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* AntiCheat for Bukkit.
|
* AntiCheatReloaded for Bukkit and Spigot.
|
||||||
* Copyright (C) 2012-2014 AntiCheat Team | http://gravitydevelopment.net
|
* Copyright (c) 2012-2015 AntiCheat Team
|
||||||
|
* Copyright (c) 2016-2020 Rammelkast
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -24,7 +25,7 @@ import org.bukkit.Server;
|
|||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.rammelkast.anticheatreloaded.AntiCheat;
|
import com.rammelkast.anticheatreloaded.AntiCheatReloaded;
|
||||||
import com.rammelkast.anticheatreloaded.config.Configuration;
|
import com.rammelkast.anticheatreloaded.config.Configuration;
|
||||||
import com.rammelkast.anticheatreloaded.manage.CheckManager;
|
import com.rammelkast.anticheatreloaded.manage.CheckManager;
|
||||||
import com.rammelkast.anticheatreloaded.manage.UserManager;
|
import com.rammelkast.anticheatreloaded.manage.UserManager;
|
||||||
@@ -32,9 +33,9 @@ import com.rammelkast.anticheatreloaded.util.Permission;
|
|||||||
|
|
||||||
public class CommandBase {
|
public class CommandBase {
|
||||||
|
|
||||||
public static final Configuration CONFIG = AntiCheat.getManager().getConfiguration();
|
public static final Configuration CONFIG = AntiCheatReloaded.getManager().getConfiguration();
|
||||||
public static final UserManager USER_MANAGER = AntiCheat.getManager().getUserManager();
|
public static final UserManager USER_MANAGER = AntiCheatReloaded.getManager().getUserManager();
|
||||||
public static final CheckManager CHECK_MANAGER = AntiCheat.getManager().getCheckManager();
|
public static final CheckManager CHECK_MANAGER = AntiCheatReloaded.getManager().getCheckManager();
|
||||||
public static final ChatColor RED = ChatColor.RED;
|
public static final ChatColor RED = ChatColor.RED;
|
||||||
public static final ChatColor YELLOW = ChatColor.YELLOW;
|
public static final ChatColor YELLOW = ChatColor.YELLOW;
|
||||||
public static final ChatColor GREEN = ChatColor.GREEN;
|
public static final ChatColor GREEN = ChatColor.GREEN;
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* AntiCheat for Bukkit.
|
* AntiCheatReloaded for Bukkit and Spigot.
|
||||||
* Copyright (C) 2012-2014 AntiCheat Team | http://gravitydevelopment.net
|
* Copyright (c) 2012-2015 AntiCheat Team
|
||||||
|
* Copyright (c) 2016-2020 Rammelkast
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -26,7 +27,6 @@ import org.bukkit.command.CommandExecutor;
|
|||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
|
|
||||||
import com.rammelkast.anticheatreloaded.command.executors.CommandCheck;
|
import com.rammelkast.anticheatreloaded.command.executors.CommandCheck;
|
||||||
import com.rammelkast.anticheatreloaded.command.executors.CommandDebug;
|
|
||||||
import com.rammelkast.anticheatreloaded.command.executors.CommandDeveloper;
|
import com.rammelkast.anticheatreloaded.command.executors.CommandDeveloper;
|
||||||
import com.rammelkast.anticheatreloaded.command.executors.CommandHelp;
|
import com.rammelkast.anticheatreloaded.command.executors.CommandHelp;
|
||||||
import com.rammelkast.anticheatreloaded.command.executors.CommandLog;
|
import com.rammelkast.anticheatreloaded.command.executors.CommandLog;
|
||||||
@@ -41,7 +41,6 @@ public class CommandHandler implements CommandExecutor {
|
|||||||
public CommandHandler() {
|
public CommandHandler() {
|
||||||
commands.add(new CommandHelp());
|
commands.add(new CommandHelp());
|
||||||
commands.add(new CommandCheck());
|
commands.add(new CommandCheck());
|
||||||
commands.add(new CommandDebug());
|
|
||||||
commands.add(new CommandDeveloper());
|
commands.add(new CommandDeveloper());
|
||||||
commands.add(new CommandLog());
|
commands.add(new CommandLog());
|
||||||
commands.add(new CommandReload());
|
commands.add(new CommandReload());
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* AntiCheat for Bukkit.
|
* AntiCheatReloaded for Bukkit and Spigot.
|
||||||
* Copyright (C) 2012-2014 AntiCheat Team | http://gravitydevelopment.net
|
* Copyright (c) 2012-2015 AntiCheat Team
|
||||||
|
* Copyright (c) 2016-2020 Rammelkast
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,60 +0,0 @@
|
|||||||
/*
|
|
||||||
* AntiCheat for Bukkit.
|
|
||||||
* Copyright (C) 2012-2014 AntiCheat Team | http://gravitydevelopment.net
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.rammelkast.anticheatreloaded.command.executors;
|
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.command.CommandSender;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
|
|
||||||
import com.rammelkast.anticheatreloaded.command.CommandBase;
|
|
||||||
import com.rammelkast.anticheatreloaded.util.PastebinReport;
|
|
||||||
import com.rammelkast.anticheatreloaded.util.Permission;
|
|
||||||
|
|
||||||
public class CommandDebug extends CommandBase {
|
|
||||||
|
|
||||||
private static final String NAME = "AntiCheat Debug Reporting";
|
|
||||||
private static final String COMMAND = "debug";
|
|
||||||
private static final String USAGE = "anticheat debug <user>";
|
|
||||||
private static final Permission PERMISSION = Permission.SYSTEM_DEBUG;
|
|
||||||
private static final String[] HELP = {
|
|
||||||
GRAY + "Use: " + AQUA + "/anticheat debug" + GRAY + " to create a debug report",
|
|
||||||
GRAY + "Use: " + AQUA + "/anticheat debug <user>" + GRAY + " to create a debug report for a user",
|
|
||||||
};
|
|
||||||
|
|
||||||
public CommandDebug() {
|
|
||||||
super(NAME, COMMAND, USAGE, HELP, PERMISSION);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void execute(CommandSender cs, String[] args) {
|
|
||||||
Player player = null;
|
|
||||||
if (args.length == 1) {
|
|
||||||
player = Bukkit.getPlayer(args[0]);
|
|
||||||
} else {
|
|
||||||
if (cs instanceof Player) {
|
|
||||||
player = (Player) cs;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
cs.sendMessage(GRAY + "Please wait while I collect some data...");
|
|
||||||
PastebinReport report = new PastebinReport(cs, player);
|
|
||||||
cs.sendMessage(GREEN + "Debug information posted to: " + WHITE + report.getURL());
|
|
||||||
cs.sendMessage(GREEN + "Please include this link when making bug reports.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+6
-6
@@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* AntiCheat for Bukkit.
|
* AntiCheatReloaded for Bukkit and Spigot.
|
||||||
* Copyright (C) 2012-2014 AntiCheat Team | http://gravitydevelopment.net
|
* Copyright (c) 2012-2015 AntiCheat Team
|
||||||
|
* Copyright (c) 2016-2020 Rammelkast
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -15,12 +16,11 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.rammelkast.anticheatreloaded.command.executors;
|
package com.rammelkast.anticheatreloaded.command.executors;
|
||||||
|
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
|
|
||||||
import com.rammelkast.anticheatreloaded.AntiCheat;
|
import com.rammelkast.anticheatreloaded.AntiCheatReloaded;
|
||||||
import com.rammelkast.anticheatreloaded.command.CommandBase;
|
import com.rammelkast.anticheatreloaded.command.CommandBase;
|
||||||
import com.rammelkast.anticheatreloaded.util.Permission;
|
import com.rammelkast.anticheatreloaded.util.Permission;
|
||||||
|
|
||||||
@@ -40,7 +40,7 @@ public class CommandDeveloper extends CommandBase {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void execute(CommandSender cs, String[] args) {
|
protected void execute(CommandSender cs, String[] args) {
|
||||||
AntiCheat.setDeveloperMode(!AntiCheat.developerMode());
|
AntiCheatReloaded.setDeveloperMode(!AntiCheatReloaded.developerMode());
|
||||||
cs.sendMessage(GREEN + "Developer mode " + (AntiCheat.developerMode() ? "ON" : "OFF"));
|
cs.sendMessage(GREEN + "Developer mode " + (AntiCheatReloaded.developerMode() ? "ON" : "OFF"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* AntiCheat for Bukkit.
|
* AntiCheatReloaded for Bukkit and Spigot.
|
||||||
* Copyright (C) 2012-2014 AntiCheat Team | http://gravitydevelopment.net
|
* Copyright (c) 2012-2015 AntiCheat Team
|
||||||
|
* Copyright (c) 2016-2020 Rammelkast
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -30,14 +31,13 @@ public class CommandHelp extends CommandBase {
|
|||||||
private static final String USAGE = "anticheat help";
|
private static final String USAGE = "anticheat help";
|
||||||
private static final Permission PERMISSION = Permission.SYSTEM_HELP;
|
private static final Permission PERMISSION = Permission.SYSTEM_HELP;
|
||||||
private static final String[] HELP = {
|
private static final String[] HELP = {
|
||||||
RED + "/anti " + GRAY + "help",
|
RED + "/acr " + GRAY + "help",
|
||||||
RED + "/anti " + GRAY + "reload",
|
RED + "/acr " + GRAY + "reload",
|
||||||
RED + "/anti " + GRAY + "update",
|
RED + "/acr " + GRAY + "update",
|
||||||
RED + "/anti " + GRAY + "debug " + WHITE + "<user>",
|
RED + "/acr " + GRAY + "check " + WHITE + "[check] [on/off]",
|
||||||
RED + "/anti " + GRAY + "check " + WHITE + "[check] [on/off]",
|
RED + "/acr " + GRAY + "log " + WHITE + "[file/console] [on/off]",
|
||||||
RED + "/anti " + GRAY + "log " + WHITE + "[file/console] [on/off]",
|
RED + "/acr " + GRAY + "report " + WHITE + "[group/user]",
|
||||||
RED + "/anti " + GRAY + "report " + WHITE + "[group/user]",
|
RED + "/acr " + GRAY + "reset " + WHITE + "[user]",
|
||||||
RED + "/anti " + GRAY + "reset " + WHITE + "[user]",
|
|
||||||
};
|
};
|
||||||
|
|
||||||
public CommandHelp() {
|
public CommandHelp() {
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* AntiCheat for Bukkit.
|
* AntiCheatReloaded for Bukkit and Spigot.
|
||||||
* Copyright (C) 2012-2014 AntiCheat Team | http://gravitydevelopment.net
|
* Copyright (c) 2012-2015 AntiCheat Team
|
||||||
|
* Copyright (c) 2016-2020 Rammelkast
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* AntiCheat for Bukkit.
|
* AntiCheatReloaded for Bukkit and Spigot.
|
||||||
* Copyright (C) 2012-2014 AntiCheat Team | http://gravitydevelopment.net
|
* Copyright (c) 2012-2015 AntiCheat Team
|
||||||
|
* Copyright (c) 2016-2020 Rammelkast
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* AntiCheat for Bukkit.
|
* AntiCheatReloaded for Bukkit and Spigot.
|
||||||
* Copyright (C) 2012-2014 AntiCheat Team | http://gravitydevelopment.net
|
* Copyright (c) 2012-2015 AntiCheat Team
|
||||||
|
* Copyright (c) 2016-2020 Rammelkast
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -23,7 +24,7 @@ import org.bukkit.ChatColor;
|
|||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.rammelkast.anticheatreloaded.AntiCheat;
|
import com.rammelkast.anticheatreloaded.AntiCheatReloaded;
|
||||||
import com.rammelkast.anticheatreloaded.check.CheckType;
|
import com.rammelkast.anticheatreloaded.check.CheckType;
|
||||||
import com.rammelkast.anticheatreloaded.command.CommandBase;
|
import com.rammelkast.anticheatreloaded.command.CommandBase;
|
||||||
import com.rammelkast.anticheatreloaded.manage.CheckManager;
|
import com.rammelkast.anticheatreloaded.manage.CheckManager;
|
||||||
@@ -83,7 +84,7 @@ public class CommandReport extends CommandBase {
|
|||||||
// Test users
|
// Test users
|
||||||
for (Player player : Bukkit.getOnlinePlayers()) {
|
for (Player player : Bukkit.getOnlinePlayers()) {
|
||||||
if (player.getUniqueId().equals(Bukkit.getPlayer(args[0]).getUniqueId())) {
|
if (player.getUniqueId().equals(Bukkit.getPlayer(args[0]).getUniqueId())) {
|
||||||
User user = AntiCheat.getManager().getUserManager().getUser(player.getUniqueId());
|
User user = AntiCheatReloaded.getManager().getUserManager().getUser(player.getUniqueId());
|
||||||
playerReport(cs, user, page);
|
playerReport(cs, user, page);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -176,13 +177,13 @@ public class CommandReport extends CommandBase {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (AntiCheat.developerMode()) {
|
if (AntiCheatReloaded.developerMode()) {
|
||||||
int permission = 0;
|
int permission = 0;
|
||||||
int check = 0;
|
int check = 0;
|
||||||
for (Permission perm : Permission.values()) {
|
for (Permission perm : Permission.values()) {
|
||||||
if (perm.get(user.getPlayer())) permission++;
|
if (perm.get(user.getPlayer())) permission++;
|
||||||
}
|
}
|
||||||
CheckManager manager = AntiCheat.getManager().getCheckManager();
|
CheckManager manager = AntiCheatReloaded.getManager().getCheckManager();
|
||||||
for (CheckType type : CheckType.values()) {
|
for (CheckType type : CheckType.values()) {
|
||||||
if (manager.willCheck(user.getPlayer(), type)) check++;
|
if (manager.willCheck(user.getPlayer(), type)) check++;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* AntiCheat for Bukkit.
|
* AntiCheatReloaded for Bukkit and Spigot.
|
||||||
* Copyright (C) 2012-2014 AntiCheat Team | http://gravitydevelopment.net
|
* Copyright (c) 2012-2015 AntiCheat Team
|
||||||
|
* Copyright (c) 2016-2020 Rammelkast
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -22,7 +23,7 @@ import org.bukkit.Bukkit;
|
|||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.rammelkast.anticheatreloaded.AntiCheat;
|
import com.rammelkast.anticheatreloaded.AntiCheatReloaded;
|
||||||
import com.rammelkast.anticheatreloaded.command.CommandBase;
|
import com.rammelkast.anticheatreloaded.command.CommandBase;
|
||||||
import com.rammelkast.anticheatreloaded.util.Permission;
|
import com.rammelkast.anticheatreloaded.util.Permission;
|
||||||
import com.rammelkast.anticheatreloaded.util.User;
|
import com.rammelkast.anticheatreloaded.util.User;
|
||||||
@@ -53,7 +54,7 @@ public class CommandReset extends CommandBase {
|
|||||||
if (user != null) {
|
if (user != null) {
|
||||||
user.resetLevel();
|
user.resetLevel();
|
||||||
user.clearMessages();
|
user.clearMessages();
|
||||||
AntiCheat.getManager().getBackend().resetChatLevel(user);
|
AntiCheatReloaded.getManager().getBackend().resetChatLevel(user);
|
||||||
cs.sendMessage(args[0] + GREEN + " has been reset.");
|
cs.sendMessage(args[0] + GREEN + " has been reset.");
|
||||||
} else {
|
} else {
|
||||||
cs.sendMessage(RED + "Player: " +args[0] + " not found.");
|
cs.sendMessage(RED + "Player: " +args[0] + " not found.");
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* AntiCheat for Bukkit.
|
* AntiCheatReloaded for Bukkit and Spigot.
|
||||||
* Copyright (C) 2012-2014 AntiCheat Team | http://gravitydevelopment.net
|
* Copyright (c) 2012-2015 AntiCheat Team
|
||||||
|
* Copyright (c) 2016-2020 Rammelkast
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -20,7 +21,7 @@ package com.rammelkast.anticheatreloaded.config;
|
|||||||
|
|
||||||
import org.bukkit.configuration.file.YamlConfiguration;
|
import org.bukkit.configuration.file.YamlConfiguration;
|
||||||
|
|
||||||
import com.rammelkast.anticheatreloaded.AntiCheat;
|
import com.rammelkast.anticheatreloaded.AntiCheatReloaded;
|
||||||
import com.rammelkast.anticheatreloaded.config.files.Config;
|
import com.rammelkast.anticheatreloaded.config.files.Config;
|
||||||
import com.rammelkast.anticheatreloaded.config.files.Enterprise;
|
import com.rammelkast.anticheatreloaded.config.files.Enterprise;
|
||||||
import com.rammelkast.anticheatreloaded.config.holders.mysql.*;
|
import com.rammelkast.anticheatreloaded.config.holders.mysql.*;
|
||||||
@@ -48,7 +49,7 @@ public class Configuration {
|
|||||||
private ArrayList<ConfigurationFile> flatfiles;
|
private ArrayList<ConfigurationFile> flatfiles;
|
||||||
private ArrayList<ConfigurationTable> dbfiles;
|
private ArrayList<ConfigurationTable> dbfiles;
|
||||||
|
|
||||||
public Configuration(AntiCheat plugin, AntiCheatManager manager) {
|
public Configuration(AntiCheatReloaded plugin, AntiCheatManager manager) {
|
||||||
removeOldFiles();
|
removeOldFiles();
|
||||||
this.manager = manager;
|
this.manager = manager;
|
||||||
config = new Config(plugin, this);
|
config = new Config(plugin, this);
|
||||||
@@ -146,20 +147,20 @@ public class Configuration {
|
|||||||
|
|
||||||
private void removeOldFiles() {
|
private void removeOldFiles() {
|
||||||
ArrayList<String> removed = new ArrayList<String>();
|
ArrayList<String> removed = new ArrayList<String>();
|
||||||
File configFile = new File(AntiCheat.getPlugin().getDataFolder(), "config.yml");
|
File configFile = new File(AntiCheatReloaded.getPlugin().getDataFolder(), "config.yml");
|
||||||
if (configFile.exists() && YamlConfiguration.loadConfiguration(configFile).getString("System.Auto update") != null) {
|
if (configFile.exists() && YamlConfiguration.loadConfiguration(configFile).getString("System.Auto update") != null) {
|
||||||
configFile.renameTo(new File(AntiCheat.getPlugin().getDataFolder(), "config.old"));
|
configFile.renameTo(new File(AntiCheatReloaded.getPlugin().getDataFolder(), "config.old"));
|
||||||
removed.add("config.yml has been renamed to config.old and replaced with the new config.yml");
|
removed.add("config.yml has been renamed to config.old and replaced with the new config.yml");
|
||||||
}
|
}
|
||||||
File eventsFile = new File(AntiCheat.getPlugin().getDataFolder(), "events.yml");
|
File eventsFile = new File(AntiCheatReloaded.getPlugin().getDataFolder(), "events.yml");
|
||||||
if (eventsFile.exists()) {
|
if (eventsFile.exists()) {
|
||||||
eventsFile.renameTo(new File(AntiCheat.getPlugin().getDataFolder(), "events.old"));
|
eventsFile.renameTo(new File(AntiCheatReloaded.getPlugin().getDataFolder(), "events.old"));
|
||||||
removed.add("events.yml has been renamed to events.old and replaced with groups.yml and rules.yml");
|
removed.add("events.yml has been renamed to events.old and replaced with groups.yml and rules.yml");
|
||||||
}
|
}
|
||||||
if (removed.size() > 0) {
|
if (removed.size() > 0) {
|
||||||
AntiCheat.getPlugin().getLogger().info("You are upgrading from an old version of AntiCheat. Due to configuration changes, the following files have been modified:");
|
AntiCheatReloaded.getPlugin().getLogger().info("You are upgrading from an old version of AntiCheat. Due to configuration changes, the following files have been modified:");
|
||||||
for (String s : removed) {
|
for (String s : removed) {
|
||||||
AntiCheat.getPlugin().getLogger().info(s);
|
AntiCheatReloaded.getPlugin().getLogger().info(s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* AntiCheat for Bukkit.
|
* AntiCheatReloaded for Bukkit and Spigot.
|
||||||
* Copyright (C) 2012-2014 AntiCheat Team | http://gravitydevelopment.net
|
* Copyright (c) 2012-2015 AntiCheat Team
|
||||||
|
* Copyright (c) 2016-2020 Rammelkast
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -21,11 +22,12 @@ package com.rammelkast.anticheatreloaded.config;
|
|||||||
import org.bukkit.configuration.file.FileConfiguration;
|
import org.bukkit.configuration.file.FileConfiguration;
|
||||||
import org.bukkit.configuration.file.YamlConfiguration;
|
import org.bukkit.configuration.file.YamlConfiguration;
|
||||||
|
|
||||||
import com.rammelkast.anticheatreloaded.AntiCheat;
|
import com.rammelkast.anticheatreloaded.AntiCheatReloaded;
|
||||||
import com.rammelkast.anticheatreloaded.config.yaml.CommentedConfiguration;
|
import com.rammelkast.anticheatreloaded.config.yaml.CommentedConfiguration;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.io.InputStreamReader;
|
||||||
|
|
||||||
public class ConfigurationFile {
|
public class ConfigurationFile {
|
||||||
|
|
||||||
@@ -36,21 +38,21 @@ public class ConfigurationFile {
|
|||||||
private FileConfiguration defaultConfigFile;
|
private FileConfiguration defaultConfigFile;
|
||||||
private Configuration config;
|
private Configuration config;
|
||||||
|
|
||||||
private AntiCheat plugin;
|
private AntiCheatReloaded plugin;
|
||||||
|
|
||||||
private boolean saveDefault;
|
private boolean saveDefault;
|
||||||
|
|
||||||
protected boolean needsReload;
|
protected boolean needsReload;
|
||||||
|
|
||||||
public ConfigurationFile(AntiCheat plugin, Configuration config, String fileName) {
|
public ConfigurationFile(AntiCheatReloaded plugin, Configuration config, String fileName) {
|
||||||
this(plugin, config, fileName, true);
|
this(plugin, config, fileName, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ConfigurationFile(AntiCheat plugin, Configuration config, String fileName, boolean saveDefault) {
|
public ConfigurationFile(AntiCheatReloaded plugin, Configuration config, String fileName, boolean saveDefault) {
|
||||||
this(plugin, config, fileName, saveDefault, new File(plugin.getDataFolder(), fileName));
|
this(plugin, config, fileName, saveDefault, new File(plugin.getDataFolder(), fileName));
|
||||||
}
|
}
|
||||||
|
|
||||||
public ConfigurationFile(AntiCheat plugin, Configuration config, String fileName, boolean saveDefault, File rawFile) {
|
public ConfigurationFile(AntiCheatReloaded plugin, Configuration config, String fileName, boolean saveDefault, File rawFile) {
|
||||||
// Can't change with user editing
|
// Can't change with user editing
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
this.config = config;
|
this.config = config;
|
||||||
@@ -59,7 +61,13 @@ public class ConfigurationFile {
|
|||||||
this.saveDefault = saveDefault;
|
this.saveDefault = saveDefault;
|
||||||
|
|
||||||
if (saveDefault) {
|
if (saveDefault) {
|
||||||
defaultConfigFile = YamlConfiguration.loadConfiguration(plugin.getResource(fileName));
|
InputStreamReader reader = new InputStreamReader(plugin.getResource(fileName));
|
||||||
|
defaultConfigFile = YamlConfiguration.loadConfiguration(reader);
|
||||||
|
try {
|
||||||
|
reader.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
load();
|
load();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* AntiCheat for Bukkit.
|
* AntiCheatReloaded for Bukkit and Spigot.
|
||||||
* Copyright (C) 2012-2014 AntiCheat Team | http://gravitydevelopment.net
|
* Copyright (c) 2012-2015 AntiCheat Team
|
||||||
|
* Copyright (c) 2016-2020 Rammelkast
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -20,7 +21,7 @@ package com.rammelkast.anticheatreloaded.config;
|
|||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
|
||||||
import com.rammelkast.anticheatreloaded.AntiCheat;
|
import com.rammelkast.anticheatreloaded.AntiCheatReloaded;
|
||||||
import com.rammelkast.anticheatreloaded.util.enterprise.Database;
|
import com.rammelkast.anticheatreloaded.util.enterprise.Database;
|
||||||
|
|
||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
@@ -59,7 +60,7 @@ public class ConfigurationTable {
|
|||||||
|
|
||||||
public void reload() {
|
public void reload() {
|
||||||
// For after sql inserts have been made
|
// For after sql inserts have been made
|
||||||
Bukkit.getScheduler().runTask(AntiCheat.getPlugin(), new Runnable() {
|
Bukkit.getScheduler().runTask(AntiCheatReloaded.getPlugin(), new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
load();
|
load();
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* AntiCheat for Bukkit.
|
* AntiCheatReloaded for Bukkit and Spigot.
|
||||||
* Copyright (C) 2012-2014 AntiCheat Team | http://gravitydevelopment.net
|
* Copyright (c) 2012-2015 AntiCheat Team
|
||||||
|
* Copyright (c) 2016-2020 Rammelkast
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -20,7 +21,7 @@ package com.rammelkast.anticheatreloaded.config.files;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.rammelkast.anticheatreloaded.AntiCheat;
|
import com.rammelkast.anticheatreloaded.AntiCheatReloaded;
|
||||||
import com.rammelkast.anticheatreloaded.config.Configuration;
|
import com.rammelkast.anticheatreloaded.config.Configuration;
|
||||||
import com.rammelkast.anticheatreloaded.config.ConfigurationFile;
|
import com.rammelkast.anticheatreloaded.config.ConfigurationFile;
|
||||||
|
|
||||||
@@ -29,7 +30,6 @@ public class Config extends ConfigurationFile {
|
|||||||
public static final String FILENAME = "config.yml";
|
public static final String FILENAME = "config.yml";
|
||||||
|
|
||||||
public ConfigValue<Boolean> logToConsole;
|
public ConfigValue<Boolean> logToConsole;
|
||||||
public ConfigValue<Boolean> autoUpdate;
|
|
||||||
public ConfigValue<Boolean> verboseStartup;
|
public ConfigValue<Boolean> verboseStartup;
|
||||||
public ConfigValue<Boolean> silentMode;
|
public ConfigValue<Boolean> silentMode;
|
||||||
public ConfigValue<Boolean> exemptOp;
|
public ConfigValue<Boolean> exemptOp;
|
||||||
@@ -51,7 +51,7 @@ public class Config extends ConfigurationFile {
|
|||||||
public ConfigValue<List<String>> disabledWorlds;
|
public ConfigValue<List<String>> disabledWorlds;
|
||||||
public ConfigValue<List<String>> disabledChecks;
|
public ConfigValue<List<String>> disabledChecks;
|
||||||
|
|
||||||
public Config(AntiCheat plugin, Configuration config) {
|
public Config(AntiCheatReloaded plugin, Configuration config) {
|
||||||
super(plugin, config, FILENAME);
|
super(plugin, config, FILENAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -59,7 +59,6 @@ public class Config extends ConfigurationFile {
|
|||||||
public void open() {
|
public void open() {
|
||||||
logToConsole = new ConfigValue<Boolean>("system.log-to-console");
|
logToConsole = new ConfigValue<Boolean>("system.log-to-console");
|
||||||
|
|
||||||
autoUpdate = new ConfigValue<Boolean>("system.auto-update");
|
|
||||||
verboseStartup = new ConfigValue<Boolean>("system.verbose-startup");
|
verboseStartup = new ConfigValue<Boolean>("system.verbose-startup");
|
||||||
silentMode = new ConfigValue<Boolean>("system.silent-mode");
|
silentMode = new ConfigValue<Boolean>("system.silent-mode");
|
||||||
exemptOp = new ConfigValue<Boolean>("system.exempt-op");
|
exemptOp = new ConfigValue<Boolean>("system.exempt-op");
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* AntiCheat for Bukkit.
|
* AntiCheatReloaded for Bukkit and Spigot.
|
||||||
* Copyright (C) 2012-2014 AntiCheat Team | http://gravitydevelopment.net
|
* Copyright (c) 2012-2015 AntiCheat Team
|
||||||
|
* Copyright (c) 2016-2020 Rammelkast
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -18,7 +19,7 @@
|
|||||||
|
|
||||||
package com.rammelkast.anticheatreloaded.config.files;
|
package com.rammelkast.anticheatreloaded.config.files;
|
||||||
|
|
||||||
import com.rammelkast.anticheatreloaded.AntiCheat;
|
import com.rammelkast.anticheatreloaded.AntiCheatReloaded;
|
||||||
import com.rammelkast.anticheatreloaded.config.Configuration;
|
import com.rammelkast.anticheatreloaded.config.Configuration;
|
||||||
import com.rammelkast.anticheatreloaded.config.ConfigurationFile;
|
import com.rammelkast.anticheatreloaded.config.ConfigurationFile;
|
||||||
import com.rammelkast.anticheatreloaded.util.enterprise.Database;
|
import com.rammelkast.anticheatreloaded.util.enterprise.Database;
|
||||||
@@ -43,7 +44,7 @@ public class Enterprise extends ConfigurationFile {
|
|||||||
|
|
||||||
public Database database;
|
public Database database;
|
||||||
|
|
||||||
public Enterprise(AntiCheat plugin, Configuration config) {
|
public Enterprise(AntiCheatReloaded plugin, Configuration config) {
|
||||||
super(plugin, config, FILENAME);
|
super(plugin, config, FILENAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-2
@@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* AntiCheat for Bukkit.
|
* AntiCheatReloaded for Bukkit and Spigot.
|
||||||
* Copyright (C) 2012-2014 AntiCheat Team | http://gravitydevelopment.net
|
* Copyright (c) 2012-2015 AntiCheat Team
|
||||||
|
* Copyright (c) 2016-2020 Rammelkast
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
+14
-5
@@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* AntiCheat for Bukkit.
|
* AntiCheatReloaded for Bukkit and Spigot.
|
||||||
* Copyright (C) 2012-2014 AntiCheat Team | http://gravitydevelopment.net
|
* Copyright (c) 2012-2015 AntiCheat Team
|
||||||
|
* Copyright (c) 2016-2020 Rammelkast
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -21,11 +22,13 @@ package com.rammelkast.anticheatreloaded.config.holders.mysql;
|
|||||||
import org.bukkit.configuration.file.FileConfiguration;
|
import org.bukkit.configuration.file.FileConfiguration;
|
||||||
import org.bukkit.configuration.file.YamlConfiguration;
|
import org.bukkit.configuration.file.YamlConfiguration;
|
||||||
|
|
||||||
import com.rammelkast.anticheatreloaded.AntiCheat;
|
import com.rammelkast.anticheatreloaded.AntiCheatReloaded;
|
||||||
import com.rammelkast.anticheatreloaded.config.Configuration;
|
import com.rammelkast.anticheatreloaded.config.Configuration;
|
||||||
import com.rammelkast.anticheatreloaded.config.ConfigurationTable;
|
import com.rammelkast.anticheatreloaded.config.ConfigurationTable;
|
||||||
import com.rammelkast.anticheatreloaded.config.providers.Lang;
|
import com.rammelkast.anticheatreloaded.config.providers.Lang;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStreamReader;
|
||||||
import java.lang.reflect.InvocationHandler;
|
import java.lang.reflect.InvocationHandler;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.sql.PreparedStatement;
|
import java.sql.PreparedStatement;
|
||||||
@@ -50,7 +53,13 @@ public class MySQLLangHolder extends ConfigurationTable implements InvocationHan
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void open() {
|
public void open() {
|
||||||
defaults = YamlConfiguration.loadConfiguration(AntiCheat.getPlugin().getResource("lang.yml"));
|
InputStreamReader reader = new InputStreamReader(AntiCheatReloaded.getPlugin().getResource("lang.yml"));
|
||||||
|
defaults = YamlConfiguration.loadConfiguration(reader);
|
||||||
|
try {
|
||||||
|
reader.close();
|
||||||
|
} catch (IOException e1) {
|
||||||
|
e1.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
stringValues = new HashMap<String, String>();
|
stringValues = new HashMap<String, String>();
|
||||||
listValues = new HashMap<String, List<String>>();
|
listValues = new HashMap<String, List<String>>();
|
||||||
@@ -142,7 +151,7 @@ public class MySQLLangHolder extends ConfigurationTable implements InvocationHan
|
|||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
AntiCheat.getPlugin().getLogger().severe("The lang value " + key + " couldn't be found.");
|
AntiCheatReloaded.getPlugin().getLogger().severe("The lang value " + key + " couldn't be found.");
|
||||||
return "Language error. See console for details.";
|
return "Language error. See console for details.";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+11
-10
@@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* AntiCheat for Bukkit.
|
* AntiCheatReloaded for Bukkit and Spigot.
|
||||||
* Copyright (C) 2012-2014 AntiCheat Team | http://gravitydevelopment.net
|
* Copyright (c) 2012-2015 AntiCheat Team
|
||||||
|
* Copyright (c) 2016-2020 Rammelkast
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -20,7 +21,7 @@ package com.rammelkast.anticheatreloaded.config.holders.mysql;
|
|||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
|
||||||
import com.rammelkast.anticheatreloaded.AntiCheat;
|
import com.rammelkast.anticheatreloaded.AntiCheatReloaded;
|
||||||
import com.rammelkast.anticheatreloaded.config.Configuration;
|
import com.rammelkast.anticheatreloaded.config.Configuration;
|
||||||
import com.rammelkast.anticheatreloaded.config.ConfigurationTable;
|
import com.rammelkast.anticheatreloaded.config.ConfigurationTable;
|
||||||
import com.rammelkast.anticheatreloaded.config.providers.Levels;
|
import com.rammelkast.anticheatreloaded.config.providers.Levels;
|
||||||
@@ -81,11 +82,11 @@ public class MySQLLevelsHolder extends ConfigurationTable implements Levels {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void saveLevelFromUser(final User user) {
|
public void saveLevelFromUser(final User user) {
|
||||||
Bukkit.getScheduler().runTaskAsynchronously(AntiCheat.getPlugin(), new Runnable() {
|
Bukkit.getScheduler().runTaskAsynchronously(AntiCheatReloaded.getPlugin(), new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
if (!user.isWaitingOnLevelSync()) {
|
if (!user.isWaitingOnLevelSync()) {
|
||||||
AntiCheat.debugLog("Saving level from " + user.getUUID() + ". Value: " + user.getLevel());
|
AntiCheatReloaded.debugLog("Saving level from " + user.getUUID() + ". Value: " + user.getLevel());
|
||||||
try {
|
try {
|
||||||
PreparedStatement statement = getConnection().prepareStatement(sqlSave);
|
PreparedStatement statement = getConnection().prepareStatement(sqlSave);
|
||||||
statement.setString(1, user.getUUID().toString());
|
statement.setString(1, user.getUUID().toString());
|
||||||
@@ -101,14 +102,14 @@ public class MySQLLevelsHolder extends ConfigurationTable implements Levels {
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
AntiCheat.getManager().getUserManager().remove(user);
|
AntiCheatReloaded.getManager().getUserManager().remove(user);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void loadLevelToUser(final User user) {
|
public void loadLevelToUser(final User user) {
|
||||||
Bukkit.getScheduler().runTaskAsynchronously(AntiCheat.getPlugin(), new Runnable() {
|
Bukkit.getScheduler().runTaskAsynchronously(AntiCheatReloaded.getPlugin(), new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
try {
|
try {
|
||||||
@@ -120,7 +121,7 @@ public class MySQLLevelsHolder extends ConfigurationTable implements Levels {
|
|||||||
boolean has = false;
|
boolean has = false;
|
||||||
while (set.next()) {
|
while (set.next()) {
|
||||||
has = true;
|
has = true;
|
||||||
AntiCheat.debugLog("Syncing level to " + user.getUUID() + ". Value: " + set.getInt("level"));
|
AntiCheatReloaded.debugLog("Syncing level to " + user.getUUID() + ". Value: " + set.getInt("level"));
|
||||||
user.setLevel(set.getInt("level"));
|
user.setLevel(set.getInt("level"));
|
||||||
user.setLevelSyncTimestamp(set.getTimestamp("last_update"));
|
user.setLevelSyncTimestamp(set.getTimestamp("last_update"));
|
||||||
}
|
}
|
||||||
@@ -162,7 +163,7 @@ public class MySQLLevelsHolder extends ConfigurationTable implements Levels {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateLevelToUser(final User user) {
|
public void updateLevelToUser(final User user) {
|
||||||
Bukkit.getScheduler().runTaskAsynchronously(AntiCheat.getPlugin(), new Runnable() {
|
Bukkit.getScheduler().runTaskAsynchronously(AntiCheatReloaded.getPlugin(), new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
try {
|
try {
|
||||||
@@ -174,7 +175,7 @@ public class MySQLLevelsHolder extends ConfigurationTable implements Levels {
|
|||||||
ResultSet set = statement.executeQuery();
|
ResultSet set = statement.executeQuery();
|
||||||
|
|
||||||
while (set.next()) {
|
while (set.next()) {
|
||||||
AntiCheat.debugLog("Syncing level to " + user.getUUID() + ". Value: " + set.getInt("level"));
|
AntiCheatReloaded.debugLog("Syncing level to " + user.getUUID() + ". Value: " + set.getInt("level"));
|
||||||
user.setLevel(set.getInt("level"));
|
user.setLevel(set.getInt("level"));
|
||||||
user.setLevelSyncTimestamp(set.getTimestamp("last_update"));
|
user.setLevelSyncTimestamp(set.getTimestamp("last_update"));
|
||||||
}
|
}
|
||||||
|
|||||||
+15
-6
@@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* AntiCheat for Bukkit.
|
* AntiCheatReloaded for Bukkit and Spigot.
|
||||||
* Copyright (C) 2012-2014 AntiCheat Team | http://gravitydevelopment.net
|
* Copyright (c) 2012-2015 AntiCheat Team
|
||||||
|
* Copyright (c) 2016-2020 Rammelkast
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -21,11 +22,13 @@ package com.rammelkast.anticheatreloaded.config.holders.mysql;
|
|||||||
import org.bukkit.configuration.file.FileConfiguration;
|
import org.bukkit.configuration.file.FileConfiguration;
|
||||||
import org.bukkit.configuration.file.YamlConfiguration;
|
import org.bukkit.configuration.file.YamlConfiguration;
|
||||||
|
|
||||||
import com.rammelkast.anticheatreloaded.AntiCheat;
|
import com.rammelkast.anticheatreloaded.AntiCheatReloaded;
|
||||||
import com.rammelkast.anticheatreloaded.config.Configuration;
|
import com.rammelkast.anticheatreloaded.config.Configuration;
|
||||||
import com.rammelkast.anticheatreloaded.config.ConfigurationTable;
|
import com.rammelkast.anticheatreloaded.config.ConfigurationTable;
|
||||||
import com.rammelkast.anticheatreloaded.config.providers.Magic;
|
import com.rammelkast.anticheatreloaded.config.providers.Magic;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStreamReader;
|
||||||
import java.lang.reflect.InvocationHandler;
|
import java.lang.reflect.InvocationHandler;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
@@ -47,7 +50,13 @@ public class MySQLMagicHolder extends ConfigurationTable implements InvocationHa
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void open() {
|
public void open() {
|
||||||
defaults = YamlConfiguration.loadConfiguration(AntiCheat.getPlugin().getResource("magic.yml"));
|
InputStreamReader reader = new InputStreamReader(AntiCheatReloaded.getPlugin().getResource("magic.yml"));
|
||||||
|
defaults = YamlConfiguration.loadConfiguration(reader);
|
||||||
|
try {
|
||||||
|
reader.close();
|
||||||
|
} catch (IOException e1) {
|
||||||
|
e1.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
ints = new HashMap<String, Integer>();
|
ints = new HashMap<String, Integer>();
|
||||||
doubles = new HashMap<String, Double>();
|
doubles = new HashMap<String, Double>();
|
||||||
@@ -94,7 +103,7 @@ public class MySQLMagicHolder extends ConfigurationTable implements InvocationHa
|
|||||||
} else if (set.getObject("value_double") != null) {
|
} else if (set.getObject("value_double") != null) {
|
||||||
doubles.put(key, set.getDouble("value_double"));
|
doubles.put(key, set.getDouble("value_double"));
|
||||||
} else {
|
} else {
|
||||||
AntiCheat.getPlugin().getLogger().severe("The magic value " + key + " loaded from the database did not have a value configured. Using the default value.");
|
AntiCheatReloaded.getPlugin().getLogger().severe("The magic value " + key + " loaded from the database did not have a value configured. Using the default value.");
|
||||||
for (int i=1;i<=methods.length;i++) {
|
for (int i=1;i<=methods.length;i++) {
|
||||||
String name = methods[i-1].getName();
|
String name = methods[i-1].getName();
|
||||||
if (name.equalsIgnoreCase(key)) {
|
if (name.equalsIgnoreCase(key)) {
|
||||||
@@ -141,7 +150,7 @@ public class MySQLMagicHolder extends ConfigurationTable implements InvocationHa
|
|||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
AntiCheat.getPlugin().getLogger().severe("The magic value " + key + " couldn't be found.");
|
AntiCheatReloaded.getPlugin().getLogger().severe("The magic value " + key + " couldn't be found.");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+5
-4
@@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* AntiCheat for Bukkit.
|
* AntiCheatReloaded for Bukkit and Spigot.
|
||||||
* Copyright (C) 2012-2014 AntiCheat Team | http://gravitydevelopment.net
|
* Copyright (c) 2012-2015 AntiCheat Team
|
||||||
|
* Copyright (c) 2016-2020 Rammelkast
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -23,7 +24,7 @@ import java.sql.SQLException;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.rammelkast.anticheatreloaded.AntiCheat;
|
import com.rammelkast.anticheatreloaded.AntiCheatReloaded;
|
||||||
import com.rammelkast.anticheatreloaded.config.Configuration;
|
import com.rammelkast.anticheatreloaded.config.Configuration;
|
||||||
import com.rammelkast.anticheatreloaded.config.ConfigurationTable;
|
import com.rammelkast.anticheatreloaded.config.ConfigurationTable;
|
||||||
import com.rammelkast.anticheatreloaded.config.providers.Rules;
|
import com.rammelkast.anticheatreloaded.config.providers.Rules;
|
||||||
@@ -65,7 +66,7 @@ public class MySQLRulesHolder extends ConfigurationTable implements Rules {
|
|||||||
if (rule != null) {
|
if (rule != null) {
|
||||||
this.rules.add(rule);
|
this.rules.add(rule);
|
||||||
} else {
|
} else {
|
||||||
AntiCheat.getPlugin().getLogger().warning("Couldn't load rule '" + string + "' from the database. Improper format used.");
|
AntiCheatReloaded.getPlugin().getLogger().warning("Couldn't load rule '" + string + "' from the database. Improper format used.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
|
|||||||
+5
-4
@@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* AntiCheat for Bukkit.
|
* AntiCheatReloaded for Bukkit and Spigot.
|
||||||
* Copyright (C) 2012-2014 AntiCheat Team | http://gravitydevelopment.net
|
* Copyright (c) 2012-2015 AntiCheat Team
|
||||||
|
* Copyright (c) 2016-2020 Rammelkast
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -20,7 +21,7 @@ package com.rammelkast.anticheatreloaded.config.holders.yaml;
|
|||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
import com.rammelkast.anticheatreloaded.AntiCheat;
|
import com.rammelkast.anticheatreloaded.AntiCheatReloaded;
|
||||||
import com.rammelkast.anticheatreloaded.config.Configuration;
|
import com.rammelkast.anticheatreloaded.config.Configuration;
|
||||||
import com.rammelkast.anticheatreloaded.config.ConfigurationFile;
|
import com.rammelkast.anticheatreloaded.config.ConfigurationFile;
|
||||||
import com.rammelkast.anticheatreloaded.config.providers.Groups;
|
import com.rammelkast.anticheatreloaded.config.providers.Groups;
|
||||||
@@ -34,7 +35,7 @@ public class YamlGroupsHolder extends ConfigurationFile implements Groups {
|
|||||||
|
|
||||||
private int highestLevel;
|
private int highestLevel;
|
||||||
|
|
||||||
public YamlGroupsHolder(AntiCheat plugin, Configuration config) {
|
public YamlGroupsHolder(AntiCheatReloaded plugin, Configuration config) {
|
||||||
super(plugin, config, FILENAME);
|
super(plugin, config, FILENAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+6
-5
@@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* AntiCheat for Bukkit.
|
* AntiCheatReloaded for Bukkit and Spigot.
|
||||||
* Copyright (C) 2012-2014 AntiCheat Team | http://gravitydevelopment.net
|
* Copyright (c) 2012-2015 AntiCheat Team
|
||||||
|
* Copyright (c) 2016-2020 Rammelkast
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -22,7 +23,7 @@ import java.lang.reflect.InvocationHandler;
|
|||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.rammelkast.anticheatreloaded.AntiCheat;
|
import com.rammelkast.anticheatreloaded.AntiCheatReloaded;
|
||||||
import com.rammelkast.anticheatreloaded.config.Configuration;
|
import com.rammelkast.anticheatreloaded.config.Configuration;
|
||||||
import com.rammelkast.anticheatreloaded.config.ConfigurationFile;
|
import com.rammelkast.anticheatreloaded.config.ConfigurationFile;
|
||||||
|
|
||||||
@@ -30,7 +31,7 @@ public class YamlLangHolder extends ConfigurationFile implements InvocationHandl
|
|||||||
|
|
||||||
public static final String FILENAME = "lang.yml";
|
public static final String FILENAME = "lang.yml";
|
||||||
|
|
||||||
public YamlLangHolder(AntiCheat plugin, Configuration config) {
|
public YamlLangHolder(AntiCheatReloaded plugin, Configuration config) {
|
||||||
super(plugin, config, FILENAME);
|
super(plugin, config, FILENAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -76,7 +77,7 @@ public class YamlLangHolder extends ConfigurationFile implements InvocationHandl
|
|||||||
return value.getValue();
|
return value.getValue();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
AntiCheat.getPlugin().getLogger().severe("The lang value " + key + " couldn't be found.");
|
AntiCheatReloaded.getPlugin().getLogger().severe("The lang value " + key + " couldn't be found.");
|
||||||
return "Language error. See console for details.";
|
return "Language error. See console for details.";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+6
-5
@@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* AntiCheat for Bukkit.
|
* AntiCheatReloaded for Bukkit and Spigot.
|
||||||
* Copyright (C) 2012-2014 AntiCheat Team | http://gravitydevelopment.net
|
* Copyright (c) 2012-2015 AntiCheat Team
|
||||||
|
* Copyright (c) 2016-2020 Rammelkast
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -21,7 +22,7 @@ package com.rammelkast.anticheatreloaded.config.holders.yaml;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import com.rammelkast.anticheatreloaded.AntiCheat;
|
import com.rammelkast.anticheatreloaded.AntiCheatReloaded;
|
||||||
import com.rammelkast.anticheatreloaded.config.Configuration;
|
import com.rammelkast.anticheatreloaded.config.Configuration;
|
||||||
import com.rammelkast.anticheatreloaded.config.ConfigurationFile;
|
import com.rammelkast.anticheatreloaded.config.ConfigurationFile;
|
||||||
import com.rammelkast.anticheatreloaded.config.providers.Levels;
|
import com.rammelkast.anticheatreloaded.config.providers.Levels;
|
||||||
@@ -31,7 +32,7 @@ public class YamlLevelsHolder extends ConfigurationFile implements Levels {
|
|||||||
|
|
||||||
public static final String FILENAME = "data/levels.yml";
|
public static final String FILENAME = "data/levels.yml";
|
||||||
|
|
||||||
public YamlLevelsHolder(AntiCheat plugin, Configuration config) {
|
public YamlLevelsHolder(AntiCheatReloaded plugin, Configuration config) {
|
||||||
super(plugin, config, FILENAME, false);
|
super(plugin, config, FILENAME, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -47,7 +48,7 @@ public class YamlLevelsHolder extends ConfigurationFile implements Levels {
|
|||||||
|
|
||||||
private void saveLevelFromUser(User user, boolean remove) {
|
private void saveLevelFromUser(User user, boolean remove) {
|
||||||
saveLevel(user.getUUID(), user.getLevel());
|
saveLevel(user.getUUID(), user.getLevel());
|
||||||
if (remove) AntiCheat.getManager().getUserManager().remove(user);
|
if (remove) AntiCheatReloaded.getManager().getUserManager().remove(user);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
+6
-5
@@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* AntiCheat for Bukkit.
|
* AntiCheatReloaded for Bukkit and Spigot.
|
||||||
* Copyright (C) 2012-2014 AntiCheat Team | http://gravitydevelopment.net
|
* Copyright (c) 2012-2015 AntiCheat Team
|
||||||
|
* Copyright (c) 2016-2020 Rammelkast
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -21,7 +22,7 @@ package com.rammelkast.anticheatreloaded.config.holders.yaml;
|
|||||||
import java.lang.reflect.InvocationHandler;
|
import java.lang.reflect.InvocationHandler;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
|
|
||||||
import com.rammelkast.anticheatreloaded.AntiCheat;
|
import com.rammelkast.anticheatreloaded.AntiCheatReloaded;
|
||||||
import com.rammelkast.anticheatreloaded.config.Configuration;
|
import com.rammelkast.anticheatreloaded.config.Configuration;
|
||||||
import com.rammelkast.anticheatreloaded.config.ConfigurationFile;
|
import com.rammelkast.anticheatreloaded.config.ConfigurationFile;
|
||||||
|
|
||||||
@@ -29,7 +30,7 @@ public class YamlMagicHolder extends ConfigurationFile implements InvocationHand
|
|||||||
|
|
||||||
public static final String FILENAME = "magic.yml";
|
public static final String FILENAME = "magic.yml";
|
||||||
|
|
||||||
public YamlMagicHolder(AntiCheat plugin, Configuration config) {
|
public YamlMagicHolder(AntiCheatReloaded plugin, Configuration config) {
|
||||||
super(plugin, config, FILENAME);
|
super(plugin, config, FILENAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -41,7 +42,7 @@ public class YamlMagicHolder extends ConfigurationFile implements InvocationHand
|
|||||||
} else if (method.getReturnType().getSimpleName().equals("double")) {
|
} else if (method.getReturnType().getSimpleName().equals("double")) {
|
||||||
return new ConfigValue<Double>(key).getValue();
|
return new ConfigValue<Double>(key).getValue();
|
||||||
} else {
|
} else {
|
||||||
AntiCheat.getPlugin().getLogger().severe("The magic value " + key + " couldn't be found.");
|
AntiCheatReloaded.getPlugin().getLogger().severe("The magic value " + key + " couldn't be found.");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-5
@@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* AntiCheat for Bukkit.
|
* AntiCheatReloaded for Bukkit and Spigot.
|
||||||
* Copyright (C) 2012-2014 AntiCheat Team | http://gravitydevelopment.net
|
* Copyright (c) 2012-2015 AntiCheat Team
|
||||||
|
* Copyright (c) 2016-2020 Rammelkast
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -21,7 +22,7 @@ package com.rammelkast.anticheatreloaded.config.holders.yaml;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.rammelkast.anticheatreloaded.AntiCheat;
|
import com.rammelkast.anticheatreloaded.AntiCheatReloaded;
|
||||||
import com.rammelkast.anticheatreloaded.config.Configuration;
|
import com.rammelkast.anticheatreloaded.config.Configuration;
|
||||||
import com.rammelkast.anticheatreloaded.config.ConfigurationFile;
|
import com.rammelkast.anticheatreloaded.config.ConfigurationFile;
|
||||||
import com.rammelkast.anticheatreloaded.config.providers.Rules;
|
import com.rammelkast.anticheatreloaded.config.providers.Rules;
|
||||||
@@ -33,7 +34,7 @@ public class YamlRulesHolder extends ConfigurationFile implements Rules {
|
|||||||
|
|
||||||
private List<Rule> rules;
|
private List<Rule> rules;
|
||||||
|
|
||||||
public YamlRulesHolder(AntiCheat plugin, Configuration config) {
|
public YamlRulesHolder(AntiCheatReloaded plugin, Configuration config) {
|
||||||
super(plugin, config, FILENAME);
|
super(plugin, config, FILENAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -61,7 +62,7 @@ public class YamlRulesHolder extends ConfigurationFile implements Rules {
|
|||||||
if (rule != null) {
|
if (rule != null) {
|
||||||
this.rules.add(rule);
|
this.rules.add(rule);
|
||||||
} else {
|
} else {
|
||||||
AntiCheat.getPlugin().getLogger().warning("Couldn't load rule '" + string + "' from config. Improper format used.");
|
AntiCheatReloaded.getPlugin().getLogger().warning("Couldn't load rule '" + string + "' from config. Improper format used.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* AntiCheat for Bukkit.
|
* AntiCheatReloaded for Bukkit and Spigot.
|
||||||
* Copyright (C) 2012-2014 AntiCheat Team | http://gravitydevelopment.net
|
* Copyright (c) 2012-2015 AntiCheat Team
|
||||||
|
* Copyright (c) 2016-2020 Rammelkast
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,3 +1,22 @@
|
|||||||
|
/*
|
||||||
|
* AntiCheatReloaded for Bukkit and Spigot.
|
||||||
|
* Copyright (c) 2012-2015 AntiCheat Team
|
||||||
|
* Copyright (c) 2016-2020 Rammelkast
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
package com.rammelkast.anticheatreloaded.config.providers;
|
package com.rammelkast.anticheatreloaded.config.providers;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* AntiCheat for Bukkit.
|
* AntiCheatReloaded for Bukkit and Spigot.
|
||||||
* Copyright (C) 2012-2014 AntiCheat Team | http://gravitydevelopment.net
|
* Copyright (c) 2012-2015 AntiCheat Team
|
||||||
|
* Copyright (c) 2016-2020 Rammelkast
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* AntiCheat for Bukkit.
|
* AntiCheatReloaded for Bukkit and Spigot.
|
||||||
* Copyright (C) 2012-2014 AntiCheat Team | http://gravitydevelopment.net
|
* Copyright (c) 2012-2015 AntiCheat Team
|
||||||
|
* Copyright (c) 2016-2020 Rammelkast
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* AntiCheat for Bukkit.
|
* AntiCheatReloaded for Bukkit and Spigot.
|
||||||
* Copyright (C) 2012-2014 AntiCheat Team | http://gravitydevelopment.net
|
* Copyright (c) 2012-2015 AntiCheat Team
|
||||||
|
* Copyright (c) 2016-2020 Rammelkast
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -16,7 +17,6 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
package com.rammelkast.anticheatreloaded.config.providers;
|
package com.rammelkast.anticheatreloaded.config.providers;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|||||||
+7
-3
@@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* AntiCheat for Bukkit.
|
* AntiCheatReloaded for Bukkit and Spigot.
|
||||||
* Copyright (C) 2012-2014 AntiCheat Team | http://gravitydevelopment.net
|
* Copyright (c) 2012-2015 AntiCheat Team
|
||||||
|
* Copyright (c) 2016-2020 Rammelkast
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -33,6 +34,7 @@ import java.io.File;
|
|||||||
import java.io.FileNotFoundException;
|
import java.io.FileNotFoundException;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
import java.io.InputStreamReader;
|
||||||
import java.util.ArrayDeque;
|
import java.util.ArrayDeque;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -188,7 +190,9 @@ public class CommentedConfiguration extends YamlConfiguration {
|
|||||||
CommentedConfiguration config = new CommentedConfiguration();
|
CommentedConfiguration config = new CommentedConfiguration();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
config.load(stream);
|
InputStreamReader reader = new InputStreamReader(stream);
|
||||||
|
config.load(reader);
|
||||||
|
reader.close();
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
Bukkit.getLogger().log(Level.SEVERE, "Cannot load configuration from stream", ex);
|
Bukkit.getLogger().log(Level.SEVERE, "Cannot load configuration from stream", ex);
|
||||||
} catch (InvalidConfigurationException ex) {
|
} catch (InvalidConfigurationException ex) {
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* AntiCheat for Bukkit.
|
* AntiCheatReloaded for Bukkit and Spigot.
|
||||||
* Copyright (C) 2012-2014 AntiCheat Team | http://gravitydevelopment.net
|
* Copyright (c) 2012-2015 AntiCheat Team
|
||||||
|
* Copyright (c) 2016-2020 Rammelkast
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -26,7 +27,7 @@ import org.bukkit.event.block.BlockBreakEvent;
|
|||||||
import org.bukkit.event.block.BlockDamageEvent;
|
import org.bukkit.event.block.BlockDamageEvent;
|
||||||
import org.bukkit.event.block.BlockPlaceEvent;
|
import org.bukkit.event.block.BlockPlaceEvent;
|
||||||
|
|
||||||
import com.rammelkast.anticheatreloaded.AntiCheat;
|
import com.rammelkast.anticheatreloaded.AntiCheatReloaded;
|
||||||
import com.rammelkast.anticheatreloaded.check.CheckResult;
|
import com.rammelkast.anticheatreloaded.check.CheckResult;
|
||||||
import com.rammelkast.anticheatreloaded.check.CheckType;
|
import com.rammelkast.anticheatreloaded.check.CheckType;
|
||||||
import com.rammelkast.anticheatreloaded.util.Distance;
|
import com.rammelkast.anticheatreloaded.util.Distance;
|
||||||
@@ -48,7 +49,7 @@ public class BlockListener extends EventListener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
AntiCheat.getManager().addEvent(event.getEventName(), event.getHandlers().getRegisteredListeners());
|
AntiCheatReloaded.getManager().addEvent(event.getEventName(), event.getHandlers().getRegisteredListeners());
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(ignoreCancelled = true)
|
@EventHandler(ignoreCancelled = true)
|
||||||
@@ -65,7 +66,7 @@ public class BlockListener extends EventListener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
AntiCheat.getManager().addEvent(event.getEventName(), event.getHandlers().getRegisteredListeners());
|
AntiCheatReloaded.getManager().addEvent(event.getEventName(), event.getHandlers().getRegisteredListeners());
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(ignoreCancelled = true)
|
@EventHandler(ignoreCancelled = true)
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* AntiCheat for Bukkit.
|
* AntiCheatReloaded for Bukkit and Spigot.
|
||||||
* Copyright (C) 2012-2014 AntiCheat Team | http://gravitydevelopment.net
|
* Copyright (c) 2012-2015 AntiCheat Team
|
||||||
|
* Copyright (c) 2016-2020 Rammelkast
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -29,7 +30,7 @@ import org.bukkit.event.entity.EntityDamageEvent;
|
|||||||
import org.bukkit.event.entity.EntityRegainHealthEvent;
|
import org.bukkit.event.entity.EntityRegainHealthEvent;
|
||||||
import org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason;
|
import org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason;
|
||||||
|
|
||||||
import com.rammelkast.anticheatreloaded.AntiCheat;
|
import com.rammelkast.anticheatreloaded.AntiCheatReloaded;
|
||||||
import com.rammelkast.anticheatreloaded.check.CheckResult;
|
import com.rammelkast.anticheatreloaded.check.CheckResult;
|
||||||
import com.rammelkast.anticheatreloaded.check.CheckType;
|
import com.rammelkast.anticheatreloaded.check.CheckType;
|
||||||
import com.rammelkast.anticheatreloaded.check.combat.CriticalsCheck;
|
import com.rammelkast.anticheatreloaded.check.combat.CriticalsCheck;
|
||||||
@@ -57,7 +58,7 @@ public class EntityListener extends EventListener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
AntiCheat.getManager().addEvent(event.getEventName(), event.getHandlers().getRegisteredListeners());
|
AntiCheatReloaded.getManager().addEvent(event.getEventName(), event.getHandlers().getRegisteredListeners());
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
@@ -76,7 +77,7 @@ public class EntityListener extends EventListener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
AntiCheat.getManager().addEvent(event.getEventName(), event.getHandlers().getRegisteredListeners());
|
AntiCheatReloaded.getManager().addEvent(event.getEventName(), event.getHandlers().getRegisteredListeners());
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
@@ -95,7 +96,7 @@ public class EntityListener extends EventListener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
AntiCheat.getManager().addEvent(event.getEventName(), event.getHandlers().getRegisteredListeners());
|
AntiCheatReloaded.getManager().addEvent(event.getEventName(), event.getHandlers().getRegisteredListeners());
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority=EventPriority.HIGHEST, ignoreCancelled = true)
|
@EventHandler(priority=EventPriority.HIGHEST, ignoreCancelled = true)
|
||||||
@@ -169,6 +170,6 @@ public class EntityListener extends EventListener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
AntiCheat.getManager().addEvent(event.getEventName(), event.getHandlers().getRegisteredListeners());
|
AntiCheatReloaded.getManager().addEvent(event.getEventName(), event.getHandlers().getRegisteredListeners());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* AntiCheat for Bukkit.
|
* AntiCheatReloaded for Bukkit and Spigot.
|
||||||
* Copyright (C) 2012-2014 AntiCheat Team | http://gravitydevelopment.net
|
* Copyright (c) 2012-2015 AntiCheat Team
|
||||||
|
* Copyright (c) 2016-2020 Rammelkast
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -21,7 +22,7 @@ package com.rammelkast.anticheatreloaded.event;
|
|||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
|
|
||||||
import com.rammelkast.anticheatreloaded.AntiCheat;
|
import com.rammelkast.anticheatreloaded.AntiCheatReloaded;
|
||||||
import com.rammelkast.anticheatreloaded.check.Backend;
|
import com.rammelkast.anticheatreloaded.check.Backend;
|
||||||
import com.rammelkast.anticheatreloaded.check.CheckType;
|
import com.rammelkast.anticheatreloaded.check.CheckType;
|
||||||
import com.rammelkast.anticheatreloaded.config.Configuration;
|
import com.rammelkast.anticheatreloaded.config.Configuration;
|
||||||
@@ -36,18 +37,18 @@ import java.util.UUID;
|
|||||||
public class EventListener implements Listener {
|
public class EventListener implements Listener {
|
||||||
private static final Map<CheckType, Integer> USAGE_LIST = new EnumMap<CheckType, Integer>(CheckType.class);
|
private static final Map<CheckType, Integer> USAGE_LIST = new EnumMap<CheckType, Integer>(CheckType.class);
|
||||||
private static final Map<UUID, Integer> DECREASE_LIST = new HashMap<UUID, Integer>();
|
private static final Map<UUID, Integer> DECREASE_LIST = new HashMap<UUID, Integer>();
|
||||||
private static final CheckManager CHECK_MANAGER = AntiCheat.getManager().getCheckManager();
|
private static final CheckManager CHECK_MANAGER = AntiCheatReloaded.getManager().getCheckManager();
|
||||||
private static final Backend BACKEND = AntiCheat.getManager().getBackend();
|
private static final Backend BACKEND = AntiCheatReloaded.getManager().getBackend();
|
||||||
private static final AntiCheat PLUGIN = AntiCheat.getManager().getPlugin();
|
private static final AntiCheatReloaded PLUGIN = AntiCheatReloaded.getManager().getPlugin();
|
||||||
private static final UserManager USER_MANAGER = AntiCheat.getManager().getUserManager();
|
private static final UserManager USER_MANAGER = AntiCheatReloaded.getManager().getUserManager();
|
||||||
private static final Configuration CONFIG = AntiCheat.getManager().getConfiguration();
|
private static final Configuration CONFIG = AntiCheatReloaded.getManager().getConfiguration();
|
||||||
|
|
||||||
public static void log(String message, Player player, CheckType type) {
|
public static void log(String message, Player player, CheckType type) {
|
||||||
User user = getUserManager().getUser(player.getUniqueId());
|
User user = getUserManager().getUser(player.getUniqueId());
|
||||||
if (user != null) { // npc
|
if (user != null) { // npc
|
||||||
logCheat(type, user);
|
logCheat(type, user);
|
||||||
if (user.increaseLevel(type) && message != null) {
|
if (user.increaseLevel(type) && message != null) {
|
||||||
AntiCheat.getManager().log(message);
|
AntiCheatReloaded.getManager().log(message);
|
||||||
}
|
}
|
||||||
removeDecrease(user);
|
removeDecrease(user);
|
||||||
}
|
}
|
||||||
@@ -116,7 +117,7 @@ public class EventListener implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static AntiCheatManager getManager() {
|
public static AntiCheatManager getManager() {
|
||||||
return AntiCheat.getManager();
|
return AntiCheatReloaded.getManager();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Backend getBackend() {
|
public static Backend getBackend() {
|
||||||
@@ -127,7 +128,7 @@ public class EventListener implements Listener {
|
|||||||
return USER_MANAGER;
|
return USER_MANAGER;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static AntiCheat getPlugin() {
|
public static AntiCheatReloaded getPlugin() {
|
||||||
return PLUGIN;
|
return PLUGIN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* AntiCheat for Bukkit.
|
* AntiCheatReloaded for Bukkit and Spigot.
|
||||||
* Copyright (C) 2012-2014 AntiCheat Team | http://gravitydevelopment.net
|
* Copyright (c) 2012-2015 AntiCheat Team
|
||||||
|
* Copyright (c) 2016-2020 Rammelkast
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -25,7 +26,7 @@ import org.bukkit.event.inventory.InventoryCloseEvent;
|
|||||||
import org.bukkit.event.inventory.InventoryOpenEvent;
|
import org.bukkit.event.inventory.InventoryOpenEvent;
|
||||||
import org.bukkit.event.inventory.InventoryType;
|
import org.bukkit.event.inventory.InventoryType;
|
||||||
|
|
||||||
import com.rammelkast.anticheatreloaded.AntiCheat;
|
import com.rammelkast.anticheatreloaded.AntiCheatReloaded;
|
||||||
import com.rammelkast.anticheatreloaded.check.CheckResult;
|
import com.rammelkast.anticheatreloaded.check.CheckResult;
|
||||||
import com.rammelkast.anticheatreloaded.check.CheckType;
|
import com.rammelkast.anticheatreloaded.check.CheckType;
|
||||||
import com.rammelkast.anticheatreloaded.util.User;
|
import com.rammelkast.anticheatreloaded.util.User;
|
||||||
@@ -51,7 +52,7 @@ public class InventoryListener extends EventListener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
AntiCheat.getManager().addEvent(event.getEventName(), event.getHandlers().getRegisteredListeners());
|
AntiCheatReloaded.getManager().addEvent(event.getEventName(), event.getHandlers().getRegisteredListeners());
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* AntiCheat for Bukkit.
|
* AntiCheatReloaded for Bukkit and Spigot.
|
||||||
* Copyright (C) 2012-2014 AntiCheat Team | http://gravitydevelopment.net
|
* Copyright (c) 2012-2015 AntiCheat Team
|
||||||
|
* Copyright (c) 2016-2020 Rammelkast
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -51,11 +52,10 @@ import org.bukkit.event.player.PlayerToggleSprintEvent;
|
|||||||
import org.bukkit.event.player.PlayerVelocityEvent;
|
import org.bukkit.event.player.PlayerVelocityEvent;
|
||||||
import org.bukkit.inventory.PlayerInventory;
|
import org.bukkit.inventory.PlayerInventory;
|
||||||
|
|
||||||
import com.rammelkast.anticheatreloaded.AntiCheat;
|
import com.rammelkast.anticheatreloaded.AntiCheatReloaded;
|
||||||
import com.rammelkast.anticheatreloaded.check.CheckResult;
|
import com.rammelkast.anticheatreloaded.check.CheckResult;
|
||||||
import com.rammelkast.anticheatreloaded.check.CheckType;
|
import com.rammelkast.anticheatreloaded.check.CheckType;
|
||||||
import com.rammelkast.anticheatreloaded.check.combat.KillAuraCheck;
|
import com.rammelkast.anticheatreloaded.check.movement.ElytraCheck;
|
||||||
import com.rammelkast.anticheatreloaded.check.movement.ElytraFly;
|
|
||||||
import com.rammelkast.anticheatreloaded.check.movement.FlightCheck;
|
import com.rammelkast.anticheatreloaded.check.movement.FlightCheck;
|
||||||
import com.rammelkast.anticheatreloaded.check.movement.GlideCheck;
|
import com.rammelkast.anticheatreloaded.check.movement.GlideCheck;
|
||||||
import com.rammelkast.anticheatreloaded.check.movement.SpeedCheck;
|
import com.rammelkast.anticheatreloaded.check.movement.SpeedCheck;
|
||||||
@@ -82,7 +82,7 @@ public class PlayerListener extends EventListener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
AntiCheat.getManager().addEvent(event.getEventName(), event.getHandlers().getRegisteredListeners());
|
AntiCheatReloaded.getManager().addEvent(event.getEventName(), event.getHandlers().getRegisteredListeners());
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
@@ -91,7 +91,7 @@ public class PlayerListener extends EventListener {
|
|||||||
getBackend().logEnterExit(event.getPlayer());
|
getBackend().logEnterExit(event.getPlayer());
|
||||||
}
|
}
|
||||||
|
|
||||||
AntiCheat.getManager().addEvent(event.getEventName(), event.getHandlers().getRegisteredListeners());
|
AntiCheatReloaded.getManager().addEvent(event.getEventName(), event.getHandlers().getRegisteredListeners());
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
@@ -100,7 +100,7 @@ public class PlayerListener extends EventListener {
|
|||||||
getBackend().logEnterExit(event.getPlayer());
|
getBackend().logEnterExit(event.getPlayer());
|
||||||
}
|
}
|
||||||
|
|
||||||
AntiCheat.getManager().addEvent(event.getEventName(), event.getHandlers().getRegisteredListeners());
|
AntiCheatReloaded.getManager().addEvent(event.getEventName(), event.getHandlers().getRegisteredListeners());
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
@@ -121,7 +121,7 @@ public class PlayerListener extends EventListener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
AntiCheat.getManager().addEvent(event.getEventName(), event.getHandlers().getRegisteredListeners());
|
AntiCheatReloaded.getManager().addEvent(event.getEventName(), event.getHandlers().getRegisteredListeners());
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
@@ -130,14 +130,14 @@ public class PlayerListener extends EventListener {
|
|||||||
getBackend().logTeleport(event.getPlayer());
|
getBackend().logTeleport(event.getPlayer());
|
||||||
}
|
}
|
||||||
|
|
||||||
AntiCheat.getManager().addEvent(event.getEventName(), event.getHandlers().getRegisteredListeners());
|
AntiCheatReloaded.getManager().addEvent(event.getEventName(), event.getHandlers().getRegisteredListeners());
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onPlayerChangeWorlds(PlayerChangedWorldEvent event) {
|
public void onPlayerChangeWorlds(PlayerChangedWorldEvent event) {
|
||||||
getBackend().logTeleport(event.getPlayer());
|
getBackend().logTeleport(event.getPlayer());
|
||||||
|
|
||||||
AntiCheat.getManager().addEvent(event.getEventName(), event.getHandlers().getRegisteredListeners());
|
AntiCheatReloaded.getManager().addEvent(event.getEventName(), event.getHandlers().getRegisteredListeners());
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
@@ -146,13 +146,13 @@ public class PlayerListener extends EventListener {
|
|||||||
getBackend().logToggleSneak(event.getPlayer());
|
getBackend().logToggleSneak(event.getPlayer());
|
||||||
}
|
}
|
||||||
|
|
||||||
AntiCheat.getManager().addEvent(event.getEventName(), event.getHandlers().getRegisteredListeners());
|
AntiCheatReloaded.getManager().addEvent(event.getEventName(), event.getHandlers().getRegisteredListeners());
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onPlayerVelocity(PlayerVelocityEvent event) {
|
public void onPlayerVelocity(PlayerVelocityEvent event) {
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
if (getCheckManager().willCheck(player, CheckType.FLY)) {
|
if (getCheckManager().willCheck(player, CheckType.FLIGHT)) {
|
||||||
if (getBackend().justVelocity(player) && getBackend().extendVelocityTime(player)) {
|
if (getBackend().justVelocity(player) && getBackend().extendVelocityTime(player)) {
|
||||||
event.setCancelled(!silentMode());
|
event.setCancelled(!silentMode());
|
||||||
return;
|
return;
|
||||||
@@ -160,7 +160,7 @@ public class PlayerListener extends EventListener {
|
|||||||
getBackend().logVelocity(player);
|
getBackend().logVelocity(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
AntiCheat.getManager().addEvent(event.getEventName(), event.getHandlers().getRegisteredListeners());
|
AntiCheatReloaded.getManager().addEvent(event.getEventName(), event.getHandlers().getRegisteredListeners());
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(ignoreCancelled = true)
|
@EventHandler(ignoreCancelled = true)
|
||||||
@@ -175,18 +175,37 @@ public class PlayerListener extends EventListener {
|
|||||||
player.sendMessage(ChatColor.RED + result.getMessage());
|
player.sendMessage(ChatColor.RED + result.getMessage());
|
||||||
}
|
}
|
||||||
getBackend().processChatSpammer(player);
|
getBackend().processChatSpammer(player);
|
||||||
|
AntiCheatReloaded.sendToMainThread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
log(null, player, CheckType.CHAT_SPAM);
|
log(null, player, CheckType.CHAT_SPAM);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
AntiCheat.getManager().addEvent(event.getEventName(), event.getHandlers().getRegisteredListeners());
|
if (getCheckManager().willCheck(player, CheckType.CHAT_UNICODE)) {
|
||||||
|
CheckResult result = getBackend().checkChatUnicode(player, event.getMessage());
|
||||||
|
if (result.failed()) {
|
||||||
|
event.setCancelled(true);
|
||||||
|
player.sendMessage(ChatColor.RED + result.getMessage());
|
||||||
|
AntiCheatReloaded.sendToMainThread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
log(null, player, CheckType.CHAT_UNICODE);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
AntiCheatReloaded.getManager().addEvent(event.getEventName(), event.getHandlers().getRegisteredListeners());
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onPlayerKick(PlayerKickEvent event) {
|
public void onPlayerKick(PlayerKickEvent event) {
|
||||||
getBackend().garbageClean(event.getPlayer());
|
getBackend().garbageClean(event.getPlayer());
|
||||||
|
|
||||||
AntiCheat.getManager().addEvent(event.getEventName(), event.getHandlers().getRegisteredListeners());
|
AntiCheatReloaded.getManager().addEvent(event.getEventName(), event.getHandlers().getRegisteredListeners());
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
@@ -197,7 +216,7 @@ public class PlayerListener extends EventListener {
|
|||||||
|
|
||||||
getConfig().getLevels().saveLevelFromUser(user);
|
getConfig().getLevels().saveLevelFromUser(user);
|
||||||
|
|
||||||
AntiCheat.getManager().addEvent(event.getEventName(), event.getHandlers().getRegisteredListeners());
|
AntiCheatReloaded.getManager().addEvent(event.getEventName(), event.getHandlers().getRegisteredListeners());
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
@@ -216,7 +235,7 @@ public class PlayerListener extends EventListener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
AntiCheat.getManager().addEvent(event.getEventName(), event.getHandlers().getRegisteredListeners());
|
AntiCheatReloaded.getManager().addEvent(event.getEventName(), event.getHandlers().getRegisteredListeners());
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
@@ -224,10 +243,9 @@ public class PlayerListener extends EventListener {
|
|||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
PlayerInventory inv = player.getInventory();
|
PlayerInventory inv = player.getInventory();
|
||||||
if (event.getAction() == Action.RIGHT_CLICK_AIR || event.getAction() == Action.RIGHT_CLICK_BLOCK) {
|
if (event.getAction() == Action.RIGHT_CLICK_AIR || event.getAction() == Action.RIGHT_CLICK_BLOCK) {
|
||||||
Material m = inv.getItemInHand().getType();
|
if (inv.getItemInMainHand().getType() == Material.BOW) {
|
||||||
if (m == Material.BOW) {
|
|
||||||
getBackend().logBowWindUp(player);
|
getBackend().logBowWindUp(player);
|
||||||
} else if (Utilities.isFood(m)) {
|
} else if (Utilities.isFood(inv.getItemInMainHand().getType()) || Utilities.isFood(inv.getItemInOffHand().getType())) {
|
||||||
getBackend().logEatingStart(player);
|
getBackend().logEatingStart(player);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -238,7 +256,7 @@ public class PlayerListener extends EventListener {
|
|||||||
getBackend().checkLongReachBlock(player, distance.getXDifference(), distance.getYDifference(), distance.getZDifference());
|
getBackend().checkLongReachBlock(player, distance.getXDifference(), distance.getYDifference(), distance.getZDifference());
|
||||||
}
|
}
|
||||||
|
|
||||||
AntiCheat.getManager().addEvent(event.getEventName(), event.getHandlers().getRegisteredListeners());
|
AntiCheatReloaded.getManager().addEvent(event.getEventName(), event.getHandlers().getRegisteredListeners());
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(ignoreCancelled = true)
|
@EventHandler(ignoreCancelled = true)
|
||||||
@@ -252,28 +270,28 @@ public class PlayerListener extends EventListener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
AntiCheat.getManager().addEvent(event.getEventName(), event.getHandlers().getRegisteredListeners());
|
AntiCheatReloaded.getManager().addEvent(event.getEventName(), event.getHandlers().getRegisteredListeners());
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(ignoreCancelled = true)
|
@EventHandler(ignoreCancelled = true)
|
||||||
public void onPlayerEnterBed(PlayerBedEnterEvent event) {
|
public void onPlayerEnterBed(PlayerBedEnterEvent event) {
|
||||||
if (event.getBed().getType() != Material.BED) return;
|
if (event.getBed().getType().name().endsWith("BED")) return;
|
||||||
getBackend().logEnterExit(event.getPlayer());
|
getBackend().logEnterExit(event.getPlayer());
|
||||||
|
|
||||||
AntiCheat.getManager().addEvent(event.getEventName(), event.getHandlers().getRegisteredListeners());
|
AntiCheatReloaded.getManager().addEvent(event.getEventName(), event.getHandlers().getRegisteredListeners());
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(ignoreCancelled = true)
|
@EventHandler(ignoreCancelled = true)
|
||||||
public void onPlayerExitBed(PlayerBedLeaveEvent event) {
|
public void onPlayerExitBed(PlayerBedLeaveEvent event) {
|
||||||
if (event.getBed().getType() != Material.BED) return;
|
if (event.getBed().getType().name().endsWith("BED")) return;
|
||||||
getBackend().logEnterExit(event.getPlayer());
|
getBackend().logEnterExit(event.getPlayer());
|
||||||
|
|
||||||
AntiCheat.getManager().addEvent(event.getEventName(), event.getHandlers().getRegisteredListeners());
|
AntiCheatReloaded.getManager().addEvent(event.getEventName(), event.getHandlers().getRegisteredListeners());
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onPlayerAnimation(PlayerAnimationEvent event) {
|
public void onPlayerAnimation(PlayerAnimationEvent event) {
|
||||||
AntiCheat.getManager().addEvent(event.getEventName(), event.getHandlers().getRegisteredListeners());
|
AntiCheatReloaded.getManager().addEvent(event.getEventName(), event.getHandlers().getRegisteredListeners());
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
@@ -300,12 +318,12 @@ public class PlayerListener extends EventListener {
|
|||||||
if (player.hasMetadata(Utilities.SPY_METADATA)) {
|
if (player.hasMetadata(Utilities.SPY_METADATA)) {
|
||||||
for (Player p : player.getServer().getOnlinePlayers()) {
|
for (Player p : player.getServer().getOnlinePlayers()) {
|
||||||
if (!Permission.SYSTEM_SPY.get(p)) {
|
if (!Permission.SYSTEM_SPY.get(p)) {
|
||||||
p.hidePlayer(player);
|
p.hidePlayer(AntiCheatReloaded.getPlugin(), player);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
AntiCheat.getManager().addEvent(event.getEventName(), event.getHandlers().getRegisteredListeners());
|
AntiCheatReloaded.getManager().addEvent(event.getEventName(), event.getHandlers().getRegisteredListeners());
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
|
||||||
@@ -322,7 +340,8 @@ public class PlayerListener extends EventListener {
|
|||||||
final User user = getUserManager().getUser(player.getUniqueId());
|
final User user = getUserManager().getUser(player.getUniqueId());
|
||||||
user.setTo(to.getX(), to.getY(), to.getZ());
|
user.setTo(to.getX(), to.getY(), to.getZ());
|
||||||
|
|
||||||
KillAuraCheck.doMove(event);
|
//KillAuraCheck.doMove(event);
|
||||||
|
//TODO
|
||||||
|
|
||||||
if (getCheckManager().willCheckQuick(player, CheckType.SPRINT)) {
|
if (getCheckManager().willCheckQuick(player, CheckType.SPRINT)) {
|
||||||
CheckResult result = getBackend().checkSprintStill(player, from, to);
|
CheckResult result = getBackend().checkSprintStill(player, from, to);
|
||||||
@@ -331,26 +350,26 @@ public class PlayerListener extends EventListener {
|
|||||||
log(result.getMessage(), player, CheckType.SPRINT);
|
log(result.getMessage(), player, CheckType.SPRINT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (getCheckManager().willCheckQuick(player, CheckType.FLY) && !VersionUtil.isFlying(player)) {
|
if (getCheckManager().willCheckQuick(player, CheckType.FLIGHT) && !VersionUtil.isFlying(player)) {
|
||||||
CheckResult result = FlightCheck.runCheck(player, distance);
|
CheckResult result = FlightCheck.runCheck(player, distance);
|
||||||
if (result.failed()) {
|
if (result.failed()) {
|
||||||
if (!silentMode()) {
|
if (!silentMode()) {
|
||||||
event.setTo(user.getGoodLocation(from.clone()));
|
event.setTo(user.getGoodLocation(from.clone()));
|
||||||
}
|
}
|
||||||
log(result.getMessage(), player, CheckType.FLY);
|
log(result.getMessage(), player, CheckType.FLIGHT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (getCheckManager().willCheckQuick(player, CheckType.FLY) && !VersionUtil.isFlying(player)) {
|
if (getCheckManager().willCheckQuick(player, CheckType.FLIGHT) && !VersionUtil.isFlying(player)) {
|
||||||
CheckResult result = GlideCheck.runCheck(player, distance);
|
CheckResult result = GlideCheck.runCheck(player, distance);
|
||||||
if (result.failed()) {
|
if (result.failed()) {
|
||||||
// NO TELEPORT NEEDED HERE, HANDLED BY CHECK ITSELF
|
// NO TELEPORT NEEDED HERE, HANDLED BY CHECK ITSELF
|
||||||
log(result.getMessage(), player, CheckType.FLY);
|
log(result.getMessage(), player, CheckType.FLIGHT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (getCheckManager().willCheckQuick(player, CheckType.FLY)) {
|
if (getCheckManager().willCheckQuick(player, CheckType.ELYTRA)) {
|
||||||
CheckResult result = ElytraFly.runCheck(player, distance);
|
CheckResult result = ElytraCheck.runCheck(player, distance);
|
||||||
if (result.failed()) {
|
if (result.failed()) {
|
||||||
log(result.getMessage(), player, CheckType.FLY);
|
log(result.getMessage(), player, CheckType.ELYTRA);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (getCheckManager().willCheckQuick(player, CheckType.VCLIP) && event.getFrom().getY() > event.getTo().getY()) {
|
if (getCheckManager().willCheckQuick(player, CheckType.VCLIP) && event.getFrom().getY() > event.getTo().getY()) {
|
||||||
@@ -369,7 +388,7 @@ public class PlayerListener extends EventListener {
|
|||||||
log(result.getMessage(), player, CheckType.VCLIP);
|
log(result.getMessage(), player, CheckType.VCLIP);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (getCheckManager().willCheckQuick(player, CheckType.NOFALL) && getCheckManager().willCheck(player, CheckType.FLY) && !Utilities.isClimbableBlock(player.getLocation().getBlock()) && event.getFrom().getY() > event.getTo().getY()) {
|
if (getCheckManager().willCheckQuick(player, CheckType.NOFALL) && getCheckManager().willCheck(player, CheckType.FLIGHT) && !Utilities.isClimbableBlock(player.getLocation().getBlock()) && event.getFrom().getY() > event.getTo().getY()) {
|
||||||
CheckResult result = getBackend().checkNoFall(player, y);
|
CheckResult result = getBackend().checkNoFall(player, y);
|
||||||
if (result.failed()) {
|
if (result.failed()) {
|
||||||
if (!silentMode()) {
|
if (!silentMode()) {
|
||||||
@@ -384,7 +403,7 @@ public class PlayerListener extends EventListener {
|
|||||||
if (event.getTo() != event.getFrom()) {
|
if (event.getTo() != event.getFrom()) {
|
||||||
double x = distance.getXDifference();
|
double x = distance.getXDifference();
|
||||||
double z = distance.getZDifference();
|
double z = distance.getZDifference();
|
||||||
if (getCheckManager().willCheckQuick(player, CheckType.SPEED) && getCheckManager().willCheck(player, CheckType.FLY)) {
|
if (getCheckManager().willCheckQuick(player, CheckType.SPEED) && getCheckManager().willCheck(player, CheckType.FLIGHT)) {
|
||||||
if (event.getFrom().getY() < event.getTo().getY()) {
|
if (event.getFrom().getY() < event.getTo().getY()) {
|
||||||
CheckResult result = getBackend().checkYSpeed(player, y);
|
CheckResult result = getBackend().checkYSpeed(player, y);
|
||||||
if (result.failed()) {
|
if (result.failed()) {
|
||||||
@@ -440,12 +459,13 @@ public class PlayerListener extends EventListener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
AntiCheat.getManager().addEvent(event.getEventName(), event.getHandlers().getRegisteredListeners());
|
AntiCheatReloaded.getManager().addEvent(event.getEventName(), event.getHandlers().getRegisteredListeners());
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority=EventPriority.HIGHEST)
|
@EventHandler(priority=EventPriority.HIGHEST)
|
||||||
public void onDeath(PlayerDeathEvent e) {
|
public void onDeath(PlayerDeathEvent e) {
|
||||||
KillAuraCheck.cleanPlayer(e.getEntity()); // Remove bots on death to reduce lag
|
//KillAuraCheck.cleanPlayer(e.getEntity()); // Remove bots on death to reduce lag
|
||||||
|
//TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||||
@@ -461,7 +481,7 @@ public class PlayerListener extends EventListener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getCheckManager().willCheck(player, CheckType.FLY) && !player.isFlying()) {
|
if (getCheckManager().willCheck(player, CheckType.FLIGHT) && !player.isFlying()) {
|
||||||
CheckResult result1 = YAxisCheck.runCheck(player, new Distance(from, to));
|
CheckResult result1 = YAxisCheck.runCheck(player, new Distance(from, to));
|
||||||
CheckResult result2 = getBackend().checkAscension(player, from.getY(), to.getY());
|
CheckResult result2 = getBackend().checkAscension(player, from.getY(), to.getY());
|
||||||
String log = result1.failed() ? result1.getMessage() : result2.failed() ? result2.getMessage() : "";
|
String log = result1.failed() ? result1.getMessage() : result2.failed() ? result2.getMessage() : "";
|
||||||
@@ -469,7 +489,7 @@ public class PlayerListener extends EventListener {
|
|||||||
if (!silentMode()) {
|
if (!silentMode()) {
|
||||||
event.setTo(user.getGoodLocation(from.clone()));
|
event.setTo(user.getGoodLocation(from.clone()));
|
||||||
}
|
}
|
||||||
log(log, player, CheckType.FLY);
|
log(log, player, CheckType.FLIGHT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* AntiCheat for Bukkit.
|
* AntiCheatReloaded for Bukkit and Spigot.
|
||||||
* Copyright (C) 2012-2014 AntiCheat Team | http://gravitydevelopment.net
|
* Copyright (c) 2012-2015 AntiCheat Team
|
||||||
|
* Copyright (c) 2016-2020 Rammelkast
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -18,13 +19,14 @@
|
|||||||
|
|
||||||
package com.rammelkast.anticheatreloaded.event;
|
package com.rammelkast.anticheatreloaded.event;
|
||||||
|
|
||||||
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.vehicle.VehicleDestroyEvent;
|
import org.bukkit.event.vehicle.VehicleDestroyEvent;
|
||||||
import org.bukkit.event.vehicle.VehicleEnterEvent;
|
import org.bukkit.event.vehicle.VehicleEnterEvent;
|
||||||
import org.bukkit.event.vehicle.VehicleExitEvent;
|
import org.bukkit.event.vehicle.VehicleExitEvent;
|
||||||
|
|
||||||
import com.rammelkast.anticheatreloaded.AntiCheat;
|
import com.rammelkast.anticheatreloaded.AntiCheatReloaded;
|
||||||
|
|
||||||
public class VehicleListener extends EventListener {
|
public class VehicleListener extends EventListener {
|
||||||
|
|
||||||
@@ -34,7 +36,7 @@ public class VehicleListener extends EventListener {
|
|||||||
getBackend().logEnterExit((Player) event.getEntered());
|
getBackend().logEnterExit((Player) event.getEntered());
|
||||||
}
|
}
|
||||||
|
|
||||||
AntiCheat.getManager().addEvent(event.getEventName(), event.getHandlers().getRegisteredListeners());
|
AntiCheatReloaded.getManager().addEvent(event.getEventName(), event.getHandlers().getRegisteredListeners());
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(ignoreCancelled = true)
|
@EventHandler(ignoreCancelled = true)
|
||||||
@@ -43,16 +45,26 @@ public class VehicleListener extends EventListener {
|
|||||||
getBackend().logEnterExit((Player) event.getExited());
|
getBackend().logEnterExit((Player) event.getExited());
|
||||||
}
|
}
|
||||||
|
|
||||||
AntiCheat.getManager().addEvent(event.getEventName(), event.getHandlers().getRegisteredListeners());
|
AntiCheatReloaded.getManager().addEvent(event.getEventName(), event.getHandlers().getRegisteredListeners());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@EventHandler(ignoreCancelled = true)
|
@EventHandler(ignoreCancelled = true)
|
||||||
public void onVehicleDestroy(VehicleDestroyEvent event) {
|
public void onVehicleDestroy(VehicleDestroyEvent event) {
|
||||||
if (event.getVehicle().getPassenger() != null && event.getVehicle().getPassenger() instanceof Player) {
|
// TODO fix deprecations
|
||||||
getBackend().logEnterExit((Player) event.getVehicle().getPassenger());
|
//if (event.getVehicle().getPassenger() != null && event.getVehicle().getPassenger() instanceof Player) {
|
||||||
|
// getBackend().logEnterExit((Player) event.getVehicle().getPassenger());
|
||||||
|
//}
|
||||||
|
|
||||||
|
// TODO this should work, untested though.
|
||||||
|
if (!event.getVehicle().getPassengers().isEmpty()) {
|
||||||
|
for (Entity entity: event.getVehicle().getPassengers()) {
|
||||||
|
if (entity instanceof Player) {
|
||||||
|
getBackend().logEnterExit((Player) entity);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
AntiCheat.getManager().addEvent(event.getEventName(), event.getHandlers().getRegisteredListeners());
|
AntiCheatReloaded.getManager().addEvent(event.getEventName(), event.getHandlers().getRegisteredListeners());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* AntiCheat for Bukkit.
|
* AntiCheatReloaded for Bukkit and Spigot.
|
||||||
* Copyright (C) 2012-2014 AntiCheat Team | http://gravitydevelopment.net
|
* Copyright (c) 2012-2015 AntiCheat Team
|
||||||
|
* Copyright (c) 2016-2020 Rammelkast
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -25,7 +26,7 @@ import java.util.logging.Logger;
|
|||||||
|
|
||||||
import org.bukkit.plugin.RegisteredListener;
|
import org.bukkit.plugin.RegisteredListener;
|
||||||
|
|
||||||
import com.rammelkast.anticheatreloaded.AntiCheat;
|
import com.rammelkast.anticheatreloaded.AntiCheatReloaded;
|
||||||
import com.rammelkast.anticheatreloaded.check.Backend;
|
import com.rammelkast.anticheatreloaded.check.Backend;
|
||||||
import com.rammelkast.anticheatreloaded.config.Configuration;
|
import com.rammelkast.anticheatreloaded.config.Configuration;
|
||||||
|
|
||||||
@@ -34,7 +35,7 @@ import com.rammelkast.anticheatreloaded.config.Configuration;
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
public class AntiCheatManager {
|
public class AntiCheatManager {
|
||||||
private static AntiCheat plugin = null;
|
private static AntiCheatReloaded plugin = null;
|
||||||
private static Configuration configuration;
|
private static Configuration configuration;
|
||||||
private static UserManager userManager = null;
|
private static UserManager userManager = null;
|
||||||
private static CheckManager checkManager = null;
|
private static CheckManager checkManager = null;
|
||||||
@@ -43,7 +44,7 @@ public class AntiCheatManager {
|
|||||||
private static Map<String, RegisteredListener[]> eventchains = new ConcurrentHashMap<String, RegisteredListener[]>();
|
private static Map<String, RegisteredListener[]> eventchains = new ConcurrentHashMap<String, RegisteredListener[]>();
|
||||||
private static Map<String, Long> eventcache = new ConcurrentHashMap<String, Long>();
|
private static Map<String, Long> eventcache = new ConcurrentHashMap<String, Long>();
|
||||||
|
|
||||||
public AntiCheatManager(AntiCheat instance, Logger logger) {
|
public AntiCheatManager(AntiCheatReloaded instance, Logger logger) {
|
||||||
plugin = instance;
|
plugin = instance;
|
||||||
configuration = new Configuration(plugin, this);
|
configuration = new Configuration(plugin, this);
|
||||||
loggingManager = new LoggingManager(plugin, logger, configuration);
|
loggingManager = new LoggingManager(plugin, logger, configuration);
|
||||||
@@ -104,7 +105,7 @@ public class AntiCheatManager {
|
|||||||
return gen;
|
return gen;
|
||||||
}
|
}
|
||||||
|
|
||||||
public AntiCheat getPlugin() {
|
public AntiCheatReloaded getPlugin() {
|
||||||
return plugin;
|
return plugin;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* AntiCheat for Bukkit.
|
* AntiCheatReloaded for Bukkit and Spigot.
|
||||||
* Copyright (C) 2012-2014 AntiCheat Team | http://gravitydevelopment.net
|
* Copyright (c) 2012-2015 AntiCheat Team
|
||||||
|
* Copyright (c) 2016-2020 Rammelkast
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -21,9 +22,10 @@ package com.rammelkast.anticheatreloaded.manage;
|
|||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.rammelkast.anticheatreloaded.AntiCheat;
|
import com.rammelkast.anticheatreloaded.AntiCheatReloaded;
|
||||||
import com.rammelkast.anticheatreloaded.check.CheckType;
|
import com.rammelkast.anticheatreloaded.check.CheckType;
|
||||||
import com.rammelkast.anticheatreloaded.config.Configuration;
|
import com.rammelkast.anticheatreloaded.config.Configuration;
|
||||||
|
import com.rammelkast.anticheatreloaded.util.VersionUtil;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@@ -175,9 +177,8 @@ public class CheckManager {
|
|||||||
&& !isExempt(player, type)
|
&& !isExempt(player, type)
|
||||||
&& !type.checkPermission(player)
|
&& !type.checkPermission(player)
|
||||||
&& !isOpExempt(player);
|
&& !isOpExempt(player);
|
||||||
AntiCheat.debugLog("Check " + type + (check ? " run " : " not run ") + "on " + player.getName());
|
AntiCheatReloaded.debugLog("Check " + type + (check ? " run " : " not run ") + "on " + player.getName());
|
||||||
// TODO temp fix
|
if ((type == CheckType.FLIGHT || type == CheckType.SPEED) && VersionUtil.isFlying(player))
|
||||||
if ((type == CheckType.FLY || type == CheckType.SPEED) && player.isFlying())
|
|
||||||
return false;
|
return false;
|
||||||
return check;
|
return check;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* AntiCheat for Bukkit.
|
* AntiCheatReloaded for Bukkit and Spigot.
|
||||||
* Copyright (C) 2012-2014 AntiCheat Team | http://gravitydevelopment.net
|
* Copyright (c) 2012-2015 AntiCheat Team
|
||||||
|
* Copyright (c) 2016-2020 Rammelkast
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -22,7 +23,7 @@ import org.bukkit.Bukkit;
|
|||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.rammelkast.anticheatreloaded.AntiCheat;
|
import com.rammelkast.anticheatreloaded.AntiCheatReloaded;
|
||||||
import com.rammelkast.anticheatreloaded.config.Configuration;
|
import com.rammelkast.anticheatreloaded.config.Configuration;
|
||||||
import com.rammelkast.anticheatreloaded.util.FileFormatter;
|
import com.rammelkast.anticheatreloaded.util.FileFormatter;
|
||||||
import com.rammelkast.anticheatreloaded.util.Permission;
|
import com.rammelkast.anticheatreloaded.util.Permission;
|
||||||
@@ -42,8 +43,8 @@ public class LoggingManager {
|
|||||||
private static List<String> logs = new CopyOnWriteArrayList<String>();
|
private static List<String> logs = new CopyOnWriteArrayList<String>();
|
||||||
private final Configuration config;
|
private final Configuration config;
|
||||||
|
|
||||||
public LoggingManager(AntiCheat plugin, Logger logger, Configuration config) {
|
public LoggingManager(AntiCheatReloaded plugin, Logger logger, Configuration config) {
|
||||||
this.fileLogger = Logger.getLogger("net.gravitydevelopment.anticheat.AntiCheat");
|
this.fileLogger = Logger.getLogger("com.rammelkast.anticheatreloaded.AntiCheatReloaded");
|
||||||
this.config = config;
|
this.config = config;
|
||||||
try {
|
try {
|
||||||
File file = new File(plugin.getDataFolder(), "log");
|
File file = new File(plugin.getDataFolder(), "log");
|
||||||
@@ -70,12 +71,12 @@ public class LoggingManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void debugLog(String message) {
|
public void debugLog(String message) {
|
||||||
Bukkit.getConsoleSender().sendMessage("[AntiCheat] " + ChatColor.GRAY + message);
|
Bukkit.getConsoleSender().sendMessage("[ACR] " + ChatColor.GRAY + message);
|
||||||
logToLogs(message);
|
logToLogs(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void logToConsole(String message) {
|
public void logToConsole(String message) {
|
||||||
Bukkit.getConsoleSender().sendMessage("[AntiCheat] " + ChatColor.RED + message);
|
Bukkit.getConsoleSender().sendMessage("[ACR] " + ChatColor.RED + message);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void logToFile(String message) {
|
public void logToFile(String message) {
|
||||||
|
|||||||
@@ -1,37 +0,0 @@
|
|||||||
package com.rammelkast.anticheatreloaded.manage;
|
|
||||||
|
|
||||||
import com.comphenix.protocol.Packets;
|
|
||||||
import com.comphenix.protocol.ProtocolManager;
|
|
||||||
import com.comphenix.protocol.events.*;
|
|
||||||
import com.rammelkast.anticheatreloaded.AntiCheat;
|
|
||||||
|
|
||||||
public class PacketManager {
|
|
||||||
|
|
||||||
private ProtocolManager protocolManager;
|
|
||||||
private AntiCheat plugin;
|
|
||||||
private AntiCheatManager manager;
|
|
||||||
|
|
||||||
public PacketManager(ProtocolManager protocolManager, AntiCheat plugin, AntiCheatManager manager) {
|
|
||||||
this.protocolManager = protocolManager;
|
|
||||||
this.plugin = plugin;
|
|
||||||
this.manager = manager;
|
|
||||||
addListeners();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void addListeners() {
|
|
||||||
// Arm Animation
|
|
||||||
protocolManager.addPacketListener(new PacketAdapter(plugin,
|
|
||||||
ConnectionSide.CLIENT_SIDE,
|
|
||||||
ListenerPriority.NORMAL,
|
|
||||||
Packets.Client.ARM_ANIMATION) {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onPacketReceiving(PacketEvent event) {
|
|
||||||
if (event.getPacketID() == Packets.Client.ARM_ANIMATION) {
|
|
||||||
PacketContainer packet = event.getPacket();
|
|
||||||
//System.out.println("Arm animation from "+packet.getIntegers().read(0));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* AntiCheat for Bukkit.
|
* AntiCheatReloaded for Bukkit and Spigot.
|
||||||
* Copyright (C) 2012-2014 AntiCheat Team | http://gravitydevelopment.net
|
* Copyright (c) 2012-2015 AntiCheat Team
|
||||||
|
* Copyright (c) 2016-2020 Rammelkast
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -18,20 +19,21 @@
|
|||||||
|
|
||||||
package com.rammelkast.anticheatreloaded.manage;
|
package com.rammelkast.anticheatreloaded.manage;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
import org.bukkit.BanList.Type;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
|
|
||||||
import com.rammelkast.anticheatreloaded.AntiCheat;
|
import com.rammelkast.anticheatreloaded.AntiCheatReloaded;
|
||||||
import com.rammelkast.anticheatreloaded.check.CheckType;
|
import com.rammelkast.anticheatreloaded.check.CheckType;
|
||||||
import com.rammelkast.anticheatreloaded.config.Configuration;
|
import com.rammelkast.anticheatreloaded.config.Configuration;
|
||||||
import com.rammelkast.anticheatreloaded.util.Group;
|
import com.rammelkast.anticheatreloaded.util.Group;
|
||||||
import com.rammelkast.anticheatreloaded.util.User;
|
import com.rammelkast.anticheatreloaded.util.User;
|
||||||
import com.rammelkast.anticheatreloaded.util.Utilities;
|
import com.rammelkast.anticheatreloaded.util.Utilities;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
public class UserManager {
|
public class UserManager {
|
||||||
private List<User> users = new ArrayList<User>();
|
private List<User> users = new ArrayList<User>();
|
||||||
private static AntiCheatManager manager;
|
private static AntiCheatManager manager;
|
||||||
@@ -216,9 +218,12 @@ public class UserManager {
|
|||||||
*/
|
*/
|
||||||
public void execute(final User user, final List<String> actions, final CheckType type, final String kickReason, final List<String> warning, final String banReason) {
|
public void execute(final User user, final List<String> actions, final CheckType type, final String kickReason, final List<String> warning, final String banReason) {
|
||||||
// Execute synchronously for thread safety when called from AsyncPlayerChatEvent
|
// Execute synchronously for thread safety when called from AsyncPlayerChatEvent
|
||||||
Bukkit.getScheduler().scheduleSyncDelayedTask(AntiCheat.getPlugin(), new Runnable() {
|
Bukkit.getScheduler().scheduleSyncDelayedTask(AntiCheatReloaded.getPlugin(), new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
if (user.getPlayer() == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
final String name = user.getName();
|
final String name = user.getName();
|
||||||
for (String event : actions) {
|
for (String event : actions) {
|
||||||
event = event.replaceAll("&player", name).replaceAll("&world", user.getPlayer().getWorld().getName()).replaceAll("&check", type.name());
|
event = event.replaceAll("&player", name).replaceAll("&world", user.getPlayer().getWorld().getName()).replaceAll("&check", type.name());
|
||||||
@@ -229,7 +234,7 @@ public class UserManager {
|
|||||||
}
|
}
|
||||||
} else if (event.equalsIgnoreCase("KICK")) {
|
} else if (event.equalsIgnoreCase("KICK")) {
|
||||||
user.getPlayer().kickPlayer(RED + kickReason);
|
user.getPlayer().kickPlayer(RED + kickReason);
|
||||||
AntiCheat.getPlugin().onPlayerKicked();
|
AntiCheatReloaded.getPlugin().onPlayerKicked();
|
||||||
String msg = RED + config.getLang().KICK_BROADCAST().replaceAll("&player", name) + " (" + CheckType.getName(type) + ")";
|
String msg = RED + config.getLang().KICK_BROADCAST().replaceAll("&player", name) + " (" + CheckType.getName(type) + ")";
|
||||||
if (!msg.equals("")) {
|
if (!msg.equals("")) {
|
||||||
manager.log(msg);
|
manager.log(msg);
|
||||||
@@ -243,7 +248,7 @@ public class UserManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (event.equalsIgnoreCase("BAN")) {
|
} else if (event.equalsIgnoreCase("BAN")) {
|
||||||
user.getPlayer().setBanned(true);
|
Bukkit.getBanList(Type.NAME).addBan(user.getPlayer().getName(), RED + banReason, null, null);
|
||||||
user.getPlayer().kickPlayer(RED + banReason);
|
user.getPlayer().kickPlayer(RED + banReason);
|
||||||
String msg = RED + config.getLang().BAN_BROADCAST().replaceAll("&player", name) + " (" + CheckType.getName(type) + ")";
|
String msg = RED + config.getLang().BAN_BROADCAST().replaceAll("&player", name) + " (" + CheckType.getName(type) + ")";
|
||||||
if (!msg.equals("")) {
|
if (!msg.equals("")) {
|
||||||
|
|||||||
@@ -1,3 +1,22 @@
|
|||||||
|
/*
|
||||||
|
* AntiCheatReloaded for Bukkit and Spigot.
|
||||||
|
* Copyright (c) 2012-2015 AntiCheat Team
|
||||||
|
* Copyright (c) 2016-2020 Rammelkast
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
package com.rammelkast.anticheatreloaded.metrics;
|
package com.rammelkast.anticheatreloaded.metrics;
|
||||||
|
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
@@ -75,14 +94,15 @@ public class Metrics {
|
|||||||
|
|
||||||
// Inform the server owners about bStats
|
// Inform the server owners about bStats
|
||||||
config.options().header(
|
config.options().header(
|
||||||
"bStats collects some data for plugin authors like how many servers are using their plugins.\n" +
|
"bStats collects some data for plugin authors like how many servers are using their plugins.\n"
|
||||||
"To honor their work, you should not disable it.\n" +
|
+ "To honor their work, you should not disable it.\n"
|
||||||
"This has nearly no effect on the server performance!\n" +
|
+ "This has nearly no effect on the server performance!\n"
|
||||||
"Check out https://bStats.org/ to learn more :)"
|
+ "Check out https://bStats.org/ to learn more :)")
|
||||||
).copyDefaults(true);
|
.copyDefaults(true);
|
||||||
try {
|
try {
|
||||||
config.save(configFile);
|
config.save(configFile);
|
||||||
} catch (IOException ignored) { }
|
} catch (IOException ignored) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load the data
|
// Load the data
|
||||||
@@ -96,7 +116,8 @@ public class Metrics {
|
|||||||
service.getField("B_STATS_VERSION"); // Our identifier :)
|
service.getField("B_STATS_VERSION"); // Our identifier :)
|
||||||
found = true; // We aren't the first
|
found = true; // We aren't the first
|
||||||
break;
|
break;
|
||||||
} catch (NoSuchFieldException ignored) { }
|
} catch (NoSuchFieldException ignored) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// Register our service
|
// Register our service
|
||||||
Bukkit.getServicesManager().register(Metrics.class, this, plugin, ServicePriority.Normal);
|
Bukkit.getServicesManager().register(Metrics.class, this, plugin, ServicePriority.Normal);
|
||||||
@@ -131,8 +152,10 @@ public class Metrics {
|
|||||||
timer.cancel();
|
timer.cancel();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Nevertheless we want our code to run in the Bukkit main thread, so we have to use the Bukkit scheduler
|
// Nevertheless we want our code to run in the Bukkit main thread, so we have to
|
||||||
// Don't be afraid! The connection to the bStats server is still async, only the stats collection is sync ;)
|
// use the Bukkit scheduler
|
||||||
|
// Don't be afraid! The connection to the bStats server is still async, only the
|
||||||
|
// stats collection is sync ;)
|
||||||
Bukkit.getScheduler().runTask(plugin, new Runnable() {
|
Bukkit.getScheduler().runTask(plugin, new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
@@ -140,15 +163,16 @@ public class Metrics {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}, 1000*60*5, 1000*60*30);
|
}, 1000 * 60 * 5, 1000 * 60 * 30);
|
||||||
// Submit the data every 30 minutes, first time after 5 minutes to give other plugins enough time to start
|
// Submit the data every 30 minutes, first time after 5 minutes to give other
|
||||||
// WARNING: Changing the frequency has no effect but your plugin WILL be blocked/deleted!
|
// plugins enough time to start
|
||||||
|
// WARNING: Changing the frequency has no effect but your plugin WILL be
|
||||||
|
// blocked/deleted!
|
||||||
// WARNING: Just don't do it!
|
// WARNING: Just don't do it!
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the plugin specific data.
|
* Gets the plugin specific data. This method is called using Reflection.
|
||||||
* This method is called using Reflection.
|
|
||||||
*
|
*
|
||||||
* @return The plugin specific data.
|
* @return The plugin specific data.
|
||||||
*/
|
*/
|
||||||
@@ -227,7 +251,8 @@ public class Metrics {
|
|||||||
// Found one!
|
// Found one!
|
||||||
try {
|
try {
|
||||||
pluginData.add(service.getMethod("getPluginData").invoke(Bukkit.getServicesManager().load(service)));
|
pluginData.add(service.getMethod("getPluginData").invoke(Bukkit.getServicesManager().load(service)));
|
||||||
} catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ignored) { }
|
} catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ignored) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
data.put("plugins", pluginData);
|
data.put("plugins", pluginData);
|
||||||
@@ -242,7 +267,8 @@ public class Metrics {
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// Something went wrong! :(
|
// Something went wrong! :(
|
||||||
if (logFailedRequests) {
|
if (logFailedRequests) {
|
||||||
plugin.getLogger().log(Level.WARNING, "Could not submit plugin stats of " + plugin.getName(), e);
|
plugin.getLogger().log(Level.WARNING, "Could not submit plugin stats of " + plugin.getName(),
|
||||||
|
e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -399,8 +425,8 @@ public class Metrics {
|
|||||||
/**
|
/**
|
||||||
* Gets the values of the pie.
|
* Gets the values of the pie.
|
||||||
*
|
*
|
||||||
* @param valueMap Just an empty map. The only reason it exists is to make your life easier.
|
* @param valueMap Just an empty map. The only reason it exists is to make your
|
||||||
* You don't have to create a map yourself!
|
* life easier. You don't have to create a map yourself!
|
||||||
* @return The values of the pie.
|
* @return The values of the pie.
|
||||||
*/
|
*/
|
||||||
public abstract HashMap<String, Integer> getValues(HashMap<String, Integer> valueMap);
|
public abstract HashMap<String, Integer> getValues(HashMap<String, Integer> valueMap);
|
||||||
@@ -483,8 +509,8 @@ public class Metrics {
|
|||||||
/**
|
/**
|
||||||
* Gets the values of the chart.
|
* Gets the values of the chart.
|
||||||
*
|
*
|
||||||
* @param valueMap Just an empty map. The only reason it exists is to make your life easier.
|
* @param valueMap Just an empty map. The only reason it exists is to make your
|
||||||
* You don't have to create a map yourself!
|
* life easier. You don't have to create a map yourself!
|
||||||
* @return The values of the chart.
|
* @return The values of the chart.
|
||||||
*/
|
*/
|
||||||
public abstract HashMap<String, Integer> getValues(HashMap<String, Integer> valueMap);
|
public abstract HashMap<String, Integer> getValues(HashMap<String, Integer> valueMap);
|
||||||
@@ -533,8 +559,8 @@ public class Metrics {
|
|||||||
/**
|
/**
|
||||||
* Gets the value of the chart.
|
* Gets the value of the chart.
|
||||||
*
|
*
|
||||||
* @param valueMap Just an empty map. The only reason it exists is to make your life easier.
|
* @param valueMap Just an empty map. The only reason it exists is to make your
|
||||||
* You don't have to create a map yourself!
|
* life easier. You don't have to create a map yourself!
|
||||||
* @return The value of the chart.
|
* @return The value of the chart.
|
||||||
*/
|
*/
|
||||||
public abstract HashMap<String, Integer> getValues(HashMap<String, Integer> valueMap);
|
public abstract HashMap<String, Integer> getValues(HashMap<String, Integer> valueMap);
|
||||||
@@ -576,8 +602,8 @@ public class Metrics {
|
|||||||
/**
|
/**
|
||||||
* Gets the value of the chart.
|
* Gets the value of the chart.
|
||||||
*
|
*
|
||||||
* @param valueMap Just an empty map. The only reason it exists is to make your life easier.
|
* @param valueMap Just an empty map. The only reason it exists is to make your
|
||||||
* You don't have to create a map yourself!
|
* life easier. You don't have to create a map yourself!
|
||||||
* @return The value of the chart.
|
* @return The value of the chart.
|
||||||
*/
|
*/
|
||||||
public abstract HashMap<String, int[]> getValues(HashMap<String, int[]> valueMap);
|
public abstract HashMap<String, int[]> getValues(HashMap<String, int[]> valueMap);
|
||||||
@@ -666,8 +692,8 @@ public class Metrics {
|
|||||||
/**
|
/**
|
||||||
* Gets the value of the chart.
|
* Gets the value of the chart.
|
||||||
*
|
*
|
||||||
* @param valueMap Just an empty map. The only reason it exists is to make your life easier.
|
* @param valueMap Just an empty map. The only reason it exists is to make your
|
||||||
* You don't have to create a map yourself!
|
* life easier. You don't have to create a map yourself!
|
||||||
* @return The value of the chart.
|
* @return The value of the chart.
|
||||||
*/
|
*/
|
||||||
public abstract HashMap<Country, Integer> getValues(HashMap<Country, Integer> valueMap);
|
public abstract HashMap<Country, Integer> getValues(HashMap<Country, Integer> valueMap);
|
||||||
@@ -709,255 +735,89 @@ public class Metrics {
|
|||||||
*/
|
*/
|
||||||
AUTO_DETECT("AUTO", "Auto Detected"),
|
AUTO_DETECT("AUTO", "Auto Detected"),
|
||||||
|
|
||||||
ANDORRA("AD", "Andorra"),
|
ANDORRA("AD", "Andorra"), UNITED_ARAB_EMIRATES("AE", "United Arab Emirates"), AFGHANISTAN("AF", "Afghanistan"),
|
||||||
UNITED_ARAB_EMIRATES("AE", "United Arab Emirates"),
|
ANTIGUA_AND_BARBUDA("AG", "Antigua and Barbuda"), ANGUILLA("AI", "Anguilla"), ALBANIA("AL", "Albania"),
|
||||||
AFGHANISTAN("AF", "Afghanistan"),
|
ARMENIA("AM", "Armenia"), NETHERLANDS_ANTILLES("AN", "Netherlands Antilles"), ANGOLA("AO", "Angola"),
|
||||||
ANTIGUA_AND_BARBUDA("AG", "Antigua and Barbuda"),
|
ANTARCTICA("AQ", "Antarctica"), ARGENTINA("AR", "Argentina"), AMERICAN_SAMOA("AS", "American Samoa"),
|
||||||
ANGUILLA("AI", "Anguilla"),
|
AUSTRIA("AT", "Austria"), AUSTRALIA("AU", "Australia"), ARUBA("AW", "Aruba"),
|
||||||
ALBANIA("AL", "Albania"),
|
ÅLAND_ISLANDS("AX", "Åland Islands"), AZERBAIJAN("AZ", "Azerbaijan"),
|
||||||
ARMENIA("AM", "Armenia"),
|
BOSNIA_AND_HERZEGOVINA("BA", "Bosnia and Herzegovina"), BARBADOS("BB", "Barbados"),
|
||||||
NETHERLANDS_ANTILLES("AN", "Netherlands Antilles"),
|
BANGLADESH("BD", "Bangladesh"), BELGIUM("BE", "Belgium"), BURKINA_FASO("BF", "Burkina Faso"),
|
||||||
ANGOLA("AO", "Angola"),
|
BULGARIA("BG", "Bulgaria"), BAHRAIN("BH", "Bahrain"), BURUNDI("BI", "Burundi"), BENIN("BJ", "Benin"),
|
||||||
ANTARCTICA("AQ", "Antarctica"),
|
SAINT_BARTHÉLEMY("BL", "Saint Barthélemy"), BERMUDA("BM", "Bermuda"), BRUNEI("BN", "Brunei"),
|
||||||
ARGENTINA("AR", "Argentina"),
|
BOLIVIA("BO", "Bolivia"), BONAIRE_SINT_EUSTATIUS_AND_SABA("BQ", "Bonaire, Sint Eustatius and Saba"),
|
||||||
AMERICAN_SAMOA("AS", "American Samoa"),
|
BRAZIL("BR", "Brazil"), BAHAMAS("BS", "Bahamas"), BHUTAN("BT", "Bhutan"), BOUVET_ISLAND("BV", "Bouvet Island"),
|
||||||
AUSTRIA("AT", "Austria"),
|
BOTSWANA("BW", "Botswana"), BELARUS("BY", "Belarus"), BELIZE("BZ", "Belize"), CANADA("CA", "Canada"),
|
||||||
AUSTRALIA("AU", "Australia"),
|
|
||||||
ARUBA("AW", "Aruba"),
|
|
||||||
ÅLAND_ISLANDS("AX", "Åland Islands"),
|
|
||||||
AZERBAIJAN("AZ", "Azerbaijan"),
|
|
||||||
BOSNIA_AND_HERZEGOVINA("BA", "Bosnia and Herzegovina"),
|
|
||||||
BARBADOS("BB", "Barbados"),
|
|
||||||
BANGLADESH("BD", "Bangladesh"),
|
|
||||||
BELGIUM("BE", "Belgium"),
|
|
||||||
BURKINA_FASO("BF", "Burkina Faso"),
|
|
||||||
BULGARIA("BG", "Bulgaria"),
|
|
||||||
BAHRAIN("BH", "Bahrain"),
|
|
||||||
BURUNDI("BI", "Burundi"),
|
|
||||||
BENIN("BJ", "Benin"),
|
|
||||||
SAINT_BARTHÉLEMY("BL", "Saint Barthélemy"),
|
|
||||||
BERMUDA("BM", "Bermuda"),
|
|
||||||
BRUNEI("BN", "Brunei"),
|
|
||||||
BOLIVIA("BO", "Bolivia"),
|
|
||||||
BONAIRE_SINT_EUSTATIUS_AND_SABA("BQ", "Bonaire, Sint Eustatius and Saba"),
|
|
||||||
BRAZIL("BR", "Brazil"),
|
|
||||||
BAHAMAS("BS", "Bahamas"),
|
|
||||||
BHUTAN("BT", "Bhutan"),
|
|
||||||
BOUVET_ISLAND("BV", "Bouvet Island"),
|
|
||||||
BOTSWANA("BW", "Botswana"),
|
|
||||||
BELARUS("BY", "Belarus"),
|
|
||||||
BELIZE("BZ", "Belize"),
|
|
||||||
CANADA("CA", "Canada"),
|
|
||||||
COCOS_ISLANDS("CC", "Cocos Islands"),
|
COCOS_ISLANDS("CC", "Cocos Islands"),
|
||||||
THE_DEMOCRATIC_REPUBLIC_OF_CONGO("CD", "The Democratic Republic Of Congo"),
|
THE_DEMOCRATIC_REPUBLIC_OF_CONGO("CD", "The Democratic Republic Of Congo"),
|
||||||
CENTRAL_AFRICAN_REPUBLIC("CF", "Central African Republic"),
|
CENTRAL_AFRICAN_REPUBLIC("CF", "Central African Republic"), CONGO("CG", "Congo"),
|
||||||
CONGO("CG", "Congo"),
|
SWITZERLAND("CH", "Switzerland"), CÔTE_D_IVOIRE("CI", "Côte d'Ivoire"), COOK_ISLANDS("CK", "Cook Islands"),
|
||||||
SWITZERLAND("CH", "Switzerland"),
|
CHILE("CL", "Chile"), CAMEROON("CM", "Cameroon"), CHINA("CN", "China"), COLOMBIA("CO", "Colombia"),
|
||||||
CÔTE_D_IVOIRE("CI", "Côte d'Ivoire"),
|
COSTA_RICA("CR", "Costa Rica"), CUBA("CU", "Cuba"), CAPE_VERDE("CV", "Cape Verde"), CURAÇAO("CW", "Curaçao"),
|
||||||
COOK_ISLANDS("CK", "Cook Islands"),
|
CHRISTMAS_ISLAND("CX", "Christmas Island"), CYPRUS("CY", "Cyprus"), CZECH_REPUBLIC("CZ", "Czech Republic"),
|
||||||
CHILE("CL", "Chile"),
|
GERMANY("DE", "Germany"), DJIBOUTI("DJ", "Djibouti"), DENMARK("DK", "Denmark"), DOMINICA("DM", "Dominica"),
|
||||||
CAMEROON("CM", "Cameroon"),
|
DOMINICAN_REPUBLIC("DO", "Dominican Republic"), ALGERIA("DZ", "Algeria"), ECUADOR("EC", "Ecuador"),
|
||||||
CHINA("CN", "China"),
|
ESTONIA("EE", "Estonia"), EGYPT("EG", "Egypt"), WESTERN_SAHARA("EH", "Western Sahara"),
|
||||||
COLOMBIA("CO", "Colombia"),
|
ERITREA("ER", "Eritrea"), SPAIN("ES", "Spain"), ETHIOPIA("ET", "Ethiopia"), FINLAND("FI", "Finland"),
|
||||||
COSTA_RICA("CR", "Costa Rica"),
|
FIJI("FJ", "Fiji"), FALKLAND_ISLANDS("FK", "Falkland Islands"), MICRONESIA("FM", "Micronesia"),
|
||||||
CUBA("CU", "Cuba"),
|
FAROE_ISLANDS("FO", "Faroe Islands"), FRANCE("FR", "France"), GABON("GA", "Gabon"),
|
||||||
CAPE_VERDE("CV", "Cape Verde"),
|
UNITED_KINGDOM("GB", "United Kingdom"), GRENADA("GD", "Grenada"), GEORGIA("GE", "Georgia"),
|
||||||
CURAÇAO("CW", "Curaçao"),
|
FRENCH_GUIANA("GF", "French Guiana"), GUERNSEY("GG", "Guernsey"), GHANA("GH", "Ghana"),
|
||||||
CHRISTMAS_ISLAND("CX", "Christmas Island"),
|
GIBRALTAR("GI", "Gibraltar"), GREENLAND("GL", "Greenland"), GAMBIA("GM", "Gambia"), GUINEA("GN", "Guinea"),
|
||||||
CYPRUS("CY", "Cyprus"),
|
GUADELOUPE("GP", "Guadeloupe"), EQUATORIAL_GUINEA("GQ", "Equatorial Guinea"), GREECE("GR", "Greece"),
|
||||||
CZECH_REPUBLIC("CZ", "Czech Republic"),
|
|
||||||
GERMANY("DE", "Germany"),
|
|
||||||
DJIBOUTI("DJ", "Djibouti"),
|
|
||||||
DENMARK("DK", "Denmark"),
|
|
||||||
DOMINICA("DM", "Dominica"),
|
|
||||||
DOMINICAN_REPUBLIC("DO", "Dominican Republic"),
|
|
||||||
ALGERIA("DZ", "Algeria"),
|
|
||||||
ECUADOR("EC", "Ecuador"),
|
|
||||||
ESTONIA("EE", "Estonia"),
|
|
||||||
EGYPT("EG", "Egypt"),
|
|
||||||
WESTERN_SAHARA("EH", "Western Sahara"),
|
|
||||||
ERITREA("ER", "Eritrea"),
|
|
||||||
SPAIN("ES", "Spain"),
|
|
||||||
ETHIOPIA("ET", "Ethiopia"),
|
|
||||||
FINLAND("FI", "Finland"),
|
|
||||||
FIJI("FJ", "Fiji"),
|
|
||||||
FALKLAND_ISLANDS("FK", "Falkland Islands"),
|
|
||||||
MICRONESIA("FM", "Micronesia"),
|
|
||||||
FAROE_ISLANDS("FO", "Faroe Islands"),
|
|
||||||
FRANCE("FR", "France"),
|
|
||||||
GABON("GA", "Gabon"),
|
|
||||||
UNITED_KINGDOM("GB", "United Kingdom"),
|
|
||||||
GRENADA("GD", "Grenada"),
|
|
||||||
GEORGIA("GE", "Georgia"),
|
|
||||||
FRENCH_GUIANA("GF", "French Guiana"),
|
|
||||||
GUERNSEY("GG", "Guernsey"),
|
|
||||||
GHANA("GH", "Ghana"),
|
|
||||||
GIBRALTAR("GI", "Gibraltar"),
|
|
||||||
GREENLAND("GL", "Greenland"),
|
|
||||||
GAMBIA("GM", "Gambia"),
|
|
||||||
GUINEA("GN", "Guinea"),
|
|
||||||
GUADELOUPE("GP", "Guadeloupe"),
|
|
||||||
EQUATORIAL_GUINEA("GQ", "Equatorial Guinea"),
|
|
||||||
GREECE("GR", "Greece"),
|
|
||||||
SOUTH_GEORGIA_AND_THE_SOUTH_SANDWICH_ISLANDS("GS", "South Georgia And The South Sandwich Islands"),
|
SOUTH_GEORGIA_AND_THE_SOUTH_SANDWICH_ISLANDS("GS", "South Georgia And The South Sandwich Islands"),
|
||||||
GUATEMALA("GT", "Guatemala"),
|
GUATEMALA("GT", "Guatemala"), GUAM("GU", "Guam"), GUINEA_BISSAU("GW", "Guinea-Bissau"), GUYANA("GY", "Guyana"),
|
||||||
GUAM("GU", "Guam"),
|
HONG_KONG("HK", "Hong Kong"), HEARD_ISLAND_AND_MCDONALD_ISLANDS("HM", "Heard Island And McDonald Islands"),
|
||||||
GUINEA_BISSAU("GW", "Guinea-Bissau"),
|
HONDURAS("HN", "Honduras"), CROATIA("HR", "Croatia"), HAITI("HT", "Haiti"), HUNGARY("HU", "Hungary"),
|
||||||
GUYANA("GY", "Guyana"),
|
INDONESIA("ID", "Indonesia"), IRELAND("IE", "Ireland"), ISRAEL("IL", "Israel"),
|
||||||
HONG_KONG("HK", "Hong Kong"),
|
ISLE_OF_MAN("IM", "Isle Of Man"), INDIA("IN", "India"),
|
||||||
HEARD_ISLAND_AND_MCDONALD_ISLANDS("HM", "Heard Island And McDonald Islands"),
|
BRITISH_INDIAN_OCEAN_TERRITORY("IO", "British Indian Ocean Territory"), IRAQ("IQ", "Iraq"), IRAN("IR", "Iran"),
|
||||||
HONDURAS("HN", "Honduras"),
|
ICELAND("IS", "Iceland"), ITALY("IT", "Italy"), JERSEY("JE", "Jersey"), JAMAICA("JM", "Jamaica"),
|
||||||
CROATIA("HR", "Croatia"),
|
JORDAN("JO", "Jordan"), JAPAN("JP", "Japan"), KENYA("KE", "Kenya"), KYRGYZSTAN("KG", "Kyrgyzstan"),
|
||||||
HAITI("HT", "Haiti"),
|
CAMBODIA("KH", "Cambodia"), KIRIBATI("KI", "Kiribati"), COMOROS("KM", "Comoros"),
|
||||||
HUNGARY("HU", "Hungary"),
|
SAINT_KITTS_AND_NEVIS("KN", "Saint Kitts And Nevis"), NORTH_KOREA("KP", "North Korea"),
|
||||||
INDONESIA("ID", "Indonesia"),
|
SOUTH_KOREA("KR", "South Korea"), KUWAIT("KW", "Kuwait"), CAYMAN_ISLANDS("KY", "Cayman Islands"),
|
||||||
IRELAND("IE", "Ireland"),
|
KAZAKHSTAN("KZ", "Kazakhstan"), LAOS("LA", "Laos"), LEBANON("LB", "Lebanon"), SAINT_LUCIA("LC", "Saint Lucia"),
|
||||||
ISRAEL("IL", "Israel"),
|
LIECHTENSTEIN("LI", "Liechtenstein"), SRI_LANKA("LK", "Sri Lanka"), LIBERIA("LR", "Liberia"),
|
||||||
ISLE_OF_MAN("IM", "Isle Of Man"),
|
LESOTHO("LS", "Lesotho"), LITHUANIA("LT", "Lithuania"), LUXEMBOURG("LU", "Luxembourg"), LATVIA("LV", "Latvia"),
|
||||||
INDIA("IN", "India"),
|
LIBYA("LY", "Libya"), MOROCCO("MA", "Morocco"), MONACO("MC", "Monaco"), MOLDOVA("MD", "Moldova"),
|
||||||
BRITISH_INDIAN_OCEAN_TERRITORY("IO", "British Indian Ocean Territory"),
|
MONTENEGRO("ME", "Montenegro"), SAINT_MARTIN("MF", "Saint Martin"), MADAGASCAR("MG", "Madagascar"),
|
||||||
IRAQ("IQ", "Iraq"),
|
MARSHALL_ISLANDS("MH", "Marshall Islands"), MACEDONIA("MK", "Macedonia"), MALI("ML", "Mali"),
|
||||||
IRAN("IR", "Iran"),
|
MYANMAR("MM", "Myanmar"), MONGOLIA("MN", "Mongolia"), MACAO("MO", "Macao"),
|
||||||
ICELAND("IS", "Iceland"),
|
NORTHERN_MARIANA_ISLANDS("MP", "Northern Mariana Islands"), MARTINIQUE("MQ", "Martinique"),
|
||||||
ITALY("IT", "Italy"),
|
MAURITANIA("MR", "Mauritania"), MONTSERRAT("MS", "Montserrat"), MALTA("MT", "Malta"),
|
||||||
JERSEY("JE", "Jersey"),
|
MAURITIUS("MU", "Mauritius"), MALDIVES("MV", "Maldives"), MALAWI("MW", "Malawi"), MEXICO("MX", "Mexico"),
|
||||||
JAMAICA("JM", "Jamaica"),
|
MALAYSIA("MY", "Malaysia"), MOZAMBIQUE("MZ", "Mozambique"), NAMIBIA("NA", "Namibia"),
|
||||||
JORDAN("JO", "Jordan"),
|
NEW_CALEDONIA("NC", "New Caledonia"), NIGER("NE", "Niger"), NORFOLK_ISLAND("NF", "Norfolk Island"),
|
||||||
JAPAN("JP", "Japan"),
|
NIGERIA("NG", "Nigeria"), NICARAGUA("NI", "Nicaragua"), NETHERLANDS("NL", "Netherlands"),
|
||||||
KENYA("KE", "Kenya"),
|
NORWAY("NO", "Norway"), NEPAL("NP", "Nepal"), NAURU("NR", "Nauru"), NIUE("NU", "Niue"),
|
||||||
KYRGYZSTAN("KG", "Kyrgyzstan"),
|
NEW_ZEALAND("NZ", "New Zealand"), OMAN("OM", "Oman"), PANAMA("PA", "Panama"), PERU("PE", "Peru"),
|
||||||
CAMBODIA("KH", "Cambodia"),
|
FRENCH_POLYNESIA("PF", "French Polynesia"), PAPUA_NEW_GUINEA("PG", "Papua New Guinea"),
|
||||||
KIRIBATI("KI", "Kiribati"),
|
PHILIPPINES("PH", "Philippines"), PAKISTAN("PK", "Pakistan"), POLAND("PL", "Poland"),
|
||||||
COMOROS("KM", "Comoros"),
|
SAINT_PIERRE_AND_MIQUELON("PM", "Saint Pierre And Miquelon"), PITCAIRN("PN", "Pitcairn"),
|
||||||
SAINT_KITTS_AND_NEVIS("KN", "Saint Kitts And Nevis"),
|
PUERTO_RICO("PR", "Puerto Rico"), PALESTINE("PS", "Palestine"), PORTUGAL("PT", "Portugal"),
|
||||||
NORTH_KOREA("KP", "North Korea"),
|
PALAU("PW", "Palau"), PARAGUAY("PY", "Paraguay"), QATAR("QA", "Qatar"), REUNION("RE", "Reunion"),
|
||||||
SOUTH_KOREA("KR", "South Korea"),
|
ROMANIA("RO", "Romania"), SERBIA("RS", "Serbia"), RUSSIA("RU", "Russia"), RWANDA("RW", "Rwanda"),
|
||||||
KUWAIT("KW", "Kuwait"),
|
SAUDI_ARABIA("SA", "Saudi Arabia"), SOLOMON_ISLANDS("SB", "Solomon Islands"), SEYCHELLES("SC", "Seychelles"),
|
||||||
CAYMAN_ISLANDS("KY", "Cayman Islands"),
|
SUDAN("SD", "Sudan"), SWEDEN("SE", "Sweden"), SINGAPORE("SG", "Singapore"), SAINT_HELENA("SH", "Saint Helena"),
|
||||||
KAZAKHSTAN("KZ", "Kazakhstan"),
|
SLOVENIA("SI", "Slovenia"), SVALBARD_AND_JAN_MAYEN("SJ", "Svalbard And Jan Mayen"), SLOVAKIA("SK", "Slovakia"),
|
||||||
LAOS("LA", "Laos"),
|
SIERRA_LEONE("SL", "Sierra Leone"), SAN_MARINO("SM", "San Marino"), SENEGAL("SN", "Senegal"),
|
||||||
LEBANON("LB", "Lebanon"),
|
SOMALIA("SO", "Somalia"), SURINAME("SR", "Suriname"), SOUTH_SUDAN("SS", "South Sudan"),
|
||||||
SAINT_LUCIA("LC", "Saint Lucia"),
|
SAO_TOME_AND_PRINCIPE("ST", "Sao Tome And Principe"), EL_SALVADOR("SV", "El Salvador"),
|
||||||
LIECHTENSTEIN("LI", "Liechtenstein"),
|
SINT_MAARTEN_DUTCH_PART("SX", "Sint Maarten (Dutch part)"), SYRIA("SY", "Syria"), SWAZILAND("SZ", "Swaziland"),
|
||||||
SRI_LANKA("LK", "Sri Lanka"),
|
TURKS_AND_CAICOS_ISLANDS("TC", "Turks And Caicos Islands"), CHAD("TD", "Chad"),
|
||||||
LIBERIA("LR", "Liberia"),
|
FRENCH_SOUTHERN_TERRITORIES("TF", "French Southern Territories"), TOGO("TG", "Togo"),
|
||||||
LESOTHO("LS", "Lesotho"),
|
THAILAND("TH", "Thailand"), TAJIKISTAN("TJ", "Tajikistan"), TOKELAU("TK", "Tokelau"),
|
||||||
LITHUANIA("LT", "Lithuania"),
|
TIMOR_LESTE("TL", "Timor-Leste"), TURKMENISTAN("TM", "Turkmenistan"), TUNISIA("TN", "Tunisia"),
|
||||||
LUXEMBOURG("LU", "Luxembourg"),
|
TONGA("TO", "Tonga"), TURKEY("TR", "Turkey"), TRINIDAD_AND_TOBAGO("TT", "Trinidad and Tobago"),
|
||||||
LATVIA("LV", "Latvia"),
|
TUVALU("TV", "Tuvalu"), TAIWAN("TW", "Taiwan"), TANZANIA("TZ", "Tanzania"), UKRAINE("UA", "Ukraine"),
|
||||||
LIBYA("LY", "Libya"),
|
UGANDA("UG", "Uganda"), UNITED_STATES_MINOR_OUTLYING_ISLANDS("UM", "United States Minor Outlying Islands"),
|
||||||
MOROCCO("MA", "Morocco"),
|
UNITED_STATES("US", "United States"), URUGUAY("UY", "Uruguay"), UZBEKISTAN("UZ", "Uzbekistan"),
|
||||||
MONACO("MC", "Monaco"),
|
VATICAN("VA", "Vatican"), SAINT_VINCENT_AND_THE_GRENADINES("VC", "Saint Vincent And The Grenadines"),
|
||||||
MOLDOVA("MD", "Moldova"),
|
VENEZUELA("VE", "Venezuela"), BRITISH_VIRGIN_ISLANDS("VG", "British Virgin Islands"),
|
||||||
MONTENEGRO("ME", "Montenegro"),
|
U_S__VIRGIN_ISLANDS("VI", "U.S. Virgin Islands"), VIETNAM("VN", "Vietnam"), VANUATU("VU", "Vanuatu"),
|
||||||
SAINT_MARTIN("MF", "Saint Martin"),
|
WALLIS_AND_FUTUNA("WF", "Wallis And Futuna"), SAMOA("WS", "Samoa"), YEMEN("YE", "Yemen"),
|
||||||
MADAGASCAR("MG", "Madagascar"),
|
MAYOTTE("YT", "Mayotte"), SOUTH_AFRICA("ZA", "South Africa"), ZAMBIA("ZM", "Zambia"),
|
||||||
MARSHALL_ISLANDS("MH", "Marshall Islands"),
|
|
||||||
MACEDONIA("MK", "Macedonia"),
|
|
||||||
MALI("ML", "Mali"),
|
|
||||||
MYANMAR("MM", "Myanmar"),
|
|
||||||
MONGOLIA("MN", "Mongolia"),
|
|
||||||
MACAO("MO", "Macao"),
|
|
||||||
NORTHERN_MARIANA_ISLANDS("MP", "Northern Mariana Islands"),
|
|
||||||
MARTINIQUE("MQ", "Martinique"),
|
|
||||||
MAURITANIA("MR", "Mauritania"),
|
|
||||||
MONTSERRAT("MS", "Montserrat"),
|
|
||||||
MALTA("MT", "Malta"),
|
|
||||||
MAURITIUS("MU", "Mauritius"),
|
|
||||||
MALDIVES("MV", "Maldives"),
|
|
||||||
MALAWI("MW", "Malawi"),
|
|
||||||
MEXICO("MX", "Mexico"),
|
|
||||||
MALAYSIA("MY", "Malaysia"),
|
|
||||||
MOZAMBIQUE("MZ", "Mozambique"),
|
|
||||||
NAMIBIA("NA", "Namibia"),
|
|
||||||
NEW_CALEDONIA("NC", "New Caledonia"),
|
|
||||||
NIGER("NE", "Niger"),
|
|
||||||
NORFOLK_ISLAND("NF", "Norfolk Island"),
|
|
||||||
NIGERIA("NG", "Nigeria"),
|
|
||||||
NICARAGUA("NI", "Nicaragua"),
|
|
||||||
NETHERLANDS("NL", "Netherlands"),
|
|
||||||
NORWAY("NO", "Norway"),
|
|
||||||
NEPAL("NP", "Nepal"),
|
|
||||||
NAURU("NR", "Nauru"),
|
|
||||||
NIUE("NU", "Niue"),
|
|
||||||
NEW_ZEALAND("NZ", "New Zealand"),
|
|
||||||
OMAN("OM", "Oman"),
|
|
||||||
PANAMA("PA", "Panama"),
|
|
||||||
PERU("PE", "Peru"),
|
|
||||||
FRENCH_POLYNESIA("PF", "French Polynesia"),
|
|
||||||
PAPUA_NEW_GUINEA("PG", "Papua New Guinea"),
|
|
||||||
PHILIPPINES("PH", "Philippines"),
|
|
||||||
PAKISTAN("PK", "Pakistan"),
|
|
||||||
POLAND("PL", "Poland"),
|
|
||||||
SAINT_PIERRE_AND_MIQUELON("PM", "Saint Pierre And Miquelon"),
|
|
||||||
PITCAIRN("PN", "Pitcairn"),
|
|
||||||
PUERTO_RICO("PR", "Puerto Rico"),
|
|
||||||
PALESTINE("PS", "Palestine"),
|
|
||||||
PORTUGAL("PT", "Portugal"),
|
|
||||||
PALAU("PW", "Palau"),
|
|
||||||
PARAGUAY("PY", "Paraguay"),
|
|
||||||
QATAR("QA", "Qatar"),
|
|
||||||
REUNION("RE", "Reunion"),
|
|
||||||
ROMANIA("RO", "Romania"),
|
|
||||||
SERBIA("RS", "Serbia"),
|
|
||||||
RUSSIA("RU", "Russia"),
|
|
||||||
RWANDA("RW", "Rwanda"),
|
|
||||||
SAUDI_ARABIA("SA", "Saudi Arabia"),
|
|
||||||
SOLOMON_ISLANDS("SB", "Solomon Islands"),
|
|
||||||
SEYCHELLES("SC", "Seychelles"),
|
|
||||||
SUDAN("SD", "Sudan"),
|
|
||||||
SWEDEN("SE", "Sweden"),
|
|
||||||
SINGAPORE("SG", "Singapore"),
|
|
||||||
SAINT_HELENA("SH", "Saint Helena"),
|
|
||||||
SLOVENIA("SI", "Slovenia"),
|
|
||||||
SVALBARD_AND_JAN_MAYEN("SJ", "Svalbard And Jan Mayen"),
|
|
||||||
SLOVAKIA("SK", "Slovakia"),
|
|
||||||
SIERRA_LEONE("SL", "Sierra Leone"),
|
|
||||||
SAN_MARINO("SM", "San Marino"),
|
|
||||||
SENEGAL("SN", "Senegal"),
|
|
||||||
SOMALIA("SO", "Somalia"),
|
|
||||||
SURINAME("SR", "Suriname"),
|
|
||||||
SOUTH_SUDAN("SS", "South Sudan"),
|
|
||||||
SAO_TOME_AND_PRINCIPE("ST", "Sao Tome And Principe"),
|
|
||||||
EL_SALVADOR("SV", "El Salvador"),
|
|
||||||
SINT_MAARTEN_DUTCH_PART("SX", "Sint Maarten (Dutch part)"),
|
|
||||||
SYRIA("SY", "Syria"),
|
|
||||||
SWAZILAND("SZ", "Swaziland"),
|
|
||||||
TURKS_AND_CAICOS_ISLANDS("TC", "Turks And Caicos Islands"),
|
|
||||||
CHAD("TD", "Chad"),
|
|
||||||
FRENCH_SOUTHERN_TERRITORIES("TF", "French Southern Territories"),
|
|
||||||
TOGO("TG", "Togo"),
|
|
||||||
THAILAND("TH", "Thailand"),
|
|
||||||
TAJIKISTAN("TJ", "Tajikistan"),
|
|
||||||
TOKELAU("TK", "Tokelau"),
|
|
||||||
TIMOR_LESTE("TL", "Timor-Leste"),
|
|
||||||
TURKMENISTAN("TM", "Turkmenistan"),
|
|
||||||
TUNISIA("TN", "Tunisia"),
|
|
||||||
TONGA("TO", "Tonga"),
|
|
||||||
TURKEY("TR", "Turkey"),
|
|
||||||
TRINIDAD_AND_TOBAGO("TT", "Trinidad and Tobago"),
|
|
||||||
TUVALU("TV", "Tuvalu"),
|
|
||||||
TAIWAN("TW", "Taiwan"),
|
|
||||||
TANZANIA("TZ", "Tanzania"),
|
|
||||||
UKRAINE("UA", "Ukraine"),
|
|
||||||
UGANDA("UG", "Uganda"),
|
|
||||||
UNITED_STATES_MINOR_OUTLYING_ISLANDS("UM", "United States Minor Outlying Islands"),
|
|
||||||
UNITED_STATES("US", "United States"),
|
|
||||||
URUGUAY("UY", "Uruguay"),
|
|
||||||
UZBEKISTAN("UZ", "Uzbekistan"),
|
|
||||||
VATICAN("VA", "Vatican"),
|
|
||||||
SAINT_VINCENT_AND_THE_GRENADINES("VC", "Saint Vincent And The Grenadines"),
|
|
||||||
VENEZUELA("VE", "Venezuela"),
|
|
||||||
BRITISH_VIRGIN_ISLANDS("VG", "British Virgin Islands"),
|
|
||||||
U_S__VIRGIN_ISLANDS("VI", "U.S. Virgin Islands"),
|
|
||||||
VIETNAM("VN", "Vietnam"),
|
|
||||||
VANUATU("VU", "Vanuatu"),
|
|
||||||
WALLIS_AND_FUTUNA("WF", "Wallis And Futuna"),
|
|
||||||
SAMOA("WS", "Samoa"),
|
|
||||||
YEMEN("YE", "Yemen"),
|
|
||||||
MAYOTTE("YT", "Mayotte"),
|
|
||||||
SOUTH_AFRICA("ZA", "South Africa"),
|
|
||||||
ZAMBIA("ZM", "Zambia"),
|
|
||||||
ZIMBABWE("ZW", "Zimbabwe");
|
ZIMBABWE("ZW", "Zimbabwe");
|
||||||
|
|
||||||
private String isoTag;
|
private String isoTag;
|
||||||
@@ -1005,8 +865,8 @@ public class Metrics {
|
|||||||
* Gets a country by a locale.
|
* Gets a country by a locale.
|
||||||
*
|
*
|
||||||
* @param locale The locale.
|
* @param locale The locale.
|
||||||
* @return The country from the giben locale or <code>null</code> if unknown country or
|
* @return The country from the giben locale or <code>null</code> if unknown
|
||||||
* if the locale does not contain a country.
|
* country or if the locale does not contain a country.
|
||||||
*/
|
*/
|
||||||
public static Country byLocale(Locale locale) {
|
public static Country byLocale(Locale locale) {
|
||||||
return byIsoTag(locale.getCountry());
|
return byIsoTag(locale.getCountry());
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* AntiCheat for Bukkit.
|
* AntiCheatReloaded for Bukkit and Spigot.
|
||||||
* Copyright (C) 2012-2014 AntiCheat Team | http://gravitydevelopment.net
|
* Copyright (c) 2012-2015 AntiCheat Team
|
||||||
|
* Copyright (c) 2016-2020 Rammelkast
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -21,177 +22,37 @@ package com.rammelkast.anticheatreloaded.util;
|
|||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
|
|
||||||
public enum BlockHardness {
|
public enum BlockHardness {
|
||||||
STONE(1.50D),
|
STONE(1.50D), GRASS(0.60D), DIRT(0.50D), COBBLESTONE(2.00D), WOOD(2.00D), SAPLING(0.00D), WATER(100.00D),
|
||||||
GRASS(0.60D),
|
STATIONARY_WATER(100.00D), LAVA(0.00D), STATIONARY_LAVA(100.00D), SAND(0.50D), GRAVEL(0.60D), GOLD_ORE(3.00D),
|
||||||
DIRT(0.50D),
|
IRON_ORE(3.00D), COAL_ORE(3.00D), LOG(2.00D), LOG_2(2.00D), LEAVES(0.20D), LEAVES_2(0.20D), SPONGE(0.60D),
|
||||||
COBBLESTONE(2.00D),
|
GLASS(0.30D), LAPIS_ORE(3.00D), LAPIS_BLOCK(3.00D), DISPENSER(3.50D), DROPPER(3.50D), SANDSTONE(0.80D),
|
||||||
WOOD(2.00D),
|
NOTE_BLOCK(0.80D), BED(0.20D), RAILS(0.70D), DETECTOR_RAIL(0.70D), POWERED_RAIL(0.70D), ACTIVATOR_RAIL(0.70D),
|
||||||
SAPLING(0.00D),
|
WEB(4.00D), LONG_GRASS(0.00D), DOUBLE_PLANT(0.00D), DEAD_BUSH(0.00D), WOOL(0.80D), YELLOW_FLOWER(0.00D),
|
||||||
WATER(100.00D),
|
RED_ROSE(0.00D), BROWN_MUSHROOM(0.00D), RED_MUSHROOM(0.00D), GOLD_BLOCK(3.00D), IRON_BLOCK(5.00D),
|
||||||
STATIONARY_WATER(100.00D),
|
DOUBLE_STEP(2.00D), STEP(2.00D), BRICK(2.00D), TNT(0.00D), BOOKSHELF(1.50D), MOSSY_COBBLESTONE(2.00D),
|
||||||
LAVA(0.00D),
|
OBSIDIAN(50.00D), TORCH(0.00D), FIRE(0.00D), MOB_SPAWNER(5.00D), CHEST(2.50D), TRAPPED_CHEST(2.50D),
|
||||||
STATIONARY_LAVA(100.00D),
|
REDSTONE_WIRE(0.00D), DIAMOND_ORE(3.00D), DIAMOND_BLOCK(5.00D), WORKBENCH(2.50D), SOIL(0.60D), FURNACE(3.50D),
|
||||||
SAND(0.50D),
|
BURNING_FURNACE(3.50D), WOODEN_DOOR(3.00D), LADDER(0.40D), LEVER(0.50D), IRON_DOOR_BLOCK(5.00D), HOPPER(2.00D),
|
||||||
GRAVEL(0.60D),
|
STONE_PLATE(0.50D), WOOD_PLATE(0.50D), GOLD_PLATE(0.50D), IRON_PLATE(0.50D), QUARTZ_BLOCK(0.80D), QUARTZ_ORE(3.00D),
|
||||||
GOLD_ORE(3.00D),
|
REDSTONE_BLOCK(5.00D), REDSTONE_ORE(3.00D), GLOWING_REDSTONE_ORE(3.00D), REDSTONE_TORCH_OFF(0.00D),
|
||||||
IRON_ORE(3.00D),
|
REDSTONE_TORCH_ON(0.00D), REDSTONE_COMPARATOR_OFF(0.00D), REDSTONE_COMPARATOR_ON(0.00D), DAYLIGHT_DETECTOR(0.20D),
|
||||||
COAL_ORE(3.00D),
|
STONE_BUTTON(0.50D), SNOW(0.10D), ICE(0.50D), PACKED_ICE(0.50D), SNOW_BLOCK(0.20D), CACTUS(0.40D), CLAY(0.60D),
|
||||||
LOG(2.00D),
|
HARD_CLAY(1.25D), STAINED_CLAY(1.25D), SUGAR_CANE_BLOCK(0.00D), JUKEBOX(2.00D), FENCE(2.00D), NETHERRACK(0.40D),
|
||||||
LOG_2(2.00D),
|
SOUL_SAND(0.50D), GLOWSTONE(0.30D), PORTAL(-1.00D), CAKE_BLOCK(0.50D), LOCKED_CHEST(0.00D), TRAP_DOOR(3.00D),
|
||||||
LEAVES(0.20D),
|
MONSTER_EGGS(0.750D), SMOOTH_BRICK(1.50D), IRON_FENCE(5.00D), THIN_GLASS(0.30D), STAINED_GLASS(0.30D),
|
||||||
LEAVES_2(0.20D),
|
STAINED_GLASS_PANE(0.30D), PUMPKIN_STEM(0.00D), MELON_STEM(0.00D), VINE(0.20D), FENCE_GATE(2.00D), MYCEL(0.60D),
|
||||||
SPONGE(0.60D),
|
WATER_LILY(0.00D), NETHER_BRICK(2.00D), NETHER_FENCE(2.00D), ENCHANTMENT_TABLE(5.00D), BREWING_STAND(0.50D),
|
||||||
GLASS(0.30D),
|
CAULDRON(2.00D), ENDER_PORTAL(-1.00D), ENDER_PORTAL_FRAME(-1.00D), DRAGON_EGG(3.00D), REDSTONE_LAMP_OFF(0.30D),
|
||||||
LAPIS_ORE(3.00D),
|
REDSTONE_LAMP_ON(0.30D), WOOD_DOUBLE_STEP(2.00D), WOOD_STEP(2.00D), COCOA(0.20D), EMERALD_ORE(3.00D),
|
||||||
LAPIS_BLOCK(3.00D),
|
ENDER_CHEST(22.50D), EMERALD_BLOCK(5.00D), FLOWER_POT(0.00D), WOOD_BUTTON(0.50D), ANVIL(5.00D),
|
||||||
DISPENSER(3.50D),
|
HUGE_MUSHROOM_1(0.20D), HUGE_MUSHROOM_2(0.20D), BED_BLOCK(0.20D), WOOD_STAIRS(2.00D), COBBLESTONE_STAIRS(2.00D),
|
||||||
DROPPER(3.50D),
|
BRICK_STAIRS(2.00D), SMOOTH_STAIRS(1.50D), NETHER_BRICK_STAIRS(2.00D), SPRUCE_WOOD_STAIRS(2.00D),
|
||||||
SANDSTONE(0.80D),
|
BIRCH_WOOD_STAIRS(2.00D), JUNGLE_WOOD_STAIRS(2.00D), DARK_OAK_STAIRS(2.00D), ACACIA_STAIRS(2.00D),
|
||||||
NOTE_BLOCK(0.80D),
|
QUARTZ_STAIRS(0.80D), SANDSTONE_STAIRS(0.80D), COMMAND(0.00D), BEACON(3.00D), COBBLE_WALL(2.00D), CROPS(0.00D),
|
||||||
BED(0.20D),
|
CARROT(0.00D), POTATO(0.00D), SKULL(1.00D), NETHER_WARTS(0.00D), SIGN_POST(1.00D), WALL_SIGN(1.00D), PUMPKIN(1.00D),
|
||||||
RAILS(0.70D),
|
JACK_O_LANTERN(1.00D), DIODE_BLOCK_ON(0.00D), DIODE_BLOCK_OFF(0.00D), MELON_BLOCK(1.00D), ENDER_STONE(3.00D),
|
||||||
DETECTOR_RAIL(0.70D),
|
TRIPWIRE(0.00D), TRIPWIRE_HOOK(0.00D), HAY_BLOCK(0.50D), CARPET(0.10D), COAL_BLOCK(5.00D), PISTON_BASE(0.70D),
|
||||||
POWERED_RAIL(0.70D),
|
PISTON_EXTENSION(0.70D), PISTON_MOVING_PIECE(0.70D), PISTON_STICKY_BASE(0.70D);
|
||||||
ACTIVATOR_RAIL(0.70D),
|
|
||||||
WEB(4.00D),
|
|
||||||
LONG_GRASS(0.00D),
|
|
||||||
DOUBLE_PLANT(0.00D),
|
|
||||||
DEAD_BUSH(0.00D),
|
|
||||||
WOOL(0.80D),
|
|
||||||
YELLOW_FLOWER(0.00D),
|
|
||||||
RED_ROSE(0.00D),
|
|
||||||
BROWN_MUSHROOM(0.00D),
|
|
||||||
RED_MUSHROOM(0.00D),
|
|
||||||
GOLD_BLOCK(3.00D),
|
|
||||||
IRON_BLOCK(5.00D),
|
|
||||||
DOUBLE_STEP(2.00D),
|
|
||||||
STEP(2.00D),
|
|
||||||
BRICK(2.00D),
|
|
||||||
TNT(0.00D),
|
|
||||||
BOOKSHELF(1.50D),
|
|
||||||
MOSSY_COBBLESTONE(2.00D),
|
|
||||||
OBSIDIAN(50.00D),
|
|
||||||
TORCH(0.00D),
|
|
||||||
FIRE(0.00D),
|
|
||||||
MOB_SPAWNER(5.00D),
|
|
||||||
CHEST(2.50D),
|
|
||||||
TRAPPED_CHEST(2.50D),
|
|
||||||
REDSTONE_WIRE(0.00D),
|
|
||||||
DIAMOND_ORE(3.00D),
|
|
||||||
DIAMOND_BLOCK(5.00D),
|
|
||||||
WORKBENCH(2.50D),
|
|
||||||
SOIL(0.60D),
|
|
||||||
FURNACE(3.50D),
|
|
||||||
BURNING_FURNACE(3.50D),
|
|
||||||
WOODEN_DOOR(3.00D),
|
|
||||||
LADDER(0.40D),
|
|
||||||
LEVER(0.50D),
|
|
||||||
IRON_DOOR_BLOCK(5.00D),
|
|
||||||
HOPPER(2.00D),
|
|
||||||
STONE_PLATE(0.50D),
|
|
||||||
WOOD_PLATE(0.50D),
|
|
||||||
GOLD_PLATE(0.50D),
|
|
||||||
IRON_PLATE(0.50D),
|
|
||||||
QUARTZ_BLOCK(0.80D),
|
|
||||||
QUARTZ_ORE(3.00D),
|
|
||||||
REDSTONE_BLOCK(5.00D),
|
|
||||||
REDSTONE_ORE(3.00D),
|
|
||||||
GLOWING_REDSTONE_ORE(3.00D),
|
|
||||||
REDSTONE_TORCH_OFF(0.00D),
|
|
||||||
REDSTONE_TORCH_ON(0.00D),
|
|
||||||
REDSTONE_COMPARATOR_OFF(0.00D),
|
|
||||||
REDSTONE_COMPARATOR_ON(0.00D),
|
|
||||||
DAYLIGHT_DETECTOR(0.20D),
|
|
||||||
STONE_BUTTON(0.50D),
|
|
||||||
SNOW(0.10D),
|
|
||||||
ICE(0.50D),
|
|
||||||
PACKED_ICE(0.50D),
|
|
||||||
SNOW_BLOCK(0.20D),
|
|
||||||
CACTUS(0.40D),
|
|
||||||
CLAY(0.60D),
|
|
||||||
HARD_CLAY(1.25D),
|
|
||||||
STAINED_CLAY(1.25D),
|
|
||||||
SUGAR_CANE_BLOCK(0.00D),
|
|
||||||
JUKEBOX(2.00D),
|
|
||||||
FENCE(2.00D),
|
|
||||||
NETHERRACK(0.40D),
|
|
||||||
SOUL_SAND(0.50D),
|
|
||||||
GLOWSTONE(0.30D),
|
|
||||||
PORTAL(-1.00D),
|
|
||||||
CAKE_BLOCK(0.50D),
|
|
||||||
LOCKED_CHEST(0.00D),
|
|
||||||
TRAP_DOOR(3.00D),
|
|
||||||
MONSTER_EGGS(0.750D),
|
|
||||||
SMOOTH_BRICK(1.50D),
|
|
||||||
IRON_FENCE(5.00D),
|
|
||||||
THIN_GLASS(0.30D),
|
|
||||||
STAINED_GLASS(0.30D),
|
|
||||||
STAINED_GLASS_PANE(0.30D),
|
|
||||||
PUMPKIN_STEM(0.00D),
|
|
||||||
MELON_STEM(0.00D),
|
|
||||||
VINE(0.20D),
|
|
||||||
FENCE_GATE(2.00D),
|
|
||||||
MYCEL(0.60D),
|
|
||||||
WATER_LILY(0.00D),
|
|
||||||
NETHER_BRICK(2.00D),
|
|
||||||
NETHER_FENCE(2.00D),
|
|
||||||
ENCHANTMENT_TABLE(5.00D),
|
|
||||||
BREWING_STAND(0.50D),
|
|
||||||
CAULDRON(2.00D),
|
|
||||||
ENDER_PORTAL(-1.00D),
|
|
||||||
ENDER_PORTAL_FRAME(-1.00D),
|
|
||||||
DRAGON_EGG(3.00D),
|
|
||||||
REDSTONE_LAMP_OFF(0.30D),
|
|
||||||
REDSTONE_LAMP_ON(0.30D),
|
|
||||||
WOOD_DOUBLE_STEP(2.00D),
|
|
||||||
WOOD_STEP(2.00D),
|
|
||||||
COCOA(0.20D),
|
|
||||||
EMERALD_ORE(3.00D),
|
|
||||||
ENDER_CHEST(22.50D),
|
|
||||||
EMERALD_BLOCK(5.00D),
|
|
||||||
FLOWER_POT(0.00D),
|
|
||||||
WOOD_BUTTON(0.50D),
|
|
||||||
ANVIL(5.00D),
|
|
||||||
HUGE_MUSHROOM_1(0.20D),
|
|
||||||
HUGE_MUSHROOM_2(0.20D),
|
|
||||||
BED_BLOCK(0.20D),
|
|
||||||
WOOD_STAIRS(2.00D),
|
|
||||||
COBBLESTONE_STAIRS(2.00D),
|
|
||||||
BRICK_STAIRS(2.00D),
|
|
||||||
SMOOTH_STAIRS(1.50D),
|
|
||||||
NETHER_BRICK_STAIRS(2.00D),
|
|
||||||
SPRUCE_WOOD_STAIRS(2.00D),
|
|
||||||
BIRCH_WOOD_STAIRS(2.00D),
|
|
||||||
JUNGLE_WOOD_STAIRS(2.00D),
|
|
||||||
DARK_OAK_STAIRS(2.00D),
|
|
||||||
ACACIA_STAIRS(2.00D),
|
|
||||||
QUARTZ_STAIRS(0.80D),
|
|
||||||
SANDSTONE_STAIRS(0.80D),
|
|
||||||
COMMAND(0.00D),
|
|
||||||
BEACON(3.00D),
|
|
||||||
COBBLE_WALL(2.00D),
|
|
||||||
CROPS(0.00D),
|
|
||||||
CARROT(0.00D),
|
|
||||||
POTATO(0.00D),
|
|
||||||
SKULL(1.00D),
|
|
||||||
NETHER_WARTS(0.00D),
|
|
||||||
SIGN_POST(1.00D),
|
|
||||||
WALL_SIGN(1.00D),
|
|
||||||
PUMPKIN(1.00D),
|
|
||||||
JACK_O_LANTERN(1.00D),
|
|
||||||
DIODE_BLOCK_ON(0.00D),
|
|
||||||
DIODE_BLOCK_OFF(0.00D),
|
|
||||||
MELON_BLOCK(1.00D),
|
|
||||||
ENDER_STONE(3.00D),
|
|
||||||
TRIPWIRE(0.00D),
|
|
||||||
TRIPWIRE_HOOK(0.00D),
|
|
||||||
HAY_BLOCK(0.50D),
|
|
||||||
CARPET(0.10D),
|
|
||||||
COAL_BLOCK(5.00D),
|
|
||||||
PISTON_BASE(0.70D),
|
|
||||||
PISTON_EXTENSION(0.70D),
|
|
||||||
PISTON_MOVING_PIECE(0.70D),
|
|
||||||
PISTON_STICKY_BASE(0.70D);
|
|
||||||
|
|
||||||
Material mat;
|
Material mat;
|
||||||
double hardness;
|
double hardness;
|
||||||
@@ -205,7 +66,7 @@ public enum BlockHardness {
|
|||||||
try {
|
try {
|
||||||
BlockHardness h = getHardness(m);
|
BlockHardness h = getHardness(m);
|
||||||
return h == null ? 0D : h.hardness;
|
return h == null ? 0D : h.hardness;
|
||||||
}catch(Exception e) {
|
} catch (Exception e) {
|
||||||
return 0D;
|
return 0D;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* AntiCheat for Bukkit.
|
* AntiCheatReloaded for Bukkit and Spigot.
|
||||||
* Copyright (C) 2012-2014 AntiCheat Team | http://gravitydevelopment.net
|
* Copyright (c) 2012-2015 AntiCheat Team
|
||||||
|
* Copyright (c) 2016-2020 Rammelkast
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* AntiCheat for Bukkit.
|
* AntiCheatReloaded for Bukkit and Spigot.
|
||||||
* Copyright (C) 2012-2014 AntiCheat Team | http://gravitydevelopment.net
|
* Copyright (c) 2012-2015 AntiCheat Team
|
||||||
|
* Copyright (c) 2016-2020 Rammelkast
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -30,7 +31,9 @@ public class FileFormatter extends Formatter {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String format(LogRecord record) {
|
public String format(LogRecord record) {
|
||||||
StringBuilder output = new StringBuilder().append("[").append(record.getLevel()).append('|').append(FORMAT.format(new Date(record.getMillis()))).append("]: ").append(record.getMessage()).append(' ').append(LINE_SEP);
|
StringBuilder output = new StringBuilder().append("[").append(record.getLevel()).append('|')
|
||||||
|
.append(FORMAT.format(new Date(record.getMillis()))).append("]: ").append(record.getMessage())
|
||||||
|
.append(' ').append(LINE_SEP);
|
||||||
return output.toString();
|
return output.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* AntiCheat for Bukkit.
|
* AntiCheatReloaded for Bukkit and Spigot.
|
||||||
* Copyright (C) 2012-2014 AntiCheat Team | http://gravitydevelopment.net
|
* Copyright (c) 2012-2015 AntiCheat Team
|
||||||
|
* Copyright (c) 2016-2020 Rammelkast
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -20,7 +21,7 @@ package com.rammelkast.anticheatreloaded.util;
|
|||||||
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
|
|
||||||
import com.rammelkast.anticheatreloaded.AntiCheat;
|
import com.rammelkast.anticheatreloaded.AntiCheatReloaded;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
@@ -41,12 +42,15 @@ public class Group {
|
|||||||
|
|
||||||
ChatColor c = ChatColor.valueOf(color);
|
ChatColor c = ChatColor.valueOf(color);
|
||||||
if (c == null) {
|
if (c == null) {
|
||||||
AntiCheat.getPlugin().getLogger().warning("Event '" + name + "' was initialized with the color '" + color + "' which is invalid.");
|
AntiCheatReloaded.getPlugin().getLogger()
|
||||||
AntiCheat.getPlugin().getLogger().warning("This event will not run properly. See http://jd.bukkit.org/apidocs/org/bukkit/ChatColor.html#enum_constant_summary for a list of valid colors");
|
.warning("Event '" + name + "' was initialized with the color '" + color + "' which is invalid.");
|
||||||
|
AntiCheatReloaded.getPlugin().getLogger().warning(
|
||||||
|
"This event will not run properly. See http://jd.bukkit.org/apidocs/org/bukkit/ChatColor.html#enum_constant_summary for a list of valid colors");
|
||||||
} else {
|
} else {
|
||||||
this.color = c;
|
this.color = c;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
@@ -75,9 +79,11 @@ public class Group {
|
|||||||
throw new Exception();
|
throw new Exception();
|
||||||
}
|
}
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
AntiCheat.getPlugin().getLogger().warning("An event was initialized with an invalid string: '" + string + "'");
|
AntiCheatReloaded.getPlugin().getLogger()
|
||||||
AntiCheat.getPlugin().getLogger().warning("The proper format is: 'name : threshold : color : action' such as 'High : 50 : RED : KICK'");
|
.warning("An event was initialized with an invalid string: '" + string + "'");
|
||||||
AntiCheat.getPlugin().getLogger().warning("This event will NOT run. (" + ex.getMessage() + ")");
|
AntiCheatReloaded.getPlugin().getLogger().warning(
|
||||||
|
"The proper format is: 'name : threshold : color : action' such as 'High : 50 : RED : KICK'");
|
||||||
|
AntiCheatReloaded.getPlugin().getLogger().warning("This event will NOT run. (" + ex.getMessage() + ")");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,18 +0,0 @@
|
|||||||
package com.rammelkast.anticheatreloaded.util;
|
|
||||||
|
|
||||||
import java.util.EnumSet;
|
|
||||||
|
|
||||||
import org.bukkit.Material;
|
|
||||||
import org.bukkit.potion.PotionEffectType;
|
|
||||||
|
|
||||||
public class NMS_1_9_PLUS {
|
|
||||||
|
|
||||||
static final EnumSet<Material> MOVE_UP_BLOCKS_1_9 = EnumSet.of(Material.ACACIA_STAIRS,
|
|
||||||
Material.BIRCH_WOOD_STAIRS, Material.BRICK_STAIRS, Material.COBBLESTONE_STAIRS, Material.DARK_OAK_STAIRS,
|
|
||||||
Material.JUNGLE_WOOD_STAIRS, Material.NETHER_BRICK_STAIRS, Material.QUARTZ_STAIRS,
|
|
||||||
Material.RED_SANDSTONE_STAIRS, Material.SANDSTONE_STAIRS, Material.SMOOTH_STAIRS,
|
|
||||||
Material.SPRUCE_WOOD_STAIRS, Material.WOOD_STAIRS, Material.PURPUR_STAIRS);
|
|
||||||
|
|
||||||
static final PotionEffectType LEVITATION = PotionEffectType.LEVITATION;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,186 +0,0 @@
|
|||||||
package com.rammelkast.anticheatreloaded.util;
|
|
||||||
|
|
||||||
import java.util.Random;
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.Location;
|
|
||||||
import org.bukkit.craftbukkit.v1_11_R1.CraftServer;
|
|
||||||
import org.bukkit.craftbukkit.v1_11_R1.CraftWorld;
|
|
||||||
import org.bukkit.craftbukkit.v1_11_R1.entity.CraftPlayer;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
|
||||||
import org.bukkit.event.player.PlayerMoveEvent;
|
|
||||||
import org.bukkit.scheduler.BukkitRunnable;
|
|
||||||
import org.bukkit.util.Vector;
|
|
||||||
|
|
||||||
import com.mojang.authlib.GameProfile;
|
|
||||||
import com.rammelkast.anticheatreloaded.AntiCheat;
|
|
||||||
|
|
||||||
import net.minecraft.server.v1_11_R1.EntityHuman;
|
|
||||||
import net.minecraft.server.v1_11_R1.EntityPlayer;
|
|
||||||
import net.minecraft.server.v1_11_R1.MinecraftServer;
|
|
||||||
import net.minecraft.server.v1_11_R1.PacketPlayOutEntityMetadata;
|
|
||||||
import net.minecraft.server.v1_11_R1.PacketPlayOutEntityTeleport;
|
|
||||||
import net.minecraft.server.v1_11_R1.PacketPlayOutNamedEntitySpawn;
|
|
||||||
import net.minecraft.server.v1_11_R1.PacketPlayOutPlayerInfo;
|
|
||||||
import net.minecraft.server.v1_11_R1.PlayerConnection;
|
|
||||||
import net.minecraft.server.v1_11_R1.PlayerInteractManager;
|
|
||||||
import net.minecraft.server.v1_11_R1.World;
|
|
||||||
import net.minecraft.server.v1_11_R1.WorldServer;
|
|
||||||
|
|
||||||
public class NPC_1_11 {
|
|
||||||
|
|
||||||
private final UUID owner;
|
|
||||||
private final String name;
|
|
||||||
private UUID uuid;
|
|
||||||
private EntityPlayer npc;
|
|
||||||
private int entityId;
|
|
||||||
private Location location;
|
|
||||||
|
|
||||||
public int getID() {
|
|
||||||
return this.entityId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public NPC_1_11(Player owner) {
|
|
||||||
this.owner = owner.getUniqueId();
|
|
||||||
this.name = NameGenerator.generateName();
|
|
||||||
Location eyelocation = owner.getEyeLocation();
|
|
||||||
Vector vec = owner.getLocation().getDirection();
|
|
||||||
vec.setX(-3 * vec.getX());
|
|
||||||
vec.setZ(-3 * vec.getZ());
|
|
||||||
Location back = eyelocation.add(vec);
|
|
||||||
this.location = back; // TODO
|
|
||||||
}
|
|
||||||
|
|
||||||
public void spawn() {
|
|
||||||
final MinecraftServer nmsServer = ((CraftServer) Bukkit.getServer()).getServer();
|
|
||||||
final WorldServer nmsWorld = ((CraftWorld) this.getOwner().getWorld()).getHandle();
|
|
||||||
this.uuid = UUID.randomUUID();
|
|
||||||
(this.npc = new EntityPlayer(nmsServer, nmsWorld, new GameProfile(this.uuid, this.name),
|
|
||||||
new PlayerInteractManager((World) nmsWorld))).setLocation(this.location.getX(), this.location.getY(),
|
|
||||||
this.location.getZ(), 0.0f, 0.0f);
|
|
||||||
this.npc.collides = false;
|
|
||||||
this.npc.setInvisible(true);
|
|
||||||
this.entityId = this.npc.getId();
|
|
||||||
final PlayerConnection connection = ((CraftPlayer) this.getOwner()).getHandle().playerConnection;
|
|
||||||
connection.sendPacket(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.ADD_PLAYER,
|
|
||||||
new EntityPlayer[] { this.npc }));
|
|
||||||
connection.sendPacket(new PacketPlayOutNamedEntitySpawn((EntityHuman) this.npc));
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean up = true;
|
|
||||||
|
|
||||||
public void move(PlayerMoveEvent e) {
|
|
||||||
if (e.getTo().getPitch() <= -32.5) {
|
|
||||||
if (e.getTo().getPitch() <= -82.5) {
|
|
||||||
Location eyelocation = e.getPlayer().getEyeLocation();
|
|
||||||
Vector vec = e.getPlayer().getLocation().getDirection();
|
|
||||||
vec.setX(-3 * vec.getX());
|
|
||||||
vec.setY(e.getPlayer().getLocation().getY() - 8.25);
|
|
||||||
vec.setZ(-3 * vec.getZ());
|
|
||||||
Location back = eyelocation.add(vec);
|
|
||||||
this.location = back; // TODO
|
|
||||||
this.npc.setPositionRotation(back.getX(), back.getY(), back.getZ(), (float)new Random().nextFloat() * 20, (float)new Random().nextFloat() * 20);
|
|
||||||
((CraftPlayer) this.getOwner()).getHandle().playerConnection.sendPacket(new PacketPlayOutEntityTeleport(npc));
|
|
||||||
if (new Random().nextInt(50) == 25 && this.npc.isInvisible()) {
|
|
||||||
this.npc.setInvisible(false);
|
|
||||||
((CraftPlayer) this.getOwner()).getHandle().playerConnection.sendPacket(new PacketPlayOutEntityMetadata(entityId, npc.getDataWatcher(), false));
|
|
||||||
new BukkitRunnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
npc.setInvisible(true);
|
|
||||||
((CraftPlayer) getOwner()).getHandle().playerConnection.sendPacket(new PacketPlayOutEntityMetadata(entityId, npc.getDataWatcher(), false));
|
|
||||||
}
|
|
||||||
}.runTaskLater(AntiCheat.getPlugin(), 4);
|
|
||||||
}
|
|
||||||
}else {
|
|
||||||
Location eyelocation = e.getPlayer().getEyeLocation();
|
|
||||||
Vector vec = e.getPlayer().getLocation().getDirection();
|
|
||||||
vec.setX(-3 * vec.getX());
|
|
||||||
vec.setY(e.getPlayer().getLocation().getY());
|
|
||||||
vec.setZ(-3 * vec.getZ());
|
|
||||||
Location back = eyelocation.add(vec);
|
|
||||||
this.location = back; // TODO
|
|
||||||
this.npc.setPositionRotation(back.getX(), back.getY(), back.getZ(), (float)new Random().nextFloat() * 20, (float)new Random().nextFloat() * 20);
|
|
||||||
((CraftPlayer) this.getOwner()).getHandle().playerConnection.sendPacket(new PacketPlayOutEntityTeleport(npc));
|
|
||||||
}
|
|
||||||
} else if (e.getTo().getPitch() >= 22) {
|
|
||||||
Location eyelocation = e.getPlayer().getEyeLocation();
|
|
||||||
Vector vec = e.getPlayer().getLocation().getDirection();
|
|
||||||
vec.setX(-3 * vec.getX());
|
|
||||||
vec.setY(e.getPlayer().getLocation().getY() - 0.4);
|
|
||||||
vec.setZ(-3 * vec.getZ());
|
|
||||||
Location back = eyelocation.add(vec);
|
|
||||||
this.location = back; // TODO
|
|
||||||
this.npc.setPositionRotation(back.getX(), back.getY(), back.getZ(), (float)new Random().nextFloat() * 20, (float)new Random().nextFloat() * 20);
|
|
||||||
((CraftPlayer) this.getOwner()).getHandle().playerConnection.sendPacket(new PacketPlayOutEntityTeleport(npc));
|
|
||||||
} else {
|
|
||||||
Location eyelocation = e.getPlayer().getEyeLocation();
|
|
||||||
Vector vec = e.getPlayer().getLocation().getDirection();
|
|
||||||
vec.setX(-1.95 * vec.getX());
|
|
||||||
if (up)
|
|
||||||
vec.setY(vec.getY() + 0.5);
|
|
||||||
else
|
|
||||||
vec.setY(vec.getY() - 0.25);
|
|
||||||
if (new Random().nextInt(10) == 5)
|
|
||||||
up = !up;
|
|
||||||
vec.setZ(-1.95 * vec.getZ());
|
|
||||||
Location back = eyelocation.add(vec);
|
|
||||||
this.location = back; // TODO
|
|
||||||
this.npc.setPositionRotation(back.getX(), back.getY(), back.getZ(), (float)new Random().nextFloat() * 20, (float)new Random().nextFloat() * 20);
|
|
||||||
((CraftPlayer) this.getOwner()).getHandle().playerConnection
|
|
||||||
.sendPacket(new PacketPlayOutEntityTeleport(npc));
|
|
||||||
if (new Random().nextInt(1000) == 500 && this.npc.isInvisible()) {
|
|
||||||
this.npc.setInvisible(false);
|
|
||||||
((CraftPlayer) this.getOwner()).getHandle().playerConnection.sendPacket(new PacketPlayOutEntityMetadata(entityId, npc.getDataWatcher(), false));
|
|
||||||
new BukkitRunnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
npc.setInvisible(true);
|
|
||||||
((CraftPlayer) getOwner()).getHandle().playerConnection.sendPacket(new PacketPlayOutEntityMetadata(entityId, npc.getDataWatcher(), false));
|
|
||||||
}
|
|
||||||
}.runTaskLater(AntiCheat.getPlugin(), 6);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public Player getOwner() {
|
|
||||||
return Bukkit.getPlayer(owner);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void damage(EntityDamageByEntityEvent e, Player p) {
|
|
||||||
if (p != getOwner() || this.npc == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (new Random().nextBoolean() && this.npc.isInvisible()) {
|
|
||||||
this.npc.setInvisible(false);
|
|
||||||
((CraftPlayer) this.getOwner()).getHandle().playerConnection.sendPacket(new PacketPlayOutEntityMetadata(entityId, npc.getDataWatcher(), false));
|
|
||||||
new BukkitRunnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
npc.setInvisible(true);
|
|
||||||
((CraftPlayer) getOwner()).getHandle().playerConnection.sendPacket(new PacketPlayOutEntityMetadata(entityId, npc.getDataWatcher(), false));
|
|
||||||
}
|
|
||||||
}.runTaskLater(AntiCheat.getPlugin(), 6 + new Random().nextInt(7));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void damage() {
|
|
||||||
if (this.npc == null || this.getOwner() == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (new Random().nextBoolean() && this.npc.isInvisible()) {
|
|
||||||
this.npc.setInvisible(false);
|
|
||||||
((CraftPlayer) this.getOwner()).getHandle().playerConnection.sendPacket(new PacketPlayOutEntityMetadata(entityId, npc.getDataWatcher(), false));
|
|
||||||
new BukkitRunnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
npc.setInvisible(true);
|
|
||||||
((CraftPlayer) getOwner()).getHandle().playerConnection.sendPacket(new PacketPlayOutEntityMetadata(entityId, npc.getDataWatcher(), false));
|
|
||||||
}
|
|
||||||
}.runTaskLater(AntiCheat.getPlugin(), 6 + new Random().nextInt(8));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,3 +1,22 @@
|
|||||||
|
/*
|
||||||
|
* AntiCheatReloaded for Bukkit and Spigot.
|
||||||
|
* Copyright (c) 2012-2015 AntiCheat Team
|
||||||
|
* Copyright (c) 2016-2020 Rammelkast
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
package com.rammelkast.anticheatreloaded.util;
|
package com.rammelkast.anticheatreloaded.util;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
@@ -6,31 +25,11 @@ import java.util.Random;
|
|||||||
|
|
||||||
public class NameGenerator {
|
public class NameGenerator {
|
||||||
|
|
||||||
private static final List<String> BEGIN = Arrays.asList(new String[]{
|
private static final List<String> BEGIN = Arrays.asList(new String[] { "Pixel", "Pro", "NoHax", "Just", "That",
|
||||||
"Pixel",
|
"New", "Ultra", "Killer", "Swift", "Anarchy", "Yolo", "Rammel" });
|
||||||
"Pro",
|
|
||||||
"NoHax",
|
|
||||||
"Just",
|
|
||||||
"That",
|
|
||||||
"New",
|
|
||||||
"Ultra",
|
|
||||||
"Killer",
|
|
||||||
"Swift"
|
|
||||||
});
|
|
||||||
|
|
||||||
private static final List<String> END = Arrays.asList(new String[]{
|
private static final List<String> END = Arrays.asList(new String[] { "Gamer", "PvP", "JustYolo", "Gaming",
|
||||||
"Gamer",
|
"Minecraft", "Games", "Bawz", "Tech", "Noob", "Extra", "kast", "" + new Random().nextInt(100) });
|
||||||
"PvP",
|
|
||||||
"JustYolo",
|
|
||||||
"Gaming",
|
|
||||||
"Minecraft",
|
|
||||||
"Games",
|
|
||||||
"Bawz",
|
|
||||||
"1",
|
|
||||||
"51",
|
|
||||||
"99",
|
|
||||||
"" + new Random().nextInt(100)
|
|
||||||
});
|
|
||||||
|
|
||||||
public static String generateName() {
|
public static String generateName() {
|
||||||
Random r = new Random();
|
Random r = new Random();
|
||||||
|
|||||||
@@ -1,37 +0,0 @@
|
|||||||
package com.rammelkast.anticheatreloaded.util;
|
|
||||||
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
public class NameUtil {
|
|
||||||
|
|
||||||
private static String[] firstParts = new String[] {
|
|
||||||
"Gamer",
|
|
||||||
"Pixel",
|
|
||||||
"Derp",
|
|
||||||
"Random",
|
|
||||||
"That",
|
|
||||||
"NoHaxJust",
|
|
||||||
"Derp",
|
|
||||||
"Fun",
|
|
||||||
"Luigi"
|
|
||||||
};
|
|
||||||
|
|
||||||
private static String[] secondParts = new String[] {
|
|
||||||
"01",
|
|
||||||
"Boy",
|
|
||||||
"Guy",
|
|
||||||
"Mario",
|
|
||||||
"Plain",
|
|
||||||
"Simple",
|
|
||||||
"NotHacking",
|
|
||||||
"Random",
|
|
||||||
"11",
|
|
||||||
"06"
|
|
||||||
};
|
|
||||||
|
|
||||||
private static Random theRandom = new Random();
|
|
||||||
|
|
||||||
public static String getRandomName() {
|
|
||||||
return firstParts[theRandom.nextInt(firstParts.length - 1)] + secondParts[theRandom.nextInt(secondParts.length - 1)];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,228 +0,0 @@
|
|||||||
/*
|
|
||||||
* AntiCheat for Bukkit.
|
|
||||||
* Copyright (C) 2012-2014 AntiCheat Team | http://gravitydevelopment.net
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.rammelkast.anticheatreloaded.util;
|
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.command.CommandSender;
|
|
||||||
import org.bukkit.configuration.file.FileConfiguration;
|
|
||||||
import org.bukkit.configuration.file.YamlConfiguration;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
|
|
||||||
import com.rammelkast.anticheatreloaded.AntiCheat;
|
|
||||||
import com.rammelkast.anticheatreloaded.config.Configuration;
|
|
||||||
import com.rammelkast.anticheatreloaded.config.providers.Magic;
|
|
||||||
|
|
||||||
import java.io.*;
|
|
||||||
import java.lang.reflect.Field;
|
|
||||||
import java.net.HttpURLConnection;
|
|
||||||
import java.net.URL;
|
|
||||||
import java.net.URLEncoder;
|
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class PastebinReport {
|
|
||||||
private static final String DATE = new SimpleDateFormat("yyyy-MM-dd kk:mm Z").format(new Date());
|
|
||||||
private static final String API_KEY = "d5ac92da966edb97a97860e6a052784f";
|
|
||||||
|
|
||||||
private StringBuilder report = new StringBuilder();
|
|
||||||
private String url = "";
|
|
||||||
|
|
||||||
public PastebinReport(CommandSender cs) {
|
|
||||||
Player player = null;
|
|
||||||
if (cs instanceof Player) {
|
|
||||||
player = (Player) cs;
|
|
||||||
}
|
|
||||||
createReport(player);
|
|
||||||
try {
|
|
||||||
writeReport();
|
|
||||||
} catch (IOException e) {
|
|
||||||
}
|
|
||||||
postReport();
|
|
||||||
}
|
|
||||||
|
|
||||||
public PastebinReport(CommandSender cs, Player tp) {
|
|
||||||
createReport(tp);
|
|
||||||
try {
|
|
||||||
writeReport();
|
|
||||||
} catch (IOException e) {
|
|
||||||
}
|
|
||||||
postReport();
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getURL() {
|
|
||||||
return url;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void appendPermissionsTester(Player player) {
|
|
||||||
if (player == null) {
|
|
||||||
append("No player defined.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (Permission node : Permission.values()) {
|
|
||||||
report.append(player.getName() + ": " + node.toString() + " " + node.get(player));
|
|
||||||
if (node.get(player) && !node.whichPermission(player).equals(node.toString())) {
|
|
||||||
report.append(" (Applied by " + node.whichPermission(player) + ")");
|
|
||||||
}
|
|
||||||
report.append('\n');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void createReport(Player player) {
|
|
||||||
if (Bukkit.getPluginManager().getPlugin("NoCheatPlus") != null) {
|
|
||||||
append("------------ WARNING! ------------");
|
|
||||||
append("This report was run with NoCheatPlus enabled. Results may be inaccurate." + '\n');
|
|
||||||
}
|
|
||||||
append("------------ AntiCheat Report - " + DATE + " ------------");
|
|
||||||
appendSystemInfo();
|
|
||||||
append("------------Last 30 logs------------");
|
|
||||||
appendLogs();
|
|
||||||
append("------------Permission Tester------------");
|
|
||||||
appendPermissionsTester(player);
|
|
||||||
append("------------Event Chains------------");
|
|
||||||
appendEventHandlers();
|
|
||||||
append("------------Magic Diff------------");
|
|
||||||
appendMagicDiff();
|
|
||||||
append("-----------End Of Report------------");
|
|
||||||
}
|
|
||||||
|
|
||||||
private void appendLogs() {
|
|
||||||
List<String> logs = AntiCheat.getManager().getLoggingManager().getLastLogs();
|
|
||||||
if (logs.size() == 0) {
|
|
||||||
append("No recent logs.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
for (String log : logs) {
|
|
||||||
append(log);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void appendSystemInfo() {
|
|
||||||
Runtime runtime = Runtime.getRuntime();
|
|
||||||
Configuration config = AntiCheat.getManager().getConfiguration();
|
|
||||||
append("AntiCheat Version: " + AntiCheat.getVersion());
|
|
||||||
append("Server Version: " + Bukkit.getVersion());
|
|
||||||
append("Server Implementation: " + Bukkit.getName());
|
|
||||||
append("Server ID: " + Bukkit.getServerId());
|
|
||||||
append("NMS Version: " + VersionUtil.getVersion());
|
|
||||||
append("Java Version: " + System.getProperty("java.vendor") + " " + System.getProperty("java.version"));
|
|
||||||
append("OS: " + System.getProperty("os.name") + " " + System.getProperty("os.version"));
|
|
||||||
append("Free Memory: " + runtime.freeMemory() / 1024 / 1024 + "MB");
|
|
||||||
append("Max Memory: " + runtime.maxMemory() / 1024 / 1024 + "MB");
|
|
||||||
append("Total Memory: " + runtime.totalMemory() / 1024 / 1024 + "MB");
|
|
||||||
append("Online Mode: " + Bukkit.getOnlineMode());
|
|
||||||
append("Players: " + Bukkit.getOnlinePlayers().size() + "/" + Bukkit.getMaxPlayers());
|
|
||||||
append("Plugin Count: " + Bukkit.getPluginManager().getPlugins().length);
|
|
||||||
append("Plugin Uptime: " + ((System.currentTimeMillis() - AntiCheat.getPlugin().getLoadTime()) / 1000) / 60 + " minutes");
|
|
||||||
append("Enterprise: " + config.getConfig().enterprise.getValue());
|
|
||||||
if (config.getConfig().enterprise.getValue()) {
|
|
||||||
append("- Server name: " + config.getEnterprise().serverName.getValue());
|
|
||||||
append("- Database type: " + config.getEnterprise().database.getType());
|
|
||||||
append("- Groups source: " + (config.getEnterprise().configGroups.getValue() ? "Database" : "Flatfile"));
|
|
||||||
append("- Rules source: " + (config.getEnterprise().configRules.getValue() ? "Database" : "Flatfile"));
|
|
||||||
append("- Levels source: " + (config.getEnterprise().syncLevels.getValue() ? "Database" : "Flatfile"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void appendMagicDiff() {
|
|
||||||
// This is hacky, and I like it
|
|
||||||
Magic magic = AntiCheat.getManager().getConfiguration().getMagic();
|
|
||||||
FileConfiguration file = YamlConfiguration.loadConfiguration(new File(AntiCheat.getPlugin().getDataFolder(), "magic.yml"));
|
|
||||||
boolean changed = false;
|
|
||||||
for (Field field : Magic.class.getFields()) {
|
|
||||||
Object defaultValue = file.get(field.getName());
|
|
||||||
try {
|
|
||||||
Field value = magic.getClass().getDeclaredField(field.getName());
|
|
||||||
String s1 = value.get(magic).toString();
|
|
||||||
String s2 = defaultValue.toString();
|
|
||||||
if (!s1.equals(s2) && !s1.equals(s2 + ".0")) {
|
|
||||||
changed = true;
|
|
||||||
append(field.getName() + ": " + s1 + " (Default: " + s2 + ")");
|
|
||||||
} else {
|
|
||||||
}
|
|
||||||
} catch (NoSuchFieldException ex) {
|
|
||||||
|
|
||||||
} catch (IllegalAccessException ex) {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!changed) {
|
|
||||||
append("No changes from default.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void appendEventHandlers() {
|
|
||||||
report.append(AntiCheat.getManager().getEventChainReport());
|
|
||||||
}
|
|
||||||
|
|
||||||
private void writeReport() throws IOException {
|
|
||||||
File f = new File(AntiCheat.getPlugin().getDataFolder() + "/report.txt");
|
|
||||||
FileWriter r = new FileWriter(f);
|
|
||||||
BufferedWriter writer = new BufferedWriter(r);
|
|
||||||
writer.write(report.toString());
|
|
||||||
writer.close();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void postReport() {
|
|
||||||
try {
|
|
||||||
URL urls = new URL("http://pastebin.com/api/api_post.php");
|
|
||||||
HttpURLConnection conn = (HttpURLConnection) urls.openConnection();
|
|
||||||
conn.setConnectTimeout(5000);
|
|
||||||
conn.setReadTimeout(5000);
|
|
||||||
conn.setRequestMethod("POST");
|
|
||||||
conn.addRequestProperty("Content-type", "application/x-www-form-urlencoded");
|
|
||||||
conn.setInstanceFollowRedirects(false);
|
|
||||||
conn.setDoOutput(true);
|
|
||||||
OutputStream out = conn.getOutputStream();
|
|
||||||
|
|
||||||
out.write(("api_option=paste" + "&api_dev_key=" + URLEncoder.encode(API_KEY, "utf-8") + "&api_paste_code=" + URLEncoder.encode(report.toString(), "utf-8") + "&api_paste_private=" + URLEncoder.encode("1", "utf-8") + "&api_paste_name=" + URLEncoder.encode("", "utf-8") + "&api_paste_expire_date=" + URLEncoder.encode("1M", "utf-8") + "&api_paste_format=" + URLEncoder.encode("text", "utf-8") + "&api_user_key=" + URLEncoder.encode("", "utf-8")).getBytes());
|
|
||||||
out.flush();
|
|
||||||
out.close();
|
|
||||||
|
|
||||||
if (conn.getResponseCode() == 200) {
|
|
||||||
InputStream receive = conn.getInputStream();
|
|
||||||
BufferedReader reader = new BufferedReader(new InputStreamReader(receive));
|
|
||||||
String line;
|
|
||||||
StringBuffer response = new StringBuffer();
|
|
||||||
while ((line = reader.readLine()) != null) {
|
|
||||||
response.append(line);
|
|
||||||
response.append("\r\n");
|
|
||||||
}
|
|
||||||
reader.close();
|
|
||||||
|
|
||||||
String result = response.toString().trim();
|
|
||||||
|
|
||||||
if (!result.contains("http://")) {
|
|
||||||
url = "Failed to post. Check report.txt";
|
|
||||||
} else {
|
|
||||||
url = result.trim();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
url = "Failed to post. Check report.txt";
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
url = "Failed to post. Check report.txt";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void append(String s) {
|
|
||||||
report.append(s + '\n');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* AntiCheat for Bukkit.
|
* AntiCheatReloaded for Bukkit and Spigot.
|
||||||
* Copyright (C) 2012-2014 AntiCheat Team | http://gravitydevelopment.net
|
* Copyright (c) 2012-2015 AntiCheat Team
|
||||||
|
* Copyright (c) 2016-2020 Rammelkast
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -22,46 +23,14 @@ import org.bukkit.command.CommandSender;
|
|||||||
|
|
||||||
public enum Permission {
|
public enum Permission {
|
||||||
/* Check Nodes */
|
/* Check Nodes */
|
||||||
CHECK_ZOMBE_FLY,
|
CHECK_ZOMBE_FLY, CHECK_ZOMBE_NOCLIP, CHECK_ZOMBE_CHEAT, CHECK_FLIGHT, CHECK_ELYTRA, CHECK_WATERWALK, CHECK_NOSWING, CHECK_FASTBREAK,
|
||||||
CHECK_ZOMBE_NOCLIP,
|
CHECK_FASTPLACE, CHECK_CHATSPAM, CHECK_COMMANDSPAM, CHECK_SPRINT, CHECK_SNEAK, CHECK_SPEED, CHECK_VCLIP,
|
||||||
CHECK_ZOMBE_CHEAT,
|
CHECK_SPIDER, CHECK_NOFALL, CHECK_FASTBOW, CHECK_FASTEAT, CHECK_FASTHEAL, CHECK_FORCEFIELD, CHECK_LONGREACH,
|
||||||
CHECK_FLY,
|
CHECK_FASTPROJECTILE, CHECK_ITEMSPAM, CHECK_VISUAL, CHECK_FASTINVENTORY, CHECK_AUTOTOOL, CHECK_KILLAURA, CHECK_BLINK, CHECK_VELOCITY, CHECK_CRITICALS, CHECK_UNICODE,
|
||||||
CHECK_WATERWALK,
|
|
||||||
CHECK_NOSWING,
|
|
||||||
CHECK_FASTBREAK,
|
|
||||||
CHECK_FASTPLACE,
|
|
||||||
CHECK_CHATSPAM,
|
|
||||||
CHECK_COMMANDSPAM,
|
|
||||||
CHECK_SPRINT,
|
|
||||||
CHECK_SNEAK,
|
|
||||||
CHECK_SPEED,
|
|
||||||
CHECK_VCLIP,
|
|
||||||
CHECK_SPIDER,
|
|
||||||
CHECK_NOFALL,
|
|
||||||
CHECK_FASTBOW,
|
|
||||||
CHECK_FASTEAT,
|
|
||||||
CHECK_FASTHEAL,
|
|
||||||
CHECK_FORCEFIELD,
|
|
||||||
CHECK_LONGREACH,
|
|
||||||
CHECK_FASTPROJECTILE,
|
|
||||||
CHECK_ITEMSPAM,
|
|
||||||
CHECK_VISUAL,
|
|
||||||
CHECK_FASTINVENTORY,
|
|
||||||
CHECK_AUTOTOOL,
|
|
||||||
|
|
||||||
/* System Nodes */
|
/* System Nodes */
|
||||||
SYSTEM_LOG,
|
SYSTEM_LOG, SYSTEM_RESET, SYSTEM_SPY, SYSTEM_HELP, SYSTEM_UPDATE, SYSTEM_REPORT, SYSTEM_ALERT, SYSTEM_NOTICE,
|
||||||
SYSTEM_RESET,
|
SYSTEM_CALIBRATE, SYSTEM_CHECK, SYSTEM_DEBUG, SYSTEM_RELOAD;
|
||||||
SYSTEM_SPY,
|
|
||||||
SYSTEM_HELP,
|
|
||||||
SYSTEM_UPDATE,
|
|
||||||
SYSTEM_REPORT,
|
|
||||||
SYSTEM_ALERT,
|
|
||||||
SYSTEM_NOTICE,
|
|
||||||
SYSTEM_CALIBRATE,
|
|
||||||
SYSTEM_CHECK,
|
|
||||||
SYSTEM_DEBUG,
|
|
||||||
SYSTEM_RELOAD, CHECK_KILLAURA, CHECK_BLINK, VELOCITY, CRITICALS;
|
|
||||||
|
|
||||||
private static final String PERMISSION_ALL = "anticheat.*";
|
private static final String PERMISSION_ALL = "anticheat.*";
|
||||||
private static final String PERMISSION_SPAM = "anticheat.check.spam";
|
private static final String PERMISSION_SPAM = "anticheat.check.spam";
|
||||||
@@ -72,7 +41,8 @@ public enum Permission {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean get(CommandSender cs) {
|
public boolean get(CommandSender cs) {
|
||||||
if ((this == CHECK_CHATSPAM || this == CHECK_COMMANDSPAM) && cs.hasPermission(PERMISSION_SPAM)) return true;
|
if ((this == CHECK_CHATSPAM || this == CHECK_COMMANDSPAM) && cs.hasPermission(PERMISSION_SPAM))
|
||||||
|
return true;
|
||||||
return cs.hasPermission(toString()) || cs.hasPermission(getBase()) || cs.hasPermission(PERMISSION_ALL);
|
return cs.hasPermission(toString()) || cs.hasPermission(getBase()) || cs.hasPermission(PERMISSION_ALL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -81,7 +51,7 @@ public enum Permission {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String whichPermission(CommandSender cs) {
|
public String whichPermission(CommandSender cs) {
|
||||||
for (String s : new String[]{PERMISSION_ALL, getBase(), toString()}) {
|
for (String s : new String[] { PERMISSION_ALL, getBase(), toString() }) {
|
||||||
if (cs.hasPermission(s)) {
|
if (cs.hasPermission(s)) {
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* AntiCheat for Bukkit.
|
* AntiCheatReloaded for Bukkit and Spigot.
|
||||||
* Copyright (C) 2012-2014 AntiCheat Team | http://gravitydevelopment.net
|
* Copyright (c) 2012-2015 AntiCheat Team
|
||||||
|
* Copyright (c) 2016-2020 Rammelkast
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -23,12 +24,7 @@ import org.bukkit.Material;
|
|||||||
public enum ToolHardness {
|
public enum ToolHardness {
|
||||||
|
|
||||||
// NOTHING(null, 1.5)
|
// NOTHING(null, 1.5)
|
||||||
WOOD(0.75D),
|
WOOD(0.75D), STONE(0.40D), IRON(0.25D), DIAMOND(0.20D), SHEARS(0.55D), GOLD(0.15D);
|
||||||
STONE(0.40D),
|
|
||||||
IRON(0.25D),
|
|
||||||
DIAMOND(0.20D),
|
|
||||||
SHEARS(0.55D),
|
|
||||||
GOLD(0.15D);
|
|
||||||
|
|
||||||
double hardness;
|
double hardness;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* AntiCheat for Bukkit.
|
* AntiCheatReloaded for Bukkit and Spigot.
|
||||||
* Copyright (C) 2012-2014 AntiCheat Team | http://gravitydevelopment.net
|
* Copyright (c) 2012-2015 AntiCheat Team
|
||||||
|
* Copyright (c) 2016-2020 Rammelkast
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -24,7 +25,7 @@ import org.bukkit.entity.Player;
|
|||||||
import org.bukkit.inventory.Inventory;
|
import org.bukkit.inventory.Inventory;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
import com.rammelkast.anticheatreloaded.AntiCheat;
|
import com.rammelkast.anticheatreloaded.AntiCheatReloaded;
|
||||||
import com.rammelkast.anticheatreloaded.check.CheckType;
|
import com.rammelkast.anticheatreloaded.check.CheckType;
|
||||||
import com.rammelkast.anticheatreloaded.config.Configuration;
|
import com.rammelkast.anticheatreloaded.config.Configuration;
|
||||||
import com.rammelkast.anticheatreloaded.util.rule.Rule;
|
import com.rammelkast.anticheatreloaded.util.rule.Rule;
|
||||||
@@ -41,7 +42,7 @@ public class User {
|
|||||||
private int level = 0;
|
private int level = 0;
|
||||||
private Location goodLocation;
|
private Location goodLocation;
|
||||||
private List<ItemStack> inventorySnapshot = null;
|
private List<ItemStack> inventorySnapshot = null;
|
||||||
private Configuration config = AntiCheat.getManager().getConfiguration();
|
private Configuration config = AntiCheatReloaded.getManager().getConfiguration();
|
||||||
private int toX, toY, toZ;
|
private int toX, toY, toZ;
|
||||||
private String[] messages = new String[2];
|
private String[] messages = new String[2];
|
||||||
private Long[] messageTimes = new Long[2];
|
private Long[] messageTimes = new Long[2];
|
||||||
@@ -67,12 +68,11 @@ public class User {
|
|||||||
*
|
*
|
||||||
* @param name Player's name
|
* @param name Player's name
|
||||||
*/
|
*/
|
||||||
/* public User(String name) {
|
/*
|
||||||
this.uuid = Bukkit.getPlayer(name).getUniqueId();
|
* public User(String name) { this.uuid = Bukkit.getPlayer(name).getUniqueId();
|
||||||
this.name = name;
|
* this.name = name; this.id = getPlayer() != null && getPlayer().isOnline() ?
|
||||||
this.id = getPlayer() != null && getPlayer().isOnline() ? getPlayer().getEntityId() : -1;
|
* getPlayer().getEntityId() : -1; }
|
||||||
}
|
*/
|
||||||
*/
|
|
||||||
/**
|
/**
|
||||||
* Get the player's UUID
|
* Get the player's UUID
|
||||||
*
|
*
|
||||||
@@ -126,9 +126,12 @@ public class User {
|
|||||||
public Group getGroup() {
|
public Group getGroup() {
|
||||||
List<Group> groups = config.getGroups().getGroups();
|
List<Group> groups = config.getGroups().getGroups();
|
||||||
for (int i = 0; i < groups.size(); i++) {
|
for (int i = 0; i < groups.size(); i++) {
|
||||||
if (i == 0 && level < groups.get(i).getLevel()) break;
|
if (i == 0 && level < groups.get(i).getLevel())
|
||||||
else if (i == groups.size() - 1) return groups.get(i);
|
break;
|
||||||
else if (level >= groups.get(i).getLevel() && level < groups.get(i + 1).getLevel()) return groups.get(i);
|
else if (i == groups.size() - 1)
|
||||||
|
return groups.get(i);
|
||||||
|
else if (level >= groups.get(i).getLevel() && level < groups.get(i + 1).getLevel())
|
||||||
|
return groups.get(i);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -151,7 +154,7 @@ public class User {
|
|||||||
// Check levels
|
// Check levels
|
||||||
for (Group l : getLevels()) {
|
for (Group l : getLevels()) {
|
||||||
if (l.getLevel() == level) {
|
if (l.getLevel() == level) {
|
||||||
AntiCheat.getManager().getUserManager().alert(this, l, type);
|
AntiCheatReloaded.getManager().getUserManager().alert(this, l, type);
|
||||||
if (l.getLevel() == config.getGroups().getHighestLevel()) {
|
if (l.getLevel() == config.getGroups().getHighestLevel()) {
|
||||||
level = l.getLevel() - 10;
|
level = l.getLevel() - 10;
|
||||||
}
|
}
|
||||||
@@ -179,7 +182,8 @@ public class User {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the users level to a specific value. Must be 0 < level < config-defined highest level
|
* Set the users level to a specific value. Must be 0 < level < config-defined
|
||||||
|
* highest level
|
||||||
*
|
*
|
||||||
* @param level level to set
|
* @param level level to set
|
||||||
* @return true if the level was valid and set properly
|
* @return true if the level was valid and set properly
|
||||||
@@ -230,7 +234,8 @@ public class User {
|
|||||||
* @return true if the location was valid and set properly
|
* @return true if the location was valid and set properly
|
||||||
*/
|
*/
|
||||||
public boolean setGoodLocation(Location location) {
|
public boolean setGoodLocation(Location location) {
|
||||||
if (Utilities.cantStandAtExp(location) || (location.getBlock().isLiquid() && !Utilities.isFullyInWater(location))) {
|
if (Utilities.cantStandAtExp(location)
|
||||||
|
|| (location.getBlock().isLiquid() && !Utilities.isFullyInWater(location))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* AntiCheat for Bukkit.
|
* AntiCheatReloaded for Bukkit and Spigot.
|
||||||
* Copyright (C) 2012-2014 AntiCheat Team | http://gravitydevelopment.net
|
* Copyright (c) 2012-2015 AntiCheat Team
|
||||||
|
* Copyright (c) 2016-2020 Rammelkast
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -28,7 +29,7 @@ import org.bukkit.entity.Player;
|
|||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.util.NumberConversions;
|
import org.bukkit.util.NumberConversions;
|
||||||
|
|
||||||
import com.rammelkast.anticheatreloaded.AntiCheat;
|
import com.rammelkast.anticheatreloaded.AntiCheatReloaded;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@@ -40,7 +41,6 @@ import java.util.regex.Pattern;
|
|||||||
public final class Utilities {
|
public final class Utilities {
|
||||||
private static final List<Material> INSTANT_BREAK = new ArrayList<Material>();
|
private static final List<Material> INSTANT_BREAK = new ArrayList<Material>();
|
||||||
private static final List<Material> FOOD = new ArrayList<Material>();
|
private static final List<Material> FOOD = new ArrayList<Material>();
|
||||||
private static final List<Material> INTERACTABLE = new ArrayList<Material>();
|
|
||||||
private static final Map<Material, Material> COMBO = new HashMap<Material, Material>();
|
private static final Map<Material, Material> COMBO = new HashMap<Material, Material>();
|
||||||
|
|
||||||
public static final String SPY_METADATA = "ac-spydata";
|
public static final String SPY_METADATA = "ac-spydata";
|
||||||
@@ -59,17 +59,17 @@ public final class Utilities {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (String msg : message) {
|
for (String msg : message) {
|
||||||
AntiCheat.getManager().log(msg);
|
AntiCheatReloaded.getManager().log(msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if only the block beneath them is standable (includes water + lava)
|
* Check if only the block beneath them is standable (includes water + lava)
|
||||||
|
*
|
||||||
* @param block the block to check (under)
|
* @param block the block to check (under)
|
||||||
* @return true if they cannot stand there
|
* @return true if they cannot stand there
|
||||||
*/
|
*/
|
||||||
public static boolean cantStandAtSingle(Block block)
|
public static boolean cantStandAtSingle(Block block) {
|
||||||
{
|
|
||||||
// TODO: Implement Better to reduce false positives (done? lets test...)
|
// TODO: Implement Better to reduce false positives (done? lets test...)
|
||||||
Block otherBlock = block.getLocation().add(0, -0.5, 0).getBlock();
|
Block otherBlock = block.getLocation().add(0, -0.5, 0).getBlock();
|
||||||
boolean center = otherBlock.getType() == Material.AIR;
|
boolean center = otherBlock.getType() == Material.AIR;
|
||||||
@@ -93,17 +93,20 @@ public final class Utilities {
|
|||||||
* @return true if the player should be unable to stand here
|
* @return true if the player should be unable to stand here
|
||||||
*/
|
*/
|
||||||
public static boolean cantStandAtExp(Location location) {
|
public static boolean cantStandAtExp(Location location) {
|
||||||
return cantStandAt(new Location(location.getWorld(), fixXAxis(location.getX()), location.getY() - 0.01D, location.getBlockZ()).getBlock());
|
return cantStandAt(new Location(location.getWorld(), fixXAxis(location.getX()), location.getY() - 0.01D,
|
||||||
|
location.getBlockZ()).getBlock());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determine whether cannot stand on the block's immediately surroundings (North, East, South, West)
|
* Determine whether cannot stand on the block's immediately surroundings
|
||||||
|
* (North, East, South, West)
|
||||||
*
|
*
|
||||||
* @param block the block to check
|
* @param block the block to check
|
||||||
* @return true if a player cannot stand in the immediate vicinity
|
* @return true if a player cannot stand in the immediate vicinity
|
||||||
*/
|
*/
|
||||||
public static boolean cantStandClose(Block block) {
|
public static boolean cantStandClose(Block block) {
|
||||||
return !canStand(block.getRelative(BlockFace.NORTH)) && !canStand(block.getRelative(BlockFace.EAST)) && !canStand(block.getRelative(BlockFace.SOUTH)) && !canStand(block.getRelative(BlockFace.WEST));
|
return !canStand(block.getRelative(BlockFace.NORTH)) && !canStand(block.getRelative(BlockFace.EAST))
|
||||||
|
&& !canStand(block.getRelative(BlockFace.SOUTH)) && !canStand(block.getRelative(BlockFace.WEST));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -113,7 +116,9 @@ public final class Utilities {
|
|||||||
* @return true if a player cannot stand in areas further away from the block
|
* @return true if a player cannot stand in areas further away from the block
|
||||||
*/
|
*/
|
||||||
public static boolean cantStandFar(Block block) {
|
public static boolean cantStandFar(Block block) {
|
||||||
return !canStand(block.getRelative(BlockFace.NORTH_WEST)) && !canStand(block.getRelative(BlockFace.NORTH_EAST)) && !canStand(block.getRelative(BlockFace.SOUTH_WEST)) && !canStand(block.getRelative(BlockFace.SOUTH_EAST));
|
return !canStand(block.getRelative(BlockFace.NORTH_WEST)) && !canStand(block.getRelative(BlockFace.NORTH_EAST))
|
||||||
|
&& !canStand(block.getRelative(BlockFace.SOUTH_WEST))
|
||||||
|
&& !canStand(block.getRelative(BlockFace.SOUTH_EAST));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -135,17 +140,23 @@ public final class Utilities {
|
|||||||
public static boolean isFullyInWater(Location player) {
|
public static boolean isFullyInWater(Location player) {
|
||||||
double touchedX = fixXAxis(player.getX());
|
double touchedX = fixXAxis(player.getX());
|
||||||
|
|
||||||
// Yes, this doesn't make sense, but it's supposed to fix some false positives in water walk.
|
// Yes, this doesn't make sense, but it's supposed to fix some false positives
|
||||||
|
// in water walk.
|
||||||
// Think of it as 2 negatives = a positive :)
|
// Think of it as 2 negatives = a positive :)
|
||||||
if (!(new Location(player.getWorld(), touchedX, player.getY(), player.getBlockZ()).getBlock()).isLiquid() && !(new Location(player.getWorld(), touchedX, Math.round(player.getY()), player.getBlockZ()).getBlock()).isLiquid()) {
|
if (!(new Location(player.getWorld(), touchedX, player.getY(), player.getBlockZ()).getBlock()).isLiquid()
|
||||||
|
&& !(new Location(player.getWorld(), touchedX, Math.round(player.getY()), player.getBlockZ())
|
||||||
|
.getBlock()).isLiquid()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (new Location(player.getWorld(), touchedX, player.getY(), player.getBlockZ()).getBlock()).isLiquid() && (new Location(player.getWorld(), touchedX, Math.round(player.getY()), player.getBlockZ()).getBlock()).isLiquid();
|
return (new Location(player.getWorld(), touchedX, player.getY(), player.getBlockZ()).getBlock()).isLiquid()
|
||||||
|
&& (new Location(player.getWorld(), touchedX, Math.round(player.getY()), player.getBlockZ()).getBlock())
|
||||||
|
.isLiquid();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fixes a player's X position to determine the block they are on, even if they're on the edge
|
* Fixes a player's X position to determine the block they are on, even if
|
||||||
|
* they're on the edge
|
||||||
*
|
*
|
||||||
* @param x player's x position
|
* @param x player's x position
|
||||||
* @return fixed x position
|
* @return fixed x position
|
||||||
@@ -216,15 +227,8 @@ public final class Utilities {
|
|||||||
*/
|
*/
|
||||||
public static boolean isSlab(Block block) {
|
public static boolean isSlab(Block block) {
|
||||||
Material type = block.getType();
|
Material type = block.getType();
|
||||||
switch (type) {
|
return type.name().endsWith("SLAB");
|
||||||
case STEP:
|
// TODO does this even work?
|
||||||
case DOUBLE_STEP:
|
|
||||||
case WOOD_STEP:
|
|
||||||
case WOOD_DOUBLE_STEP:
|
|
||||||
return true;
|
|
||||||
default:
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -235,30 +239,8 @@ public final class Utilities {
|
|||||||
*/
|
*/
|
||||||
public static boolean isStair(Block block) {
|
public static boolean isStair(Block block) {
|
||||||
Material type = block.getType();
|
Material type = block.getType();
|
||||||
switch (type) {
|
return type.name().endsWith("STAIRS");
|
||||||
case WOOD_STAIRS:
|
// TODO does this even work?
|
||||||
case SPRUCE_WOOD_STAIRS:
|
|
||||||
case SMOOTH_STAIRS:
|
|
||||||
case SANDSTONE_STAIRS:
|
|
||||||
case QUARTZ_STAIRS:
|
|
||||||
case JUNGLE_WOOD_STAIRS:
|
|
||||||
case NETHER_BRICK_STAIRS:
|
|
||||||
case BIRCH_WOOD_STAIRS:
|
|
||||||
case COBBLESTONE_STAIRS:
|
|
||||||
return true;
|
|
||||||
default:
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Determine whether a player can interact with this material
|
|
||||||
*
|
|
||||||
* @param m material to check
|
|
||||||
* @return true if interactable
|
|
||||||
*/
|
|
||||||
public static boolean isInteractable(Material m) {
|
|
||||||
return INTERACTABLE.contains(m);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -279,9 +261,12 @@ public final class Utilities {
|
|||||||
*/
|
*/
|
||||||
public static boolean isOnLilyPad(Player player) {
|
public static boolean isOnLilyPad(Player player) {
|
||||||
Block block = player.getLocation().getBlock();
|
Block block = player.getLocation().getBlock();
|
||||||
Material lily = Material.WATER_LILY;
|
Material lily = Material.LILY_PAD;
|
||||||
// TODO: Can we fix X this?
|
// TODO: Can we fix X this?
|
||||||
return block.getType() == lily || block.getRelative(BlockFace.NORTH).getType() == lily || block.getRelative(BlockFace.SOUTH).getType() == lily || block.getRelative(BlockFace.EAST).getType() == lily || block.getRelative(BlockFace.WEST).getType() == lily;
|
return block.getType() == lily || block.getRelative(BlockFace.NORTH).getType() == lily
|
||||||
|
|| block.getRelative(BlockFace.SOUTH).getType() == lily
|
||||||
|
|| block.getRelative(BlockFace.EAST).getType() == lily
|
||||||
|
|| block.getRelative(BlockFace.WEST).getType() == lily;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -291,7 +276,8 @@ public final class Utilities {
|
|||||||
* @return true if submersed
|
* @return true if submersed
|
||||||
*/
|
*/
|
||||||
public static boolean isSubmersed(Player player) {
|
public static boolean isSubmersed(Player player) {
|
||||||
return player.getLocation().getBlock().isLiquid() && player.getLocation().getBlock().getRelative(BlockFace.UP).isLiquid();
|
return player.getLocation().getBlock().isLiquid()
|
||||||
|
&& player.getLocation().getBlock().getRelative(BlockFace.UP).isLiquid();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -301,7 +287,9 @@ public final class Utilities {
|
|||||||
* @return true if in water
|
* @return true if in water
|
||||||
*/
|
*/
|
||||||
public static boolean isInWater(Player player) {
|
public static boolean isInWater(Player player) {
|
||||||
return player.getLocation().getBlock().isLiquid() || player.getLocation().getBlock().getRelative(BlockFace.DOWN).isLiquid() || player.getLocation().getBlock().getRelative(BlockFace.UP).isLiquid();
|
return player.getLocation().getBlock().isLiquid()
|
||||||
|
|| player.getLocation().getBlock().getRelative(BlockFace.DOWN).isLiquid()
|
||||||
|
|| player.getLocation().getBlock().getRelative(BlockFace.UP).isLiquid();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -311,7 +299,9 @@ public final class Utilities {
|
|||||||
* @return true if in web
|
* @return true if in web
|
||||||
*/
|
*/
|
||||||
public static boolean isInWeb(Player player) {
|
public static boolean isInWeb(Player player) {
|
||||||
return player.getLocation().getBlock().getType() == Material.WEB || player.getLocation().getBlock().getRelative(BlockFace.DOWN).getType() == Material.WEB || player.getLocation().getBlock().getRelative(BlockFace.UP).getType() == Material.WEB;
|
return player.getLocation().getBlock().getType() == Material.COBWEB
|
||||||
|
|| player.getLocation().getBlock().getRelative(BlockFace.DOWN).getType() == Material.COBWEB
|
||||||
|
|| player.getLocation().getBlock().getRelative(BlockFace.UP).getType() == Material.COBWEB;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -321,7 +311,8 @@ public final class Utilities {
|
|||||||
* @return true if climbable
|
* @return true if climbable
|
||||||
*/
|
*/
|
||||||
public static boolean isClimbableBlock(Block block) {
|
public static boolean isClimbableBlock(Block block) {
|
||||||
return block.getType() == Material.VINE || block.getType() == Material.LADDER || block.getType() == Material.WATER || block.getType() == Material.STATIONARY_WATER;
|
return block.getType() == Material.VINE || block.getType() == Material.LADDER
|
||||||
|
|| block.getType() == Material.WATER;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -365,14 +356,15 @@ public final class Utilities {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Calculate the time in milliseconds that it should take to break the given block with the given tool
|
* Calculate the time in milliseconds that it should take to break the given
|
||||||
|
* block with the given tool
|
||||||
*
|
*
|
||||||
* @param tool tool to check
|
* @param tool tool to check
|
||||||
* @param block block to check
|
* @param block block to check
|
||||||
* @return time in milliseconds to break
|
* @return time in milliseconds to break
|
||||||
*/
|
*/
|
||||||
public static long calcSurvivalFastBreak(ItemStack tool, Material block) {
|
public static long calcSurvivalFastBreak(ItemStack tool, Material block) {
|
||||||
if (isInstantBreak(block) || (tool.getType() == Material.SHEARS && block == Material.LEAVES)) {
|
if (isInstantBreak(block) || (tool.getType() == Material.SHEARS && block.name().endsWith("LEAVES"))) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
double bhardness = BlockHardness.getBlockHardness(block);
|
double bhardness = BlockHardness.getBlockHardness(block);
|
||||||
@@ -395,7 +387,8 @@ public final class Utilities {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determine whether the given tool is a combination that makes the breaking of this block faster
|
* Determine whether the given tool is a combination that makes the breaking of
|
||||||
|
* this block faster
|
||||||
*
|
*
|
||||||
* @param tool tool to check
|
* @param tool tool to check
|
||||||
* @param block block to check
|
* @param block block to check
|
||||||
@@ -427,6 +420,23 @@ public final class Utilities {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determine if a block ISN'T one of the specified types
|
||||||
|
*
|
||||||
|
* @param block block to check
|
||||||
|
* @param endTypes array of possible name endings
|
||||||
|
* @return true if the block isn't any of the materials
|
||||||
|
*/
|
||||||
|
public static boolean blockIsnt(Block block, String[] endTypes) {
|
||||||
|
Material type = block.getType();
|
||||||
|
for (String s : endTypes) {
|
||||||
|
if (type.name().endsWith(s)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parse a COMMAND[] input to a set of commands to execute
|
* Parse a COMMAND[] input to a set of commands to execute
|
||||||
*
|
*
|
||||||
@@ -470,7 +480,11 @@ public final class Utilities {
|
|||||||
* @return ArrayList with string
|
* @return ArrayList with string
|
||||||
*/
|
*/
|
||||||
public static ArrayList<String> stringToList(final String string) {
|
public static ArrayList<String> stringToList(final String string) {
|
||||||
return new ArrayList<String>() {{ add(string); }};
|
return new ArrayList<String>() {
|
||||||
|
{
|
||||||
|
add(string);
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -492,16 +506,18 @@ public final class Utilities {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Parse a string in the format of "XdXhXmXs" to seconds
|
* Parse a string in the format of "XdXhXmXs" to seconds
|
||||||
|
*
|
||||||
* @param string The string to parse
|
* @param string The string to parse
|
||||||
* @return seconds
|
* @return seconds
|
||||||
*/
|
*/
|
||||||
public static long lifeToSeconds(String string) {
|
public static long lifeToSeconds(String string) {
|
||||||
if (string.equals("0") || string.equals("")) return 0;
|
if (string.equals("0") || string.equals(""))
|
||||||
String[] lifeMatch = new String[]{ "d", "h", "m", "s" };
|
return 0;
|
||||||
int[] lifeInterval = new int[]{ 86400, 3600, 60, 1 };
|
String[] lifeMatch = new String[] { "d", "h", "m", "s" };
|
||||||
|
int[] lifeInterval = new int[] { 86400, 3600, 60, 1 };
|
||||||
long seconds = 0L;
|
long seconds = 0L;
|
||||||
|
|
||||||
for (int i=0;i<lifeMatch.length;i++) {
|
for (int i = 0; i < lifeMatch.length; i++) {
|
||||||
Matcher matcher = Pattern.compile("([0-9]*)" + lifeMatch[i]).matcher(string);
|
Matcher matcher = Pattern.compile("([0-9]*)" + lifeMatch[i]).matcher(string);
|
||||||
while (matcher.find()) {
|
while (matcher.find()) {
|
||||||
seconds += Integer.parseInt(matcher.group(1)) * lifeInterval[i];
|
seconds += Integer.parseInt(matcher.group(1)) * lifeInterval[i];
|
||||||
@@ -511,66 +527,121 @@ public final class Utilities {
|
|||||||
return seconds;
|
return seconds;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static {
|
static {
|
||||||
// START INSTANT BREAK MATERIALS
|
// START INSTANT BREAK MATERIALS
|
||||||
INSTANT_BREAK.add(Material.RED_MUSHROOM);
|
INSTANT_BREAK.add(Material.COMPARATOR);
|
||||||
INSTANT_BREAK.add(Material.RED_ROSE);
|
INSTANT_BREAK.add(Material.REPEATER);
|
||||||
INSTANT_BREAK.add(Material.BROWN_MUSHROOM);
|
|
||||||
INSTANT_BREAK.add(Material.YELLOW_FLOWER);
|
|
||||||
INSTANT_BREAK.add(Material.REDSTONE);
|
|
||||||
INSTANT_BREAK.add(Material.REDSTONE_TORCH_OFF);
|
|
||||||
INSTANT_BREAK.add(Material.REDSTONE_TORCH_ON);
|
|
||||||
INSTANT_BREAK.add(Material.REDSTONE_WIRE);
|
|
||||||
INSTANT_BREAK.add(Material.LONG_GRASS);
|
|
||||||
INSTANT_BREAK.add(Material.PAINTING);
|
|
||||||
INSTANT_BREAK.add(Material.WHEAT);
|
|
||||||
INSTANT_BREAK.add(Material.SUGAR_CANE);
|
|
||||||
INSTANT_BREAK.add(Material.SUGAR_CANE_BLOCK);
|
|
||||||
INSTANT_BREAK.add(Material.DIODE);
|
|
||||||
INSTANT_BREAK.add(Material.DIODE_BLOCK_OFF);
|
|
||||||
INSTANT_BREAK.add(Material.DIODE_BLOCK_ON);
|
|
||||||
INSTANT_BREAK.add(Material.SAPLING);
|
|
||||||
INSTANT_BREAK.add(Material.TORCH);
|
INSTANT_BREAK.add(Material.TORCH);
|
||||||
INSTANT_BREAK.add(Material.CROPS);
|
INSTANT_BREAK.add(Material.REDSTONE_TORCH);
|
||||||
INSTANT_BREAK.add(Material.SNOW);
|
INSTANT_BREAK.add(Material.REDSTONE_WIRE);
|
||||||
|
INSTANT_BREAK.add(Material.TRIPWIRE);
|
||||||
|
INSTANT_BREAK.add(Material.TRIPWIRE_HOOK);
|
||||||
|
INSTANT_BREAK.add(Material.FIRE);
|
||||||
|
INSTANT_BREAK.add(Material.FLOWER_POT);
|
||||||
|
INSTANT_BREAK.add(Material.INFESTED_CHISELED_STONE_BRICKS);
|
||||||
|
INSTANT_BREAK.add(Material.INFESTED_COBBLESTONE);
|
||||||
|
INSTANT_BREAK.add(Material.INFESTED_CRACKED_STONE_BRICKS);
|
||||||
|
INSTANT_BREAK.add(Material.INFESTED_MOSSY_STONE_BRICKS);
|
||||||
|
INSTANT_BREAK.add(Material.INFESTED_STONE);
|
||||||
|
INSTANT_BREAK.add(Material.INFESTED_STONE_BRICKS);
|
||||||
INSTANT_BREAK.add(Material.TNT);
|
INSTANT_BREAK.add(Material.TNT);
|
||||||
INSTANT_BREAK.add(Material.POTATO);
|
INSTANT_BREAK.add(Material.SLIME_BLOCK);
|
||||||
INSTANT_BREAK.add(Material.CARROT);
|
INSTANT_BREAK.add(Material.HONEY_BLOCK);
|
||||||
|
INSTANT_BREAK.add(Material.CARROTS);
|
||||||
|
INSTANT_BREAK.add(Material.DEAD_BUSH);
|
||||||
|
INSTANT_BREAK.add(Material.FERN);
|
||||||
|
INSTANT_BREAK.add(Material.LARGE_FERN);
|
||||||
|
INSTANT_BREAK.add(Material.CHORUS_FLOWER);
|
||||||
|
INSTANT_BREAK.add(Material.CORNFLOWER);
|
||||||
|
INSTANT_BREAK.add(Material.SUNFLOWER);
|
||||||
|
INSTANT_BREAK.add(Material.LILY_PAD);
|
||||||
|
INSTANT_BREAK.add(Material.MELON_STEM);
|
||||||
|
INSTANT_BREAK.add(Material.ATTACHED_MELON_STEM);
|
||||||
|
INSTANT_BREAK.add(Material.BROWN_MUSHROOM);
|
||||||
|
INSTANT_BREAK.add(Material.RED_MUSHROOM);
|
||||||
|
INSTANT_BREAK.add(Material.NETHER_WART);
|
||||||
|
INSTANT_BREAK.add(Material.POTATOES);
|
||||||
|
INSTANT_BREAK.add(Material.PUMPKIN_STEM);
|
||||||
|
INSTANT_BREAK.add(Material.ATTACHED_PUMPKIN_STEM);
|
||||||
|
INSTANT_BREAK.add(Material.ACACIA_SAPLING);
|
||||||
|
INSTANT_BREAK.add(Material.BAMBOO_SAPLING);
|
||||||
|
INSTANT_BREAK.add(Material.BIRCH_SAPLING);
|
||||||
|
INSTANT_BREAK.add(Material.DARK_OAK_SAPLING);
|
||||||
|
INSTANT_BREAK.add(Material.JUNGLE_SAPLING);
|
||||||
|
INSTANT_BREAK.add(Material.OAK_SAPLING);
|
||||||
|
INSTANT_BREAK.add(Material.SPRUCE_SAPLING);
|
||||||
|
INSTANT_BREAK.add(Material.SUGAR_CANE);
|
||||||
|
INSTANT_BREAK.add(Material.TALL_GRASS);
|
||||||
|
INSTANT_BREAK.add(Material.TALL_SEAGRASS);
|
||||||
|
INSTANT_BREAK.add(Material.WHEAT);
|
||||||
// END INSTANT BREAK MATERIALS
|
// END INSTANT BREAK MATERIALS
|
||||||
|
|
||||||
// START INTERACTABLE MATERIALS
|
|
||||||
INTERACTABLE.add(Material.STONE_BUTTON);
|
|
||||||
INTERACTABLE.add(Material.LEVER);
|
|
||||||
INTERACTABLE.add(Material.CHEST);
|
|
||||||
// END INTERACTABLE MATERIALS
|
|
||||||
|
|
||||||
// START FOOD
|
// START FOOD
|
||||||
|
FOOD.add(Material.APPLE);
|
||||||
|
FOOD.add(Material.BAKED_POTATO);
|
||||||
|
FOOD.add(Material.BEETROOT);
|
||||||
|
FOOD.add(Material.BEETROOT_SOUP);
|
||||||
|
FOOD.add(Material.BREAD);
|
||||||
|
FOOD.add(Material.CAKE);
|
||||||
|
FOOD.add(Material.CARROT);
|
||||||
|
FOOD.add(Material.CHORUS_FRUIT);
|
||||||
FOOD.add(Material.COOKED_BEEF);
|
FOOD.add(Material.COOKED_BEEF);
|
||||||
FOOD.add(Material.COOKED_CHICKEN);
|
FOOD.add(Material.COOKED_CHICKEN);
|
||||||
FOOD.add(Material.COOKED_FISH);
|
FOOD.add(Material.COOKED_COD);
|
||||||
FOOD.add(Material.GRILLED_PORK);
|
FOOD.add(Material.COOKED_MUTTON);
|
||||||
FOOD.add(Material.PORK);
|
FOOD.add(Material.COOKED_PORKCHOP);
|
||||||
FOOD.add(Material.MUSHROOM_SOUP);
|
FOOD.add(Material.COOKED_RABBIT);
|
||||||
FOOD.add(Material.RAW_BEEF);
|
FOOD.add(Material.COOKED_SALMON);
|
||||||
FOOD.add(Material.RAW_CHICKEN);
|
|
||||||
FOOD.add(Material.RAW_FISH);
|
|
||||||
FOOD.add(Material.APPLE);
|
|
||||||
FOOD.add(Material.GOLDEN_APPLE);
|
|
||||||
FOOD.add(Material.MELON);
|
|
||||||
FOOD.add(Material.COOKIE);
|
FOOD.add(Material.COOKIE);
|
||||||
FOOD.add(Material.BREAD);
|
FOOD.add(Material.DRIED_KELP);
|
||||||
FOOD.add(Material.SPIDER_EYE);
|
FOOD.add(Material.ENCHANTED_GOLDEN_APPLE);
|
||||||
|
FOOD.add(Material.GOLDEN_APPLE);
|
||||||
|
FOOD.add(Material.GOLDEN_CARROT);
|
||||||
|
FOOD.add(Material.HONEY_BOTTLE);
|
||||||
|
FOOD.add(Material.MELON_SLICE);
|
||||||
|
FOOD.add(Material.MUSHROOM_STEW);
|
||||||
|
FOOD.add(Material.POISONOUS_POTATO);
|
||||||
|
FOOD.add(Material.POTATO);
|
||||||
|
FOOD.add(Material.PUFFERFISH);
|
||||||
|
FOOD.add(Material.PUMPKIN_PIE);
|
||||||
|
FOOD.add(Material.RABBIT_STEW);
|
||||||
|
FOOD.add(Material.BEEF);
|
||||||
|
FOOD.add(Material.CHICKEN);
|
||||||
|
FOOD.add(Material.COD);
|
||||||
|
FOOD.add(Material.MUTTON);
|
||||||
|
FOOD.add(Material.PORKCHOP);
|
||||||
|
FOOD.add(Material.RABBIT);
|
||||||
|
FOOD.add(Material.SALMON);
|
||||||
FOOD.add(Material.ROTTEN_FLESH);
|
FOOD.add(Material.ROTTEN_FLESH);
|
||||||
FOOD.add(Material.POTATO_ITEM);
|
FOOD.add(Material.SPIDER_EYE);
|
||||||
|
FOOD.add(Material.SUSPICIOUS_STEW);
|
||||||
|
FOOD.add(Material.SWEET_BERRIES);
|
||||||
|
FOOD.add(Material.TROPICAL_FISH);
|
||||||
// END FOOD
|
// END FOOD
|
||||||
|
|
||||||
// START COMBOS
|
// START COMBOS
|
||||||
COMBO.put(Material.SHEARS, Material.WOOL);
|
COMBO.put(Material.SHEARS, Material.BLACK_WOOL);
|
||||||
COMBO.put(Material.IRON_SWORD, Material.WEB);
|
COMBO.put(Material.SHEARS, Material.BLUE_WOOL);
|
||||||
COMBO.put(Material.DIAMOND_SWORD, Material.WEB);
|
COMBO.put(Material.SHEARS, Material.BROWN_WOOL);
|
||||||
COMBO.put(Material.STONE_SWORD, Material.WEB);
|
COMBO.put(Material.SHEARS, Material.CYAN_WOOL);
|
||||||
COMBO.put(Material.WOOD_SWORD, Material.WEB);
|
COMBO.put(Material.SHEARS, Material.GRAY_WOOL);
|
||||||
|
COMBO.put(Material.SHEARS, Material.GREEN_WOOL);
|
||||||
|
COMBO.put(Material.SHEARS, Material.LIGHT_BLUE_WOOL);
|
||||||
|
COMBO.put(Material.SHEARS, Material.LIGHT_GRAY_WOOL);
|
||||||
|
COMBO.put(Material.SHEARS, Material.LIME_WOOL);
|
||||||
|
COMBO.put(Material.SHEARS, Material.MAGENTA_WOOL);
|
||||||
|
COMBO.put(Material.SHEARS, Material.MAGENTA_WOOL);
|
||||||
|
COMBO.put(Material.SHEARS, Material.ORANGE_WOOL);
|
||||||
|
COMBO.put(Material.SHEARS, Material.PINK_WOOL);
|
||||||
|
COMBO.put(Material.SHEARS, Material.PURPLE_WOOL);
|
||||||
|
COMBO.put(Material.SHEARS, Material.RED_WOOL);
|
||||||
|
COMBO.put(Material.SHEARS, Material.WHITE_WOOL);
|
||||||
|
COMBO.put(Material.SHEARS, Material.YELLOW_WOOL);
|
||||||
|
|
||||||
|
COMBO.put(Material.IRON_SWORD, Material.COBWEB);
|
||||||
|
COMBO.put(Material.DIAMOND_SWORD, Material.COBWEB);
|
||||||
|
COMBO.put(Material.STONE_SWORD, Material.COBWEB);
|
||||||
|
COMBO.put(Material.WOODEN_SWORD, Material.COBWEB);
|
||||||
// END COMBOS
|
// END COMBOS
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,52 +1,77 @@
|
|||||||
|
/*
|
||||||
|
* AntiCheatReloaded for Bukkit and Spigot.
|
||||||
|
* Copyright (c) 2012-2015 AntiCheat Team
|
||||||
|
* Copyright (c) 2016-2020 Rammelkast
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
package com.rammelkast.anticheatreloaded.util;
|
package com.rammelkast.anticheatreloaded.util;
|
||||||
|
|
||||||
import java.util.EnumSet;
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.enchantments.Enchantment;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
import org.bukkit.potion.PotionEffectType;
|
||||||
|
|
||||||
public class VersionUtil {
|
public class VersionUtil {
|
||||||
|
|
||||||
|
private static final List<String> SUPPORTED_VERSIONS = Arrays
|
||||||
|
.asList(new String[] { "v1_15" });
|
||||||
|
|
||||||
public static String getVersion() {
|
public static String getVersion() {
|
||||||
return Bukkit.getServer().getClass().getPackage().getName().replace(".", ",").split(",")[3];
|
return Bukkit.getServer().getClass().getPackage().getName().replace(".", ",").split(",")[3];
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final EnumSet<Material> MOVE_UP_BLOCKS_1_8 = EnumSet.of(Material.ACACIA_STAIRS,
|
public static boolean isSupported() {
|
||||||
Material.BIRCH_WOOD_STAIRS, Material.BRICK_STAIRS, Material.COBBLESTONE_STAIRS, Material.DARK_OAK_STAIRS,
|
for (String versionId : SUPPORTED_VERSIONS) {
|
||||||
Material.JUNGLE_WOOD_STAIRS, Material.NETHER_BRICK_STAIRS, Material.QUARTZ_STAIRS,
|
if (getVersion().startsWith(versionId)) {
|
||||||
Material.RED_SANDSTONE_STAIRS, Material.SANDSTONE_STAIRS, Material.SMOOTH_STAIRS,
|
|
||||||
Material.SPRUCE_WOOD_STAIRS, Material.WOOD_STAIRS);
|
|
||||||
|
|
||||||
public static boolean isFlying(Player p) {
|
|
||||||
if (getVersion().equals("v1_9_R1") || getVersion().equals("v1_10_R1") || getVersion().equals("v1_11_R1")) {
|
|
||||||
return p.isFlying() || p.isGliding() || p.hasPotionEffect(NMS_1_9_PLUS.LEVITATION);
|
|
||||||
} else {
|
|
||||||
return p.isFlying();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static EnumSet<Material> getMoveUpBlocks() {
|
|
||||||
if (getVersion().equals("v1_9_R1") || getVersion().equals("v1_10_R1") || getVersion().equals("v1_11_R1")) {
|
|
||||||
return NMS_1_9_PLUS.MOVE_UP_BLOCKS_1_9;
|
|
||||||
} else {
|
|
||||||
return MOVE_UP_BLOCKS_1_8;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean isNewYSpeed() {
|
|
||||||
if (getVersion().equals("v1_9_R1") || getVersion().equals("v1_10_R1") || getVersion().equals("v1_11_R1")) {
|
|
||||||
return true;
|
return true;
|
||||||
} else {
|
}
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean isFlying(Player p) {
|
||||||
|
return p.isFlying() || p.isGliding() || p.hasPotionEffect(PotionEffectType.LEVITATION);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static long getHealTime() {
|
public static long getHealTime() {
|
||||||
if (getVersion().equals("v1_9_R1") || getVersion().equals("v1_10_R1") || getVersion().equals("v1_11_R1")) {
|
|
||||||
return 495;
|
return 495;
|
||||||
} else {
|
}
|
||||||
return 1995;
|
|
||||||
|
public static boolean isFrostWalk(Player player) {
|
||||||
|
if (player.getInventory().getBoots() == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return player.getInventory().getBoots().containsEnchantment(Enchantment.FROST_WALKER);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ItemStack getItemInHand(Player player) {
|
||||||
|
return player.getInventory().getItemInMainHand();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int getPlayerPing(Player player) {
|
||||||
|
try {
|
||||||
|
Object entityPlayer = player.getClass().getMethod("getHandle").invoke(player);
|
||||||
|
int ping = (int) entityPlayer.getClass().getField("ping").get(entityPlayer);
|
||||||
|
return ping;
|
||||||
|
} catch (Exception e) {
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* AntiCheat for Bukkit.
|
* AntiCheatReloaded for Bukkit and Spigot.
|
||||||
* Copyright (C) 2012-2014 AntiCheat Team | http://gravitydevelopment.net
|
* Copyright (c) 2012-2015 AntiCheat Team
|
||||||
|
* Copyright (c) 2016-2020 Rammelkast
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -21,7 +22,7 @@ package com.rammelkast.anticheatreloaded.util.enterprise;
|
|||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.scheduler.BukkitTask;
|
import org.bukkit.scheduler.BukkitTask;
|
||||||
|
|
||||||
import com.rammelkast.anticheatreloaded.AntiCheat;
|
import com.rammelkast.anticheatreloaded.AntiCheatReloaded;
|
||||||
import com.rammelkast.anticheatreloaded.check.CheckType;
|
import com.rammelkast.anticheatreloaded.check.CheckType;
|
||||||
import com.rammelkast.anticheatreloaded.util.User;
|
import com.rammelkast.anticheatreloaded.util.User;
|
||||||
import com.rammelkast.anticheatreloaded.util.Utilities;
|
import com.rammelkast.anticheatreloaded.util.Utilities;
|
||||||
@@ -137,7 +138,7 @@ public class Database {
|
|||||||
connection.setAutoCommit(false);
|
connection.setAutoCommit(false);
|
||||||
|
|
||||||
if (logInterval != 0) {
|
if (logInterval != 0) {
|
||||||
eventTask = Bukkit.getScheduler().runTaskTimerAsynchronously(AntiCheat.getPlugin(), new Runnable() {
|
eventTask = Bukkit.getScheduler().runTaskTimerAsynchronously(AntiCheatReloaded.getPlugin(), new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
flushEvents();
|
flushEvents();
|
||||||
@@ -146,7 +147,7 @@ public class Database {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(syncLevels && syncInterval != 0) {
|
if(syncLevels && syncInterval != 0) {
|
||||||
syncTask = Bukkit.getScheduler().runTaskTimerAsynchronously(AntiCheat.getPlugin(), new Runnable() {
|
syncTask = Bukkit.getScheduler().runTaskTimerAsynchronously(AntiCheatReloaded.getPlugin(), new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
syncUsers();
|
syncUsers();
|
||||||
@@ -154,7 +155,7 @@ public class Database {
|
|||||||
}, syncInterval * 20, syncInterval * 20);
|
}, syncInterval * 20, syncInterval * 20);
|
||||||
}
|
}
|
||||||
|
|
||||||
AntiCheat.getPlugin().verboseLog("Connected to the database.");
|
AntiCheatReloaded.getPlugin().verboseLog("Connected to the database.");
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
@@ -203,7 +204,7 @@ public class Database {
|
|||||||
|
|
||||||
public void cleanEvents() {
|
public void cleanEvents() {
|
||||||
if (logLife != 0) {
|
if (logLife != 0) {
|
||||||
Bukkit.getScheduler().runTaskAsynchronously(AntiCheat.getPlugin(), new Runnable() {
|
Bukkit.getScheduler().runTaskAsynchronously(AntiCheatReloaded.getPlugin(), new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
try {
|
try {
|
||||||
@@ -213,7 +214,7 @@ public class Database {
|
|||||||
statement.executeUpdate();
|
statement.executeUpdate();
|
||||||
|
|
||||||
connection.commit();
|
connection.commit();
|
||||||
AntiCheat.getPlugin().verboseLog("Cleaned " + statement.getUpdateCount() + " old events from the database");
|
AntiCheatReloaded.getPlugin().verboseLog("Cleaned " + statement.getUpdateCount() + " old events from the database");
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
@@ -223,8 +224,8 @@ public class Database {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void syncUsers() {
|
private void syncUsers() {
|
||||||
for (User user : AntiCheat.getManager().getUserManager().getUsers()) {
|
for (User user : AntiCheatReloaded.getManager().getUserManager().getUsers()) {
|
||||||
AntiCheat.getManager().getConfiguration().getLevels().updateLevelToUser(user);
|
AntiCheatReloaded.getManager().getConfiguration().getLevels().updateLevelToUser(user);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* AntiCheat for Bukkit.
|
* AntiCheatReloaded for Bukkit and Spigot.
|
||||||
* Copyright (C) 2012-2014 AntiCheat Team | http://gravitydevelopment.net
|
* Copyright (c) 2012-2015 AntiCheat Team
|
||||||
|
* Copyright (c) 2016-2020 Rammelkast
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* AntiCheat for Bukkit.
|
* AntiCheatReloaded for Bukkit and Spigot.
|
||||||
* Copyright (C) 2012-2014 AntiCheat Team | http://gravitydevelopment.net
|
* Copyright (c) 2012-2015 AntiCheat Team
|
||||||
|
* Copyright (c) 2016-2020 Rammelkast
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -20,7 +21,7 @@ package com.rammelkast.anticheatreloaded.util.rule;
|
|||||||
|
|
||||||
import org.bukkit.GameMode;
|
import org.bukkit.GameMode;
|
||||||
|
|
||||||
import com.rammelkast.anticheatreloaded.AntiCheat;
|
import com.rammelkast.anticheatreloaded.AntiCheatReloaded;
|
||||||
import com.rammelkast.anticheatreloaded.check.CheckType;
|
import com.rammelkast.anticheatreloaded.check.CheckType;
|
||||||
import com.rammelkast.anticheatreloaded.util.Group;
|
import com.rammelkast.anticheatreloaded.util.Group;
|
||||||
import com.rammelkast.anticheatreloaded.util.User;
|
import com.rammelkast.anticheatreloaded.util.User;
|
||||||
@@ -87,7 +88,7 @@ public class Rule {
|
|||||||
private Type type;
|
private Type type;
|
||||||
|
|
||||||
public enum Type {
|
public enum Type {
|
||||||
CONDITIONAL(".*[?]*.*:.*", "net.gravitydevelopment.anticheat.util.rule.ConditionalRule");
|
CONDITIONAL(".*[?]*.*:.*", "com.rammelkast.anticheatreloaded.util.rule.ConditionalRule");
|
||||||
|
|
||||||
private String regex;
|
private String regex;
|
||||||
private String c;
|
private String c;
|
||||||
@@ -175,7 +176,7 @@ public class Rule {
|
|||||||
if (variable.equals("player_level") && Utilities.isInt(value)) {
|
if (variable.equals("player_level") && Utilities.isInt(value)) {
|
||||||
user.setLevel(Integer.parseInt(value));
|
user.setLevel(Integer.parseInt(value));
|
||||||
} else if (variable.equals("player_group") && Utilities.isInt(value)) {
|
} else if (variable.equals("player_group") && Utilities.isInt(value)) {
|
||||||
for (Group group : AntiCheat.getManager().getConfiguration().getGroups().getGroups()) {
|
for (Group group : AntiCheatReloaded.getManager().getConfiguration().getGroups().getGroups()) {
|
||||||
if (group.getName().equalsIgnoreCase(value)) {
|
if (group.getName().equalsIgnoreCase(value)) {
|
||||||
user.setLevel(group.getLevel());
|
user.setLevel(group.getLevel());
|
||||||
}
|
}
|
||||||
@@ -196,7 +197,7 @@ public class Rule {
|
|||||||
text = text.split("\\.")[1];
|
text = text.split("\\.")[1];
|
||||||
List<String> action = new ArrayList<String>();
|
List<String> action = new ArrayList<String>();
|
||||||
action.add(text);
|
action.add(text);
|
||||||
AntiCheat.getManager().getUserManager().execute(user, action, type);
|
AntiCheatReloaded.getManager().getUserManager().execute(user, action, type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,8 +15,6 @@ spam:
|
|||||||
action-one: KICK
|
action-one: KICK
|
||||||
action-two: BAN
|
action-two: BAN
|
||||||
system:
|
system:
|
||||||
# Turning auto-update off is a _BAD_ idea. You will no longer be protected by the latest hacks/cheats if you do so, and will have to update manually.
|
|
||||||
auto-update: true
|
|
||||||
# Should AntiCheatReloaded log ALL failed checks to console?
|
# Should AntiCheatReloaded log ALL failed checks to console?
|
||||||
log-to-console: false
|
log-to-console: false
|
||||||
# Should AntiCheatReloaded log to file?
|
# Should AntiCheatReloaded log to file?
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ database:
|
|||||||
# Password for the user
|
# Password for the user
|
||||||
password: ''
|
password: ''
|
||||||
# Prefix for the tables
|
# Prefix for the tables
|
||||||
prefix: 'ac_'
|
prefix: 'acr_'
|
||||||
# Database/Schema to use
|
# Database/Schema to use
|
||||||
database: 'anticheat'
|
database: 'anticheat'
|
||||||
# Logging settings
|
# Logging settings
|
||||||
|
|||||||
@@ -1,4 +1,9 @@
|
|||||||
# AntiCheatReloaded configuration file
|
# AntiCheatReloaded configuration file
|
||||||
|
#
|
||||||
|
# This file is not yet fully documented
|
||||||
|
# For more information on the undocumented values visit:
|
||||||
|
# https://github.com/Rammelkast/AntiCheatReloaded/blob/master/src/main/java/com/rammelkast/anticheatreloaded/config/providers/Magic.java#L39-L380
|
||||||
|
#
|
||||||
ANIMATION_INTERACT_MAX: 3
|
ANIMATION_INTERACT_MAX: 3
|
||||||
ANIMATION_MIN: 200
|
ANIMATION_MIN: 200
|
||||||
ASCENSION_COUNT_MAX: 8
|
ASCENSION_COUNT_MAX: 8
|
||||||
@@ -80,9 +85,14 @@ XZ_SPEED_MAX_WATER_SPRINT: 0.3
|
|||||||
Y_MAXDIFF: 5.0
|
Y_MAXDIFF: 5.0
|
||||||
Y_MAXVIOLATIONS: 1
|
Y_MAXVIOLATIONS: 1
|
||||||
Y_MAXVIOTIME: 5500
|
Y_MAXVIOTIME: 5500
|
||||||
Y_SPEED_MAX: 0.5125
|
Y_SPEED_MAX: 0.5175
|
||||||
Y_TIME: 800
|
Y_TIME: 800
|
||||||
|
# Amount of suspicious mid-air movements before a player is suspected of glide
|
||||||
|
# Increase this in case of false positives
|
||||||
GLIDE_LIMIT: 10
|
GLIDE_LIMIT: 10
|
||||||
KILLAURA_BOTHITS: 4
|
# Maximum amount of movement packets allowed per second
|
||||||
BLINK_PACKET: 74
|
# Increase this in case of false positives
|
||||||
|
BLINK_PACKET: 25
|
||||||
|
# Maximum amount zero-velocity moments before a player is suspected
|
||||||
|
# Increase this in case of false positives
|
||||||
VELOCITY_AMT: 5
|
VELOCITY_AMT: 5
|
||||||
@@ -1,15 +1,16 @@
|
|||||||
name: AntiCheatReloaded
|
name: AntiCheatReloaded
|
||||||
author: Rammelkast
|
author: Rammelkast
|
||||||
description: AntiCheatReloaded helps easily identify and block malicious users on your server.
|
description: AntiCheatReloaded helps easily identify and block malicious users on your server.
|
||||||
main: com.rammelkast.anticheatreloaded.AntiCheat
|
main: com.rammelkast.anticheatreloaded.AntiCheatReloaded
|
||||||
softdepend: [ProtocolLib]
|
api-version: 1.13
|
||||||
|
depend: [ProtocolLib]
|
||||||
startup: postworld
|
startup: postworld
|
||||||
version: ${project.build.version}
|
version: ${project.build.version}
|
||||||
commands:
|
commands:
|
||||||
anticheat:
|
anticheat:
|
||||||
description: Control and view info about AntiCheat
|
description: Control and view info about AntiCheatReloaded
|
||||||
usage: /anticheat help
|
usage: /anticheat help
|
||||||
aliases: anti
|
aliases: acr
|
||||||
permissions:
|
permissions:
|
||||||
anticheat.system.notice:
|
anticheat.system.notice:
|
||||||
description: See broadcasts when a player is kicked or banned for hacking
|
description: See broadcasts when a player is kicked or banned for hacking
|
||||||
@@ -60,9 +61,12 @@ permissions:
|
|||||||
anticheat.check.zombe.cheat:
|
anticheat.check.zombe.cheat:
|
||||||
description: Allow players to use zombe cheat hack
|
description: Allow players to use zombe cheat hack
|
||||||
default: false
|
default: false
|
||||||
anticheat.check.fly:
|
anticheat.check.flight:
|
||||||
description: Allow players to fly
|
description: Allow players to fly
|
||||||
default: false
|
default: false
|
||||||
|
anticheat.check.elytra:
|
||||||
|
description: Allow players to fly when using elytra
|
||||||
|
default: false
|
||||||
anticheat.check.waterwalk:
|
anticheat.check.waterwalk:
|
||||||
description: Allow players to walk on water
|
description: Allow players to walk on water
|
||||||
default: false
|
default: false
|
||||||
@@ -126,8 +130,20 @@ permissions:
|
|||||||
anticheat.check.autotool:
|
anticheat.check.autotool:
|
||||||
description: Allow players to use autotool to switch tools quickly
|
description: Allow players to use autotool to switch tools quickly
|
||||||
default: false
|
default: false
|
||||||
anticheat.check.fastanimation:
|
anticheat.check.killaura:
|
||||||
description: Allow players to attack or interact very quickly
|
description: Allow players to use killaura
|
||||||
|
default: false
|
||||||
|
anticheat.check.blink:
|
||||||
|
description: Allow players to send lots of movement packets
|
||||||
|
default: false
|
||||||
|
anticheat.check.velocity:
|
||||||
|
description: Allow players to use knockback prevention
|
||||||
|
default: false
|
||||||
|
anticheat.check.criticals:
|
||||||
|
description: Allow players to use criticals
|
||||||
|
default: false
|
||||||
|
anticheat.check.unicode:
|
||||||
|
description: Allow players to use unicode in chat
|
||||||
default: false
|
default: false
|
||||||
anticheat.check.exempt:
|
anticheat.check.exempt:
|
||||||
description: Total exemption from checks
|
description: Total exemption from checks
|
||||||
|
|||||||
Reference in new issue
Block a user