mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-01 22:14:49 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
09ddbfba8f | ||
|
|
7f13a0ad4c | ||
|
|
21d0108c16 | ||
|
|
15181ab6ad | ||
|
|
347eec8ff0 |
No files matched your search
@@ -1,9 +1,9 @@
|
|||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<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">
|
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>net.gravitydevelopment.anticheat</groupId>
|
<groupId>com.rammelkast.anticheatreloaded</groupId>
|
||||||
<artifactId>AntiCheat</artifactId>
|
<artifactId>AntiCheatReloaded</artifactId>
|
||||||
<version>1.5.6-ALPHA</version>
|
<version>1.6.1-ALPHA</version>
|
||||||
<name>AntiCheatReloaded</name>
|
<name>AntiCheatReloaded</name>
|
||||||
<url>https://rammelkast.com</url>
|
<url>https://rammelkast.com</url>
|
||||||
<properties>
|
<properties>
|
||||||
@@ -43,7 +43,7 @@
|
|||||||
<configuration>
|
<configuration>
|
||||||
<artifactSet>
|
<artifactSet>
|
||||||
<includes>
|
<includes>
|
||||||
<include>net.gravitydevelopment.*</include>
|
<include>com.rammelkast.*</include>
|
||||||
</includes>
|
</includes>
|
||||||
</artifactSet>
|
</artifactSet>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
|||||||
@@ -0,0 +1,282 @@
|
|||||||
|
/*
|
||||||
|
* 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;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.Listener;
|
||||||
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
|
import com.comphenix.protocol.ProtocolLibrary;
|
||||||
|
import com.comphenix.protocol.ProtocolManager;
|
||||||
|
import com.rammelkast.anticheatreloaded.check.combat.KillAuraCheck;
|
||||||
|
import com.rammelkast.anticheatreloaded.check.movement.BlinkCheck;
|
||||||
|
import com.rammelkast.anticheatreloaded.command.CommandHandler;
|
||||||
|
import com.rammelkast.anticheatreloaded.config.Configuration;
|
||||||
|
import com.rammelkast.anticheatreloaded.event.BlockListener;
|
||||||
|
import com.rammelkast.anticheatreloaded.event.EntityListener;
|
||||||
|
import com.rammelkast.anticheatreloaded.event.InventoryListener;
|
||||||
|
import com.rammelkast.anticheatreloaded.event.PlayerListener;
|
||||||
|
import com.rammelkast.anticheatreloaded.event.VehicleListener;
|
||||||
|
import com.rammelkast.anticheatreloaded.manage.AntiCheatManager;
|
||||||
|
import com.rammelkast.anticheatreloaded.metrics.Metrics;
|
||||||
|
import com.rammelkast.anticheatreloaded.util.User;
|
||||||
|
import com.rammelkast.anticheatreloaded.util.VersionUtil;
|
||||||
|
|
||||||
|
public class AntiCheat extends JavaPlugin {
|
||||||
|
|
||||||
|
private static AntiCheatManager manager;
|
||||||
|
private static AntiCheat plugin;
|
||||||
|
private static List<Listener> eventList = new ArrayList<Listener>();
|
||||||
|
private static Configuration config;
|
||||||
|
private static boolean verbose;
|
||||||
|
private static boolean developer;
|
||||||
|
private static ProtocolManager protocolManager;
|
||||||
|
private static boolean protocolLib = false;
|
||||||
|
private static Long loadTime;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onEnable() {
|
||||||
|
plugin = this;
|
||||||
|
loadTime = System.currentTimeMillis();
|
||||||
|
manager = new AntiCheatManager(this, getLogger());
|
||||||
|
eventList.add(new PlayerListener());
|
||||||
|
eventList.add(new BlockListener());
|
||||||
|
eventList.add(new EntityListener());
|
||||||
|
eventList.add(new VehicleListener());
|
||||||
|
eventList.add(new InventoryListener());
|
||||||
|
// Order is important in some cases, don't screw with these unless
|
||||||
|
// needed, especially config
|
||||||
|
setupConfig();
|
||||||
|
setupEvents();
|
||||||
|
setupCommands();
|
||||||
|
setupProtocol();
|
||||||
|
// Enterprise must come before levels
|
||||||
|
setupEnterprise();
|
||||||
|
restoreLevels();
|
||||||
|
|
||||||
|
if (Bukkit.getPluginManager().getPlugin("ProtocolLib") != null) {
|
||||||
|
getLogger().info("Found ProtocolLib, enabling checks that use ProtcolLib...");
|
||||||
|
// Enable packetlisteners
|
||||||
|
KillAuraCheck.listenPackets();
|
||||||
|
BlinkCheck.startTimer();
|
||||||
|
BlinkCheck.listenPackets();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if other AC's are installed
|
||||||
|
Bukkit.getScheduler().runTaskLater(this, new Runnable() {
|
||||||
|
public void run() {
|
||||||
|
if (Bukkit.getPluginManager().getPlugin("NoCheatPlus") != null) {
|
||||||
|
getLogger().severe("*----------------------------------------------*");
|
||||||
|
getLogger().severe("You are also running NoCheatPlus!");
|
||||||
|
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) {
|
||||||
|
getLogger().severe("*----------------------------------------------*");
|
||||||
|
getLogger().severe("You are also running AAC!");
|
||||||
|
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) {
|
||||||
|
getLogger().severe("*----------------------------------------------*");
|
||||||
|
getLogger().severe("You are also running AntiCheat!");
|
||||||
|
getLogger().severe("Multiple anticheats create false cheat detections.");
|
||||||
|
getLogger().severe("Please remove or disable AntiCheat to silence this warning.");
|
||||||
|
getLogger().severe("*----------------------------------------------*");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, 60L);
|
||||||
|
|
||||||
|
// End tests
|
||||||
|
verboseLog("Finished loading.");
|
||||||
|
getLogger().info("Running NMS version " + VersionUtil.getVersion() + "...");
|
||||||
|
|
||||||
|
// Metrics
|
||||||
|
try {
|
||||||
|
Metrics metrics = new Metrics(this);
|
||||||
|
metrics.addCustomChart(new Metrics.SingleLineChart("cheaters_kicked") {
|
||||||
|
@Override
|
||||||
|
public int getValue() {
|
||||||
|
return playersKicked;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
metrics.addCustomChart(new Metrics.SingleLineChart("killaura_violations") {
|
||||||
|
@Override
|
||||||
|
public int getValue() {
|
||||||
|
return killauraViolations;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
metrics.addCustomChart(new Metrics.SingleLineChart("glide_violations") {
|
||||||
|
@Override
|
||||||
|
public int getValue() {
|
||||||
|
return glideViolations;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDisable() {
|
||||||
|
verboseLog("Saving user levels...");
|
||||||
|
config.getLevels().saveLevelsFromUsers(getManager().getUserManager().getUsers());
|
||||||
|
|
||||||
|
AntiCheatManager.close();
|
||||||
|
getServer().getScheduler().cancelTasks(this);
|
||||||
|
cleanup();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setupProtocol() {
|
||||||
|
if (Bukkit.getPluginManager().getPlugin("ProtocolLib") != null) {
|
||||||
|
protocolLib = true;
|
||||||
|
protocolManager = ProtocolLibrary.getProtocolManager();
|
||||||
|
verboseLog("Hooked into ProtocolLib");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setupEvents() {
|
||||||
|
for (Listener listener : eventList) {
|
||||||
|
getServer().getPluginManager().registerEvents(listener, this);
|
||||||
|
verboseLog("Registered events for ".concat(listener.toString().split("@")[0].split(".anticheat.")[1]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setupCommands() {
|
||||||
|
getCommand("anticheat").setExecutor(new CommandHandler());
|
||||||
|
verboseLog("Registered commands.");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setupConfig() {
|
||||||
|
config = manager.getConfiguration();
|
||||||
|
verboseLog("Setup the config.");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setupEnterprise() {
|
||||||
|
if (config.getConfig().enterprise.getValue()) {
|
||||||
|
if (config.getEnterprise().loggingEnabled.getValue()) {
|
||||||
|
config.getEnterprise().database.cleanEvents();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void restoreLevels() {
|
||||||
|
for (Player player : getServer().getOnlinePlayers()) {
|
||||||
|
UUID uuid = player.getUniqueId();
|
||||||
|
|
||||||
|
User user = new User(uuid);
|
||||||
|
user.setIsWaitingOnLevelSync(true);
|
||||||
|
config.getLevels().loadLevelToUser(user);
|
||||||
|
|
||||||
|
manager.getUserManager().addUser(user);
|
||||||
|
verboseLog("Data for " + uuid + " loaded");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static AntiCheat getPlugin() {
|
||||||
|
return plugin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static AntiCheatManager getManager() {
|
||||||
|
return manager;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getVersion() {
|
||||||
|
return manager.getPlugin().getDescription().getVersion();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void cleanup() {
|
||||||
|
eventList = null;
|
||||||
|
manager = null;
|
||||||
|
config = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean developerMode() {
|
||||||
|
return developer;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setDeveloperMode(boolean b) {
|
||||||
|
developer = b;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isUsingProtocolLib() {
|
||||||
|
return protocolLib;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void debugLog(final String string) {
|
||||||
|
Bukkit.getScheduler().runTask(getPlugin(), new Runnable() {
|
||||||
|
public void run() {
|
||||||
|
if (developer) {
|
||||||
|
manager.debugLog("[DEBUG] " + string);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void verboseLog(final String string) {
|
||||||
|
if (verbose) {
|
||||||
|
getLogger().info(string);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVerbose(boolean b) {
|
||||||
|
verbose = b;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getLoadTime() {
|
||||||
|
return loadTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ProtocolManager getProtocolManager() {
|
||||||
|
return protocolManager;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Amount of players kicked since start
|
||||||
|
*/
|
||||||
|
private int playersKicked = 0;
|
||||||
|
/**
|
||||||
|
* Amount of killaura violations since start
|
||||||
|
*/
|
||||||
|
private int killauraViolations = 0;
|
||||||
|
/**
|
||||||
|
* Amount of glide violations since start
|
||||||
|
*/
|
||||||
|
private int glideViolations = 0;
|
||||||
|
|
||||||
|
public void onPlayerKicked() {
|
||||||
|
this.playersKicked++;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onKillAuraViolation() {
|
||||||
|
this.killauraViolations++;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onGlideViolation() {
|
||||||
|
this.killauraViolations++;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+9
-9
@@ -16,18 +16,18 @@
|
|||||||
* 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 net.gravitydevelopment.anticheat.api;
|
package com.rammelkast.anticheatreloaded.api;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import net.gravitydevelopment.anticheat.AntiCheat;
|
import com.rammelkast.anticheatreloaded.AntiCheat;
|
||||||
import net.gravitydevelopment.anticheat.check.CheckType;
|
import com.rammelkast.anticheatreloaded.check.CheckType;
|
||||||
import net.gravitydevelopment.anticheat.manage.AntiCheatManager;
|
import com.rammelkast.anticheatreloaded.manage.AntiCheatManager;
|
||||||
import net.gravitydevelopment.anticheat.manage.CheckManager;
|
import com.rammelkast.anticheatreloaded.manage.CheckManager;
|
||||||
import net.gravitydevelopment.anticheat.manage.UserManager;
|
import com.rammelkast.anticheatreloaded.manage.UserManager;
|
||||||
import net.gravitydevelopment.anticheat.util.Group;
|
import com.rammelkast.anticheatreloaded.util.Group;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Developer's interface for all things AntiCheat.
|
* Developer's interface for all things AntiCheat.
|
||||||
@@ -146,7 +146,7 @@ public class AntiCheatAPI {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a user's {@link net.gravitydevelopment.anticheat.util.Group}
|
* Get a user's {@link com.rammelkast.anticheatreloaded.util.Group}
|
||||||
*
|
*
|
||||||
* @param player Player whose group to find
|
* @param player Player whose group to find
|
||||||
* @return The player's group
|
* @return The player's group
|
||||||
@@ -159,7 +159,7 @@ public class AntiCheatAPI {
|
|||||||
* Get all configured Groups
|
* Get all configured Groups
|
||||||
*
|
*
|
||||||
* @return List of all groups
|
* @return List of all groups
|
||||||
* @see net.gravitydevelopment.anticheat.util.Group
|
* @see com.rammelkast.anticheatreloaded.util.Group
|
||||||
*/
|
*/
|
||||||
public static List<Group> getGroups() {
|
public static List<Group> getGroups() {
|
||||||
return getManager().getConfiguration().getGroups().getGroups();
|
return getManager().getConfiguration().getGroups().getGroups();
|
||||||
+8
-7
@@ -16,13 +16,14 @@
|
|||||||
* 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 net.gravitydevelopment.anticheat.api;
|
package com.rammelkast.anticheatreloaded.api;
|
||||||
|
|
||||||
import net.gravitydevelopment.anticheat.check.CheckType;
|
|
||||||
import net.gravitydevelopment.anticheat.util.User;
|
|
||||||
import org.bukkit.event.Event;
|
import org.bukkit.event.Event;
|
||||||
import org.bukkit.event.HandlerList;
|
import org.bukkit.event.HandlerList;
|
||||||
|
|
||||||
|
import com.rammelkast.anticheatreloaded.check.CheckType;
|
||||||
|
import com.rammelkast.anticheatreloaded.util.User;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fired when a player fails an AntiCheat check
|
* Fired when a player fails an AntiCheat check
|
||||||
*/
|
*/
|
||||||
@@ -40,18 +41,18 @@ public class CheckFailEvent extends Event {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the {@link net.gravitydevelopment.anticheat.util.User} who failed the check
|
* Get the {@link com.rammelkast.anticheatreloaded.util.User} who failed the check
|
||||||
*
|
*
|
||||||
* @return a {@link net.gravitydevelopment.anticheat.util.User}
|
* @return a {@link com.rammelkast.anticheatreloaded.util.User}
|
||||||
*/
|
*/
|
||||||
public User getUser() {
|
public User getUser() {
|
||||||
return user;
|
return user;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the {@link net.gravitydevelopment.anticheat.check.CheckType} failed
|
* Get the {@link com.rammelkast.anticheatreloaded.check.CheckType} failed
|
||||||
*
|
*
|
||||||
* @return a {@link net.gravitydevelopment.anticheat.check.CheckType}
|
* @return a {@link com.rammelkast.anticheatreloaded.check.CheckType}
|
||||||
*/
|
*/
|
||||||
public CheckType getCheck() {
|
public CheckType getCheck() {
|
||||||
return type;
|
return type;
|
||||||
+24
-22
@@ -16,7 +16,7 @@
|
|||||||
* 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 net.gravitydevelopment.anticheat.check;
|
package com.rammelkast.anticheatreloaded.check;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@@ -37,23 +37,23 @@ 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 net.gravitydevelopment.anticheat.AntiCheat;
|
import com.rammelkast.anticheatreloaded.AntiCheat;
|
||||||
import net.gravitydevelopment.anticheat.check.combat.KillAuraCheck;
|
import com.rammelkast.anticheatreloaded.check.combat.KillAuraCheck;
|
||||||
import net.gravitydevelopment.anticheat.check.combat.VelocityCheck;
|
import com.rammelkast.anticheatreloaded.check.combat.VelocityCheck;
|
||||||
import net.gravitydevelopment.anticheat.check.movement.BlinkCheck;
|
import com.rammelkast.anticheatreloaded.check.movement.BlinkCheck;
|
||||||
import net.gravitydevelopment.anticheat.check.movement.FlightCheck;
|
import com.rammelkast.anticheatreloaded.check.movement.FlightCheck;
|
||||||
import net.gravitydevelopment.anticheat.check.movement.GlideCheck;
|
import com.rammelkast.anticheatreloaded.check.movement.GlideCheck;
|
||||||
import net.gravitydevelopment.anticheat.check.movement.SpeedCheck;
|
import com.rammelkast.anticheatreloaded.check.movement.SpeedCheck;
|
||||||
import net.gravitydevelopment.anticheat.check.movement.WaterWalkCheck;
|
import com.rammelkast.anticheatreloaded.check.movement.WaterWalkCheck;
|
||||||
import net.gravitydevelopment.anticheat.check.movement.YAxisCheck;
|
import com.rammelkast.anticheatreloaded.check.movement.YAxisCheck;
|
||||||
import net.gravitydevelopment.anticheat.config.Configuration;
|
import com.rammelkast.anticheatreloaded.config.Configuration;
|
||||||
import net.gravitydevelopment.anticheat.config.providers.Lang;
|
import com.rammelkast.anticheatreloaded.config.providers.Lang;
|
||||||
import net.gravitydevelopment.anticheat.config.providers.Magic;
|
import com.rammelkast.anticheatreloaded.config.providers.Magic;
|
||||||
import net.gravitydevelopment.anticheat.manage.AntiCheatManager;
|
import com.rammelkast.anticheatreloaded.manage.AntiCheatManager;
|
||||||
import net.gravitydevelopment.anticheat.util.Distance;
|
import com.rammelkast.anticheatreloaded.util.Distance;
|
||||||
import net.gravitydevelopment.anticheat.util.User;
|
import com.rammelkast.anticheatreloaded.util.User;
|
||||||
import net.gravitydevelopment.anticheat.util.Utilities;
|
import com.rammelkast.anticheatreloaded.util.Utilities;
|
||||||
import net.gravitydevelopment.anticheat.util.VersionUtil;
|
import com.rammelkast.anticheatreloaded.util.VersionUtil;
|
||||||
|
|
||||||
public class Backend {
|
public class Backend {
|
||||||
private List<UUID> isAscending = new ArrayList<UUID>();
|
private List<UUID> isAscending = new ArrayList<UUID>();
|
||||||
@@ -170,8 +170,9 @@ public class Backend {
|
|||||||
inventoryTime.remove(pU);
|
inventoryTime.remove(pU);
|
||||||
inventoryClicks.remove(pU);
|
inventoryClicks.remove(pU);
|
||||||
lastFallPacket.remove(pU);
|
lastFallPacket.remove(pU);
|
||||||
GlideCheck.lastToFall.remove(pU);
|
GlideCheck.lastDiff.remove(pU);
|
||||||
GlideCheck.glideBuffer.remove(pU);
|
GlideCheck.lastFallDistance.remove(pU);
|
||||||
|
GlideCheck.violations.remove(pU);
|
||||||
SpeedCheck.speedViolation.remove(player.getUniqueId());
|
SpeedCheck.speedViolation.remove(player.getUniqueId());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -777,8 +778,9 @@ public class Backend {
|
|||||||
YAxisCheck.yAxisLastViolation.remove(player.getUniqueId());
|
YAxisCheck.yAxisLastViolation.remove(player.getUniqueId());
|
||||||
YAxisCheck.lastYcoord.remove(player.getUniqueId());
|
YAxisCheck.lastYcoord.remove(player.getUniqueId());
|
||||||
YAxisCheck.lastYtime.remove(player.getUniqueId());
|
YAxisCheck.lastYtime.remove(player.getUniqueId());
|
||||||
GlideCheck.lastToFall.remove(player.getUniqueId());
|
GlideCheck.lastFallDistance.remove(player.getUniqueId());
|
||||||
GlideCheck.glideBuffer.remove(player.getUniqueId());
|
GlideCheck.lastDiff.remove(player.getUniqueId());
|
||||||
|
GlideCheck.violations.remove(player.getUniqueId());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void logExitFly(final Player player) {
|
public void logExitFly(final Player player) {
|
||||||
+1
-1
@@ -16,7 +16,7 @@
|
|||||||
* 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 net.gravitydevelopment.anticheat.check;
|
package com.rammelkast.anticheatreloaded.check;
|
||||||
|
|
||||||
public class CheckResult {
|
public class CheckResult {
|
||||||
|
|
||||||
+5
-4
@@ -16,14 +16,15 @@
|
|||||||
* 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 net.gravitydevelopment.anticheat.check;
|
package com.rammelkast.anticheatreloaded.check;
|
||||||
|
|
||||||
import net.gravitydevelopment.anticheat.api.CheckFailEvent;
|
|
||||||
import net.gravitydevelopment.anticheat.util.User;
|
|
||||||
import net.gravitydevelopment.anticheat.util.Permission;
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import com.rammelkast.anticheatreloaded.api.CheckFailEvent;
|
||||||
|
import com.rammelkast.anticheatreloaded.util.Permission;
|
||||||
|
import com.rammelkast.anticheatreloaded.util.User;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
+5
-5
@@ -1,4 +1,4 @@
|
|||||||
package net.gravitydevelopment.anticheat.check.combat;
|
package com.rammelkast.anticheatreloaded.check.combat;
|
||||||
|
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@@ -6,10 +6,10 @@ import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
|||||||
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||||
import org.bukkit.potion.PotionEffectType;
|
import org.bukkit.potion.PotionEffectType;
|
||||||
|
|
||||||
import net.gravitydevelopment.anticheat.check.CheckResult;
|
import com.rammelkast.anticheatreloaded.check.CheckResult;
|
||||||
import net.gravitydevelopment.anticheat.check.CheckType;
|
import com.rammelkast.anticheatreloaded.check.CheckType;
|
||||||
import net.gravitydevelopment.anticheat.event.EventListener;
|
import com.rammelkast.anticheatreloaded.event.EventListener;
|
||||||
import net.gravitydevelopment.anticheat.util.Utilities;
|
import com.rammelkast.anticheatreloaded.util.Utilities;
|
||||||
|
|
||||||
public class CriticalsCheck {
|
public class CriticalsCheck {
|
||||||
|
|
||||||
+9
-9
@@ -1,4 +1,4 @@
|
|||||||
package net.gravitydevelopment.anticheat.check.combat;
|
package com.rammelkast.anticheatreloaded.check.combat;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -12,13 +12,12 @@ 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 net.gravitydevelopment.anticheat.AntiCheat;
|
import com.rammelkast.anticheatreloaded.check.CheckResult;
|
||||||
import net.gravitydevelopment.anticheat.check.CheckResult;
|
import com.rammelkast.anticheatreloaded.check.CheckType;
|
||||||
import net.gravitydevelopment.anticheat.check.CheckType;
|
import com.rammelkast.anticheatreloaded.event.EventListener;
|
||||||
import net.gravitydevelopment.anticheat.event.EventListener;
|
import com.rammelkast.anticheatreloaded.util.NPC_1_11;
|
||||||
import net.gravitydevelopment.anticheat.util.NPC_1_11;
|
import com.rammelkast.anticheatreloaded.util.VersionUtil;
|
||||||
import net.gravitydevelopment.anticheat.util.VersionUtil;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Rammelkast
|
* @author Rammelkast
|
||||||
@@ -57,7 +56,8 @@ public class KillAuraCheck {
|
|||||||
}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.BLINK);
|
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);
|
||||||
|
AntiCheat.getPlugin().onKillAuraViolation();
|
||||||
VL_COUNT.remove(p.getUniqueId());
|
VL_COUNT.remove(p.getUniqueId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+6
-6
@@ -1,4 +1,4 @@
|
|||||||
package net.gravitydevelopment.anticheat.check.combat;
|
package com.rammelkast.anticheatreloaded.check.combat;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -9,10 +9,10 @@ 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 net.gravitydevelopment.anticheat.AntiCheat;
|
import com.rammelkast.anticheatreloaded.AntiCheat;
|
||||||
import net.gravitydevelopment.anticheat.check.CheckResult;
|
import com.rammelkast.anticheatreloaded.check.CheckResult;
|
||||||
import net.gravitydevelopment.anticheat.check.CheckType;
|
import com.rammelkast.anticheatreloaded.check.CheckType;
|
||||||
import net.gravitydevelopment.anticheat.event.EventListener;
|
import com.rammelkast.anticheatreloaded.event.EventListener;
|
||||||
|
|
||||||
public class VelocityCheck {
|
public class VelocityCheck {
|
||||||
|
|
||||||
@@ -37,7 +37,7 @@ public class VelocityCheck {
|
|||||||
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()) > AntiCheat.getManager().getBackend().getMagic().VELOCITY_AMT()) {
|
||||||
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() + ")").getMessage(), p, CheckType.VELOCITY);
|
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);
|
||||||
VL_COUNT.remove(p.getUniqueId());
|
VL_COUNT.remove(p.getUniqueId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+6
-8
@@ -1,10 +1,9 @@
|
|||||||
package net.gravitydevelopment.anticheat.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;
|
||||||
@@ -13,11 +12,10 @@ 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 net.gravitydevelopment.anticheat.AntiCheat;
|
import com.rammelkast.anticheatreloaded.check.CheckResult;
|
||||||
import net.gravitydevelopment.anticheat.check.CheckResult;
|
import com.rammelkast.anticheatreloaded.check.CheckType;
|
||||||
import net.gravitydevelopment.anticheat.check.CheckType;
|
import com.rammelkast.anticheatreloaded.event.EventListener;
|
||||||
import net.gravitydevelopment.anticheat.event.EventListener;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Rammelkast
|
* @author Rammelkast
|
||||||
@@ -32,7 +30,7 @@ public class BlinkCheck {
|
|||||||
public void run() {
|
public void run() {
|
||||||
MOVE_COUNT.clear();
|
MOVE_COUNT.clear();
|
||||||
}
|
}
|
||||||
}.runTaskTimer(AntiCheat.getPlugin(), 0, 20);
|
}.runTaskTimer(AntiCheat.getPlugin(), 20, 20);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void listenPackets() {
|
public static void listenPackets() {
|
||||||
+3
-3
@@ -1,9 +1,9 @@
|
|||||||
package net.gravitydevelopment.anticheat.check.movement;
|
package com.rammelkast.anticheatreloaded.check.movement;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import net.gravitydevelopment.anticheat.check.CheckResult;
|
import com.rammelkast.anticheatreloaded.check.CheckResult;
|
||||||
import net.gravitydevelopment.anticheat.util.Distance;
|
import com.rammelkast.anticheatreloaded.util.Distance;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO
|
* TODO
|
||||||
+6
-6
@@ -1,4 +1,4 @@
|
|||||||
package net.gravitydevelopment.anticheat.check.movement;
|
package com.rammelkast.anticheatreloaded.check.movement;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -8,11 +8,11 @@ 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 net.gravitydevelopment.anticheat.AntiCheat;
|
import com.rammelkast.anticheatreloaded.AntiCheat;
|
||||||
import net.gravitydevelopment.anticheat.check.CheckResult;
|
import com.rammelkast.anticheatreloaded.check.CheckResult;
|
||||||
import net.gravitydevelopment.anticheat.util.Distance;
|
import com.rammelkast.anticheatreloaded.util.Distance;
|
||||||
import net.gravitydevelopment.anticheat.util.Utilities;
|
import com.rammelkast.anticheatreloaded.util.Utilities;
|
||||||
import net.gravitydevelopment.anticheat.util.VersionUtil;
|
import com.rammelkast.anticheatreloaded.util.VersionUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -0,0 +1,72 @@
|
|||||||
|
package com.rammelkast.anticheatreloaded.check.movement;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
import org.bukkit.ChatColor;
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.block.BlockFace;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import com.rammelkast.anticheatreloaded.AntiCheat;
|
||||||
|
import com.rammelkast.anticheatreloaded.check.Backend;
|
||||||
|
import com.rammelkast.anticheatreloaded.check.CheckResult;
|
||||||
|
import com.rammelkast.anticheatreloaded.util.Distance;
|
||||||
|
import com.rammelkast.anticheatreloaded.util.Utilities;
|
||||||
|
import com.rammelkast.anticheatreloaded.util.VersionUtil;
|
||||||
|
|
||||||
|
public class GlideCheck {
|
||||||
|
|
||||||
|
private static final CheckResult PASS = new CheckResult(CheckResult.Result.PASSED);
|
||||||
|
|
||||||
|
public static Map<UUID, Double> lastDiff = new HashMap<UUID, Double>();
|
||||||
|
public static Map<UUID, Float> lastFallDistance = new HashMap<UUID, Float>();
|
||||||
|
public static Map<UUID, Integer> violations = new HashMap<UUID, Integer>();
|
||||||
|
|
||||||
|
public static CheckResult runCheck(Player player, Distance distance) {
|
||||||
|
if (VersionUtil.isFlying(player)) {
|
||||||
|
return PASS;
|
||||||
|
}
|
||||||
|
if (!lastDiff.containsKey(player.getUniqueId())) {
|
||||||
|
lastDiff.put(player.getUniqueId(), distance.getYDifference());
|
||||||
|
return PASS;
|
||||||
|
}
|
||||||
|
if (!lastFallDistance.containsKey(player.getUniqueId())) {
|
||||||
|
lastFallDistance.put(player.getUniqueId(), player.getFallDistance());
|
||||||
|
return PASS;
|
||||||
|
}
|
||||||
|
double yDiff = distance.getYDifference();
|
||||||
|
float fallDistance = player.getFallDistance();
|
||||||
|
if (yDiff == lastDiff.get(player.getUniqueId()) && fallDistance > lastFallDistance.get(player.getUniqueId())) {
|
||||||
|
if (!violations.containsKey(player.getUniqueId())) {
|
||||||
|
violations.put(player.getUniqueId(), 1);
|
||||||
|
} else {
|
||||||
|
if (violations.get(player.getUniqueId()) + 1 >= AntiCheat.getManager().getBackend().getMagic().GLIDE_LIMIT()) {
|
||||||
|
violations.remove(player.getUniqueId());
|
||||||
|
Location to = player.getLocation();
|
||||||
|
to.setY(to.getY() - distanceToFall(to));
|
||||||
|
player.teleport(to);
|
||||||
|
return new CheckResult(CheckResult.Result.FAILED,
|
||||||
|
player.getName() + " was set back for gliding (yDiff=" + new BigDecimal(yDiff).setScale(2, BigDecimal.ROUND_UP) + ")");
|
||||||
|
} else {
|
||||||
|
violations.put(player.getUniqueId(), violations.get(player.getUniqueId()) + 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
lastDiff.put(player.getUniqueId(), distance.getYDifference());
|
||||||
|
lastFallDistance.put(player.getUniqueId(), player.getFallDistance());
|
||||||
|
return PASS;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static double distanceToFall(Location location) {
|
||||||
|
location = location.clone();
|
||||||
|
double firstY = location.getY();
|
||||||
|
while (location.clone().add(0, -0.1, 0).getBlock().getType() == Material.AIR)
|
||||||
|
location.add(0, -0.1, 0);
|
||||||
|
return firstY - location.getY();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+4
-4
@@ -1,4 +1,4 @@
|
|||||||
package net.gravitydevelopment.anticheat.check.movement;
|
package com.rammelkast.anticheatreloaded.check.movement;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -8,9 +8,9 @@ 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 net.gravitydevelopment.anticheat.AntiCheat;
|
import com.rammelkast.anticheatreloaded.AntiCheat;
|
||||||
import net.gravitydevelopment.anticheat.check.CheckResult;
|
import com.rammelkast.anticheatreloaded.check.CheckResult;
|
||||||
import net.gravitydevelopment.anticheat.util.VersionUtil;
|
import com.rammelkast.anticheatreloaded.util.VersionUtil;
|
||||||
|
|
||||||
public class SpeedCheck {
|
public class SpeedCheck {
|
||||||
|
|
||||||
+4
-4
@@ -1,4 +1,4 @@
|
|||||||
package net.gravitydevelopment.anticheat.check.movement;
|
package com.rammelkast.anticheatreloaded.check.movement;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@@ -11,9 +11,9 @@ 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 net.gravitydevelopment.anticheat.AntiCheat;
|
import com.rammelkast.anticheatreloaded.AntiCheat;
|
||||||
import net.gravitydevelopment.anticheat.check.CheckResult;
|
import com.rammelkast.anticheatreloaded.check.CheckResult;
|
||||||
import net.gravitydevelopment.anticheat.util.Utilities;
|
import com.rammelkast.anticheatreloaded.util.Utilities;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This check seems to be broken/outdated
|
* This check seems to be broken/outdated
|
||||||
+6
-6
@@ -1,4 +1,4 @@
|
|||||||
package net.gravitydevelopment.anticheat.check.movement;
|
package com.rammelkast.anticheatreloaded.check.movement;
|
||||||
|
|
||||||
import java.util.EnumSet;
|
import java.util.EnumSet;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@@ -12,11 +12,11 @@ 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 net.gravitydevelopment.anticheat.AntiCheat;
|
import com.rammelkast.anticheatreloaded.AntiCheat;
|
||||||
import net.gravitydevelopment.anticheat.check.CheckResult;
|
import com.rammelkast.anticheatreloaded.check.CheckResult;
|
||||||
import net.gravitydevelopment.anticheat.util.Distance;
|
import com.rammelkast.anticheatreloaded.util.Distance;
|
||||||
import net.gravitydevelopment.anticheat.util.Utilities;
|
import com.rammelkast.anticheatreloaded.util.Utilities;
|
||||||
import net.gravitydevelopment.anticheat.util.VersionUtil;
|
import com.rammelkast.anticheatreloaded.util.VersionUtil;
|
||||||
|
|
||||||
public class YAxisCheck {
|
public class YAxisCheck {
|
||||||
|
|
||||||
+6
-6
@@ -16,7 +16,7 @@
|
|||||||
* 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 net.gravitydevelopment.anticheat.command;
|
package com.rammelkast.anticheatreloaded.command;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
@@ -24,11 +24,11 @@ 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 net.gravitydevelopment.anticheat.AntiCheat;
|
import com.rammelkast.anticheatreloaded.AntiCheat;
|
||||||
import net.gravitydevelopment.anticheat.config.Configuration;
|
import com.rammelkast.anticheatreloaded.config.Configuration;
|
||||||
import net.gravitydevelopment.anticheat.manage.CheckManager;
|
import com.rammelkast.anticheatreloaded.manage.CheckManager;
|
||||||
import net.gravitydevelopment.anticheat.manage.UserManager;
|
import com.rammelkast.anticheatreloaded.manage.UserManager;
|
||||||
import net.gravitydevelopment.anticheat.util.Permission;
|
import com.rammelkast.anticheatreloaded.util.Permission;
|
||||||
|
|
||||||
public class CommandBase {
|
public class CommandBase {
|
||||||
|
|
||||||
+9
-9
@@ -16,7 +16,7 @@
|
|||||||
* 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 net.gravitydevelopment.anticheat.command;
|
package com.rammelkast.anticheatreloaded.command;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -25,14 +25,14 @@ import org.bukkit.command.Command;
|
|||||||
import org.bukkit.command.CommandExecutor;
|
import org.bukkit.command.CommandExecutor;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
|
|
||||||
import net.gravitydevelopment.anticheat.command.executors.CommandCheck;
|
import com.rammelkast.anticheatreloaded.command.executors.CommandCheck;
|
||||||
import net.gravitydevelopment.anticheat.command.executors.CommandDebug;
|
import com.rammelkast.anticheatreloaded.command.executors.CommandDebug;
|
||||||
import net.gravitydevelopment.anticheat.command.executors.CommandDeveloper;
|
import com.rammelkast.anticheatreloaded.command.executors.CommandDeveloper;
|
||||||
import net.gravitydevelopment.anticheat.command.executors.CommandHelp;
|
import com.rammelkast.anticheatreloaded.command.executors.CommandHelp;
|
||||||
import net.gravitydevelopment.anticheat.command.executors.CommandLog;
|
import com.rammelkast.anticheatreloaded.command.executors.CommandLog;
|
||||||
import net.gravitydevelopment.anticheat.command.executors.CommandReload;
|
import com.rammelkast.anticheatreloaded.command.executors.CommandReload;
|
||||||
import net.gravitydevelopment.anticheat.command.executors.CommandReport;
|
import com.rammelkast.anticheatreloaded.command.executors.CommandReport;
|
||||||
import net.gravitydevelopment.anticheat.command.executors.CommandReset;
|
import com.rammelkast.anticheatreloaded.command.executors.CommandReset;
|
||||||
|
|
||||||
public class CommandHandler implements CommandExecutor {
|
public class CommandHandler implements CommandExecutor {
|
||||||
|
|
||||||
+5
-4
@@ -16,13 +16,14 @@
|
|||||||
* 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 net.gravitydevelopment.anticheat.command.executors;
|
package com.rammelkast.anticheatreloaded.command.executors;
|
||||||
|
|
||||||
import net.gravitydevelopment.anticheat.check.CheckType;
|
|
||||||
import net.gravitydevelopment.anticheat.command.CommandBase;
|
|
||||||
import net.gravitydevelopment.anticheat.util.Permission;
|
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
|
|
||||||
|
import com.rammelkast.anticheatreloaded.check.CheckType;
|
||||||
|
import com.rammelkast.anticheatreloaded.command.CommandBase;
|
||||||
|
import com.rammelkast.anticheatreloaded.util.Permission;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class CommandCheck extends CommandBase {
|
public class CommandCheck extends CommandBase {
|
||||||
+5
-4
@@ -16,15 +16,16 @@
|
|||||||
* 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 net.gravitydevelopment.anticheat.command.executors;
|
package com.rammelkast.anticheatreloaded.command.executors;
|
||||||
|
|
||||||
import net.gravitydevelopment.anticheat.command.CommandBase;
|
|
||||||
import net.gravitydevelopment.anticheat.util.PastebinReport;
|
|
||||||
import net.gravitydevelopment.anticheat.util.Permission;
|
|
||||||
import org.bukkit.Bukkit;
|
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.command.CommandBase;
|
||||||
|
import com.rammelkast.anticheatreloaded.util.PastebinReport;
|
||||||
|
import com.rammelkast.anticheatreloaded.util.Permission;
|
||||||
|
|
||||||
public class CommandDebug extends CommandBase {
|
public class CommandDebug extends CommandBase {
|
||||||
|
|
||||||
private static final String NAME = "AntiCheat Debug Reporting";
|
private static final String NAME = "AntiCheat Debug Reporting";
|
||||||
+5
-4
@@ -16,13 +16,14 @@
|
|||||||
* 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 net.gravitydevelopment.anticheat.command.executors;
|
package com.rammelkast.anticheatreloaded.command.executors;
|
||||||
|
|
||||||
import net.gravitydevelopment.anticheat.AntiCheat;
|
|
||||||
import net.gravitydevelopment.anticheat.command.CommandBase;
|
|
||||||
import net.gravitydevelopment.anticheat.util.Permission;
|
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
|
|
||||||
|
import com.rammelkast.anticheatreloaded.AntiCheat;
|
||||||
|
import com.rammelkast.anticheatreloaded.command.CommandBase;
|
||||||
|
import com.rammelkast.anticheatreloaded.util.Permission;
|
||||||
|
|
||||||
public class CommandDeveloper extends CommandBase {
|
public class CommandDeveloper extends CommandBase {
|
||||||
|
|
||||||
private static final String NAME = "AntiCheat Developer Mode";
|
private static final String NAME = "AntiCheat Developer Mode";
|
||||||
+4
-3
@@ -16,12 +16,13 @@
|
|||||||
* 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 net.gravitydevelopment.anticheat.command.executors;
|
package com.rammelkast.anticheatreloaded.command.executors;
|
||||||
|
|
||||||
import net.gravitydevelopment.anticheat.command.CommandBase;
|
|
||||||
import net.gravitydevelopment.anticheat.util.Permission;
|
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
|
|
||||||
|
import com.rammelkast.anticheatreloaded.command.CommandBase;
|
||||||
|
import com.rammelkast.anticheatreloaded.util.Permission;
|
||||||
|
|
||||||
public class CommandHelp extends CommandBase {
|
public class CommandHelp extends CommandBase {
|
||||||
|
|
||||||
private static final String NAME = "AntiCheatReloaded Help";
|
private static final String NAME = "AntiCheatReloaded Help";
|
||||||
+5
-4
@@ -16,13 +16,14 @@
|
|||||||
* 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 net.gravitydevelopment.anticheat.command.executors;
|
package com.rammelkast.anticheatreloaded.command.executors;
|
||||||
|
|
||||||
import net.gravitydevelopment.anticheat.command.CommandBase;
|
|
||||||
import net.gravitydevelopment.anticheat.config.ConfigurationFile;
|
|
||||||
import net.gravitydevelopment.anticheat.util.Permission;
|
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
|
|
||||||
|
import com.rammelkast.anticheatreloaded.command.CommandBase;
|
||||||
|
import com.rammelkast.anticheatreloaded.config.ConfigurationFile;
|
||||||
|
import com.rammelkast.anticheatreloaded.util.Permission;
|
||||||
|
|
||||||
public class CommandLog extends CommandBase {
|
public class CommandLog extends CommandBase {
|
||||||
|
|
||||||
private static final String NAME = "AntiCheat Logging";
|
private static final String NAME = "AntiCheat Logging";
|
||||||
+4
-3
@@ -16,12 +16,13 @@
|
|||||||
* 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 net.gravitydevelopment.anticheat.command.executors;
|
package com.rammelkast.anticheatreloaded.command.executors;
|
||||||
|
|
||||||
import net.gravitydevelopment.anticheat.command.CommandBase;
|
|
||||||
import net.gravitydevelopment.anticheat.util.Permission;
|
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
|
|
||||||
|
import com.rammelkast.anticheatreloaded.command.CommandBase;
|
||||||
|
import com.rammelkast.anticheatreloaded.util.Permission;
|
||||||
|
|
||||||
public class CommandReload extends CommandBase {
|
public class CommandReload extends CommandBase {
|
||||||
|
|
||||||
private static final String NAME = "AntiCheat Reload";
|
private static final String NAME = "AntiCheat Reload";
|
||||||
+7
-6
@@ -16,18 +16,19 @@
|
|||||||
* 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 net.gravitydevelopment.anticheat.command.executors;
|
package com.rammelkast.anticheatreloaded.command.executors;
|
||||||
|
|
||||||
import net.gravitydevelopment.anticheat.AntiCheat;
|
|
||||||
import net.gravitydevelopment.anticheat.check.CheckType;
|
|
||||||
import net.gravitydevelopment.anticheat.command.CommandBase;
|
|
||||||
import net.gravitydevelopment.anticheat.manage.CheckManager;
|
|
||||||
import net.gravitydevelopment.anticheat.util.*;
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.ChatColor;
|
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.check.CheckType;
|
||||||
|
import com.rammelkast.anticheatreloaded.command.CommandBase;
|
||||||
|
import com.rammelkast.anticheatreloaded.manage.CheckManager;
|
||||||
|
import com.rammelkast.anticheatreloaded.util.*;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
+6
-6
@@ -16,17 +16,17 @@
|
|||||||
* 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 net.gravitydevelopment.anticheat.command.executors;
|
package com.rammelkast.anticheatreloaded.command.executors;
|
||||||
|
|
||||||
import net.gravitydevelopment.anticheat.AntiCheat;
|
|
||||||
import net.gravitydevelopment.anticheat.command.CommandBase;
|
|
||||||
import net.gravitydevelopment.anticheat.util.Permission;
|
|
||||||
import net.gravitydevelopment.anticheat.util.User;
|
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
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.command.CommandBase;
|
||||||
|
import com.rammelkast.anticheatreloaded.util.Permission;
|
||||||
|
import com.rammelkast.anticheatreloaded.util.User;
|
||||||
|
|
||||||
public class CommandReset extends CommandBase {
|
public class CommandReset extends CommandBase {
|
||||||
|
|
||||||
private static final String NAME = "AntiCheat Resetting";
|
private static final String NAME = "AntiCheat Resetting";
|
||||||
+9
-8
@@ -16,17 +16,18 @@
|
|||||||
* 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 net.gravitydevelopment.anticheat.config;
|
package com.rammelkast.anticheatreloaded.config;
|
||||||
|
|
||||||
import net.gravitydevelopment.anticheat.AntiCheat;
|
|
||||||
import net.gravitydevelopment.anticheat.config.files.Config;
|
|
||||||
import net.gravitydevelopment.anticheat.config.files.Enterprise;
|
|
||||||
import net.gravitydevelopment.anticheat.config.holders.mysql.*;
|
|
||||||
import net.gravitydevelopment.anticheat.config.holders.yaml.*;
|
|
||||||
import net.gravitydevelopment.anticheat.config.providers.*;
|
|
||||||
import net.gravitydevelopment.anticheat.manage.AntiCheatManager;
|
|
||||||
import org.bukkit.configuration.file.YamlConfiguration;
|
import org.bukkit.configuration.file.YamlConfiguration;
|
||||||
|
|
||||||
|
import com.rammelkast.anticheatreloaded.AntiCheat;
|
||||||
|
import com.rammelkast.anticheatreloaded.config.files.Config;
|
||||||
|
import com.rammelkast.anticheatreloaded.config.files.Enterprise;
|
||||||
|
import com.rammelkast.anticheatreloaded.config.holders.mysql.*;
|
||||||
|
import com.rammelkast.anticheatreloaded.config.holders.yaml.*;
|
||||||
|
import com.rammelkast.anticheatreloaded.config.providers.*;
|
||||||
|
import com.rammelkast.anticheatreloaded.manage.AntiCheatManager;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.lang.reflect.InvocationHandler;
|
import java.lang.reflect.InvocationHandler;
|
||||||
import java.lang.reflect.Proxy;
|
import java.lang.reflect.Proxy;
|
||||||
+4
-3
@@ -16,13 +16,14 @@
|
|||||||
* 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 net.gravitydevelopment.anticheat.config;
|
package com.rammelkast.anticheatreloaded.config;
|
||||||
|
|
||||||
import net.gravitydevelopment.anticheat.AntiCheat;
|
|
||||||
import net.gravitydevelopment.anticheat.config.yaml.CommentedConfiguration;
|
|
||||||
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.config.yaml.CommentedConfiguration;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
+4
-3
@@ -16,12 +16,13 @@
|
|||||||
* 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 net.gravitydevelopment.anticheat.config;
|
package com.rammelkast.anticheatreloaded.config;
|
||||||
|
|
||||||
import net.gravitydevelopment.anticheat.AntiCheat;
|
|
||||||
import net.gravitydevelopment.anticheat.util.enterprise.Database;
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
|
||||||
|
import com.rammelkast.anticheatreloaded.AntiCheat;
|
||||||
|
import com.rammelkast.anticheatreloaded.util.enterprise.Database;
|
||||||
|
|
||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
import java.sql.PreparedStatement;
|
import java.sql.PreparedStatement;
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
+5
-5
@@ -16,14 +16,14 @@
|
|||||||
* 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 net.gravitydevelopment.anticheat.config.files;
|
package com.rammelkast.anticheatreloaded.config.files;
|
||||||
|
|
||||||
import net.gravitydevelopment.anticheat.AntiCheat;
|
|
||||||
import net.gravitydevelopment.anticheat.config.Configuration;
|
|
||||||
import net.gravitydevelopment.anticheat.config.ConfigurationFile;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.rammelkast.anticheatreloaded.AntiCheat;
|
||||||
|
import com.rammelkast.anticheatreloaded.config.Configuration;
|
||||||
|
import com.rammelkast.anticheatreloaded.config.ConfigurationFile;
|
||||||
|
|
||||||
public class Config extends ConfigurationFile {
|
public class Config extends ConfigurationFile {
|
||||||
|
|
||||||
public static final String FILENAME = "config.yml";
|
public static final String FILENAME = "config.yml";
|
||||||
+5
-5
@@ -16,12 +16,12 @@
|
|||||||
* 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 net.gravitydevelopment.anticheat.config.files;
|
package com.rammelkast.anticheatreloaded.config.files;
|
||||||
|
|
||||||
import net.gravitydevelopment.anticheat.AntiCheat;
|
import com.rammelkast.anticheatreloaded.AntiCheat;
|
||||||
import net.gravitydevelopment.anticheat.config.Configuration;
|
import com.rammelkast.anticheatreloaded.config.Configuration;
|
||||||
import net.gravitydevelopment.anticheat.config.ConfigurationFile;
|
import com.rammelkast.anticheatreloaded.config.ConfigurationFile;
|
||||||
import net.gravitydevelopment.anticheat.util.enterprise.Database;
|
import com.rammelkast.anticheatreloaded.util.enterprise.Database;
|
||||||
|
|
||||||
public class Enterprise extends ConfigurationFile {
|
public class Enterprise extends ConfigurationFile {
|
||||||
|
|
||||||
+6
-6
@@ -16,12 +16,7 @@
|
|||||||
* 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 net.gravitydevelopment.anticheat.config.holders.mysql;
|
package com.rammelkast.anticheatreloaded.config.holders.mysql;
|
||||||
|
|
||||||
import net.gravitydevelopment.anticheat.config.Configuration;
|
|
||||||
import net.gravitydevelopment.anticheat.config.ConfigurationTable;
|
|
||||||
import net.gravitydevelopment.anticheat.config.providers.Groups;
|
|
||||||
import net.gravitydevelopment.anticheat.util.Group;
|
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -29,6 +24,11 @@ import java.util.ArrayList;
|
|||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.rammelkast.anticheatreloaded.config.Configuration;
|
||||||
|
import com.rammelkast.anticheatreloaded.config.ConfigurationTable;
|
||||||
|
import com.rammelkast.anticheatreloaded.config.providers.Groups;
|
||||||
|
import com.rammelkast.anticheatreloaded.util.Group;
|
||||||
|
|
||||||
public class MySQLGroupsHolder extends ConfigurationTable implements Groups {
|
public class MySQLGroupsHolder extends ConfigurationTable implements Groups {
|
||||||
|
|
||||||
private static final String TABLE = "groups";
|
private static final String TABLE = "groups";
|
||||||
+6
-5
@@ -16,15 +16,16 @@
|
|||||||
* 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 net.gravitydevelopment.anticheat.config.holders.mysql;
|
package com.rammelkast.anticheatreloaded.config.holders.mysql;
|
||||||
|
|
||||||
import net.gravitydevelopment.anticheat.AntiCheat;
|
|
||||||
import net.gravitydevelopment.anticheat.config.Configuration;
|
|
||||||
import net.gravitydevelopment.anticheat.config.ConfigurationTable;
|
|
||||||
import net.gravitydevelopment.anticheat.config.providers.Lang;
|
|
||||||
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.config.Configuration;
|
||||||
|
import com.rammelkast.anticheatreloaded.config.ConfigurationTable;
|
||||||
|
import com.rammelkast.anticheatreloaded.config.providers.Lang;
|
||||||
|
|
||||||
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;
|
||||||
+7
-6
@@ -16,15 +16,16 @@
|
|||||||
* 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 net.gravitydevelopment.anticheat.config.holders.mysql;
|
package com.rammelkast.anticheatreloaded.config.holders.mysql;
|
||||||
|
|
||||||
import net.gravitydevelopment.anticheat.AntiCheat;
|
|
||||||
import net.gravitydevelopment.anticheat.config.Configuration;
|
|
||||||
import net.gravitydevelopment.anticheat.config.ConfigurationTable;
|
|
||||||
import net.gravitydevelopment.anticheat.config.providers.Levels;
|
|
||||||
import net.gravitydevelopment.anticheat.util.User;
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
|
||||||
|
import com.rammelkast.anticheatreloaded.AntiCheat;
|
||||||
|
import com.rammelkast.anticheatreloaded.config.Configuration;
|
||||||
|
import com.rammelkast.anticheatreloaded.config.ConfigurationTable;
|
||||||
|
import com.rammelkast.anticheatreloaded.config.providers.Levels;
|
||||||
|
import com.rammelkast.anticheatreloaded.util.User;
|
||||||
|
|
||||||
import java.sql.PreparedStatement;
|
import java.sql.PreparedStatement;
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
+6
-5
@@ -16,15 +16,16 @@
|
|||||||
* 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 net.gravitydevelopment.anticheat.config.holders.mysql;
|
package com.rammelkast.anticheatreloaded.config.holders.mysql;
|
||||||
|
|
||||||
import net.gravitydevelopment.anticheat.AntiCheat;
|
|
||||||
import net.gravitydevelopment.anticheat.config.Configuration;
|
|
||||||
import net.gravitydevelopment.anticheat.config.ConfigurationTable;
|
|
||||||
import net.gravitydevelopment.anticheat.config.providers.Magic;
|
|
||||||
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.config.Configuration;
|
||||||
|
import com.rammelkast.anticheatreloaded.config.ConfigurationTable;
|
||||||
|
import com.rammelkast.anticheatreloaded.config.providers.Magic;
|
||||||
|
|
||||||
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;
|
||||||
+7
-7
@@ -16,19 +16,19 @@
|
|||||||
* 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 net.gravitydevelopment.anticheat.config.holders.mysql;
|
package com.rammelkast.anticheatreloaded.config.holders.mysql;
|
||||||
|
|
||||||
import net.gravitydevelopment.anticheat.AntiCheat;
|
|
||||||
import net.gravitydevelopment.anticheat.config.Configuration;
|
|
||||||
import net.gravitydevelopment.anticheat.config.ConfigurationTable;
|
|
||||||
import net.gravitydevelopment.anticheat.config.providers.Rules;
|
|
||||||
import net.gravitydevelopment.anticheat.util.rule.Rule;
|
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
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.config.Configuration;
|
||||||
|
import com.rammelkast.anticheatreloaded.config.ConfigurationTable;
|
||||||
|
import com.rammelkast.anticheatreloaded.config.providers.Rules;
|
||||||
|
import com.rammelkast.anticheatreloaded.util.rule.Rule;
|
||||||
|
|
||||||
public class MySQLRulesHolder extends ConfigurationTable implements Rules {
|
public class MySQLRulesHolder extends ConfigurationTable implements Rules {
|
||||||
|
|
||||||
private static final String TABLE = "rules";
|
private static final String TABLE = "rules";
|
||||||
+7
-7
@@ -16,16 +16,16 @@
|
|||||||
* 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 net.gravitydevelopment.anticheat.config.holders.yaml;
|
package com.rammelkast.anticheatreloaded.config.holders.yaml;
|
||||||
|
|
||||||
import net.gravitydevelopment.anticheat.AntiCheat;
|
|
||||||
import net.gravitydevelopment.anticheat.config.Configuration;
|
|
||||||
import net.gravitydevelopment.anticheat.config.ConfigurationFile;
|
|
||||||
import net.gravitydevelopment.anticheat.config.providers.Groups;
|
|
||||||
import net.gravitydevelopment.anticheat.util.Group;
|
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
|
import com.rammelkast.anticheatreloaded.AntiCheat;
|
||||||
|
import com.rammelkast.anticheatreloaded.config.Configuration;
|
||||||
|
import com.rammelkast.anticheatreloaded.config.ConfigurationFile;
|
||||||
|
import com.rammelkast.anticheatreloaded.config.providers.Groups;
|
||||||
|
import com.rammelkast.anticheatreloaded.util.Group;
|
||||||
|
|
||||||
public class YamlGroupsHolder extends ConfigurationFile implements Groups {
|
public class YamlGroupsHolder extends ConfigurationFile implements Groups {
|
||||||
|
|
||||||
public static final String FILENAME = "groups.yml";
|
public static final String FILENAME = "groups.yml";
|
||||||
+5
-5
@@ -16,16 +16,16 @@
|
|||||||
* 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 net.gravitydevelopment.anticheat.config.holders.yaml;
|
package com.rammelkast.anticheatreloaded.config.holders.yaml;
|
||||||
|
|
||||||
import net.gravitydevelopment.anticheat.AntiCheat;
|
|
||||||
import net.gravitydevelopment.anticheat.config.Configuration;
|
|
||||||
import net.gravitydevelopment.anticheat.config.ConfigurationFile;
|
|
||||||
|
|
||||||
import java.lang.reflect.InvocationHandler;
|
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.config.Configuration;
|
||||||
|
import com.rammelkast.anticheatreloaded.config.ConfigurationFile;
|
||||||
|
|
||||||
public class YamlLangHolder extends ConfigurationFile implements InvocationHandler {
|
public class YamlLangHolder extends ConfigurationFile implements InvocationHandler {
|
||||||
|
|
||||||
public static final String FILENAME = "lang.yml";
|
public static final String FILENAME = "lang.yml";
|
||||||
+7
-7
@@ -16,17 +16,17 @@
|
|||||||
* 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 net.gravitydevelopment.anticheat.config.holders.yaml;
|
package com.rammelkast.anticheatreloaded.config.holders.yaml;
|
||||||
|
|
||||||
import net.gravitydevelopment.anticheat.AntiCheat;
|
|
||||||
import net.gravitydevelopment.anticheat.config.Configuration;
|
|
||||||
import net.gravitydevelopment.anticheat.config.ConfigurationFile;
|
|
||||||
import net.gravitydevelopment.anticheat.config.providers.Levels;
|
|
||||||
import net.gravitydevelopment.anticheat.util.User;
|
|
||||||
|
|
||||||
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.config.Configuration;
|
||||||
|
import com.rammelkast.anticheatreloaded.config.ConfigurationFile;
|
||||||
|
import com.rammelkast.anticheatreloaded.config.providers.Levels;
|
||||||
|
import com.rammelkast.anticheatreloaded.util.User;
|
||||||
|
|
||||||
public class YamlLevelsHolder extends ConfigurationFile implements Levels {
|
public class YamlLevelsHolder extends ConfigurationFile implements Levels {
|
||||||
|
|
||||||
public static final String FILENAME = "data/levels.yml";
|
public static final String FILENAME = "data/levels.yml";
|
||||||
+5
-5
@@ -16,15 +16,15 @@
|
|||||||
* 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 net.gravitydevelopment.anticheat.config.holders.yaml;
|
package com.rammelkast.anticheatreloaded.config.holders.yaml;
|
||||||
|
|
||||||
import net.gravitydevelopment.anticheat.AntiCheat;
|
|
||||||
import net.gravitydevelopment.anticheat.config.Configuration;
|
|
||||||
import net.gravitydevelopment.anticheat.config.ConfigurationFile;
|
|
||||||
|
|
||||||
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.config.Configuration;
|
||||||
|
import com.rammelkast.anticheatreloaded.config.ConfigurationFile;
|
||||||
|
|
||||||
public class YamlMagicHolder extends ConfigurationFile implements InvocationHandler {
|
public class YamlMagicHolder extends ConfigurationFile implements InvocationHandler {
|
||||||
|
|
||||||
public static final String FILENAME = "magic.yml";
|
public static final String FILENAME = "magic.yml";
|
||||||
+7
-7
@@ -16,17 +16,17 @@
|
|||||||
* 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 net.gravitydevelopment.anticheat.config.holders.yaml;
|
package com.rammelkast.anticheatreloaded.config.holders.yaml;
|
||||||
|
|
||||||
import net.gravitydevelopment.anticheat.AntiCheat;
|
|
||||||
import net.gravitydevelopment.anticheat.config.Configuration;
|
|
||||||
import net.gravitydevelopment.anticheat.config.ConfigurationFile;
|
|
||||||
import net.gravitydevelopment.anticheat.config.providers.Rules;
|
|
||||||
import net.gravitydevelopment.anticheat.util.rule.Rule;
|
|
||||||
|
|
||||||
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.config.Configuration;
|
||||||
|
import com.rammelkast.anticheatreloaded.config.ConfigurationFile;
|
||||||
|
import com.rammelkast.anticheatreloaded.config.providers.Rules;
|
||||||
|
import com.rammelkast.anticheatreloaded.util.rule.Rule;
|
||||||
|
|
||||||
public class YamlRulesHolder extends ConfigurationFile implements Rules {
|
public class YamlRulesHolder extends ConfigurationFile implements Rules {
|
||||||
|
|
||||||
public static final String FILENAME = "rules.yml";
|
public static final String FILENAME = "rules.yml";
|
||||||
+3
-3
@@ -16,12 +16,12 @@
|
|||||||
* 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 net.gravitydevelopment.anticheat.config.providers;
|
package com.rammelkast.anticheatreloaded.config.providers;
|
||||||
|
|
||||||
import net.gravitydevelopment.anticheat.util.Group;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.rammelkast.anticheatreloaded.util.Group;
|
||||||
|
|
||||||
public interface Groups {
|
public interface Groups {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package net.gravitydevelopment.anticheat.config.providers;
|
package com.rammelkast.anticheatreloaded.config.providers;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
+3
-3
@@ -16,12 +16,12 @@
|
|||||||
* 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 net.gravitydevelopment.anticheat.config.providers;
|
package com.rammelkast.anticheatreloaded.config.providers;
|
||||||
|
|
||||||
import net.gravitydevelopment.anticheat.util.User;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.rammelkast.anticheatreloaded.util.User;
|
||||||
|
|
||||||
public interface Levels {
|
public interface Levels {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
+1
-5
@@ -16,7 +16,7 @@
|
|||||||
* 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 net.gravitydevelopment.anticheat.config.providers;
|
package com.rammelkast.anticheatreloaded.config.providers;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Magic number class. Modifications to values in magic.yml will be accepted here.
|
* Magic number class. Modifications to values in magic.yml will be accepted here.
|
||||||
@@ -161,10 +161,6 @@ public interface Magic {
|
|||||||
* Number of times a player can be caught in-glide before action is taken; Type=INTEGER, Leniency=INCREASE.
|
* Number of times a player can be caught in-glide before action is taken; Type=INTEGER, Leniency=INCREASE.
|
||||||
*/
|
*/
|
||||||
public int GLIDE_LIMIT();
|
public int GLIDE_LIMIT();
|
||||||
/**
|
|
||||||
* The max fallspeed after which glide check is disabled; Type=DOUBLE
|
|
||||||
*/
|
|
||||||
public double GLIDE_MAX();
|
|
||||||
/**
|
/**
|
||||||
* How many blocks you can travel before action is taken; Type=INTEGER, Leniency=INCREASE.
|
* How many blocks you can travel before action is taken; Type=INTEGER, Leniency=INCREASE.
|
||||||
*/
|
*/
|
||||||
+3
-3
@@ -17,12 +17,12 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
package net.gravitydevelopment.anticheat.config.providers;
|
package com.rammelkast.anticheatreloaded.config.providers;
|
||||||
|
|
||||||
import net.gravitydevelopment.anticheat.util.rule.Rule;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.rammelkast.anticheatreloaded.util.rule.Rule;
|
||||||
|
|
||||||
public interface Rules {
|
public interface Rules {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
+1
-1
@@ -16,7 +16,7 @@
|
|||||||
* 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 net.gravitydevelopment.anticheat.config.yaml;
|
package com.rammelkast.anticheatreloaded.config.yaml;
|
||||||
|
|
||||||
import org.apache.commons.lang.Validate;
|
import org.apache.commons.lang.Validate;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
+7
-6
@@ -16,13 +16,8 @@
|
|||||||
* 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 net.gravitydevelopment.anticheat.event;
|
package com.rammelkast.anticheatreloaded.event;
|
||||||
|
|
||||||
import net.gravitydevelopment.anticheat.AntiCheat;
|
|
||||||
import net.gravitydevelopment.anticheat.check.CheckType;
|
|
||||||
import net.gravitydevelopment.anticheat.check.CheckResult;
|
|
||||||
import net.gravitydevelopment.anticheat.util.Distance;
|
|
||||||
import net.gravitydevelopment.anticheat.util.Utilities;
|
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
@@ -31,6 +26,12 @@ 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.check.CheckResult;
|
||||||
|
import com.rammelkast.anticheatreloaded.check.CheckType;
|
||||||
|
import com.rammelkast.anticheatreloaded.util.Distance;
|
||||||
|
import com.rammelkast.anticheatreloaded.util.Utilities;
|
||||||
|
|
||||||
public class BlockListener extends EventListener {
|
public class BlockListener extends EventListener {
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.MONITOR)
|
@EventHandler(priority = EventPriority.MONITOR)
|
||||||
+10
-9
@@ -16,7 +16,7 @@
|
|||||||
* 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 net.gravitydevelopment.anticheat.event;
|
package com.rammelkast.anticheatreloaded.event;
|
||||||
|
|
||||||
import org.bukkit.enchantments.Enchantment;
|
import org.bukkit.enchantments.Enchantment;
|
||||||
import org.bukkit.entity.Creeper;
|
import org.bukkit.entity.Creeper;
|
||||||
@@ -28,17 +28,18 @@ import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
|||||||
import org.bukkit.event.entity.EntityDamageEvent;
|
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.check.CheckResult;
|
||||||
|
import com.rammelkast.anticheatreloaded.check.CheckType;
|
||||||
|
import com.rammelkast.anticheatreloaded.check.combat.CriticalsCheck;
|
||||||
|
import com.rammelkast.anticheatreloaded.check.combat.KillAuraCheck;
|
||||||
|
import com.rammelkast.anticheatreloaded.check.combat.VelocityCheck;
|
||||||
|
import com.rammelkast.anticheatreloaded.util.Distance;
|
||||||
|
|
||||||
import org.bukkit.event.entity.EntityShootBowEvent;
|
import org.bukkit.event.entity.EntityShootBowEvent;
|
||||||
import org.bukkit.event.entity.FoodLevelChangeEvent;
|
import org.bukkit.event.entity.FoodLevelChangeEvent;
|
||||||
|
|
||||||
import net.gravitydevelopment.anticheat.AntiCheat;
|
|
||||||
import net.gravitydevelopment.anticheat.check.CheckResult;
|
|
||||||
import net.gravitydevelopment.anticheat.check.CheckType;
|
|
||||||
import net.gravitydevelopment.anticheat.check.combat.CriticalsCheck;
|
|
||||||
import net.gravitydevelopment.anticheat.check.combat.KillAuraCheck;
|
|
||||||
import net.gravitydevelopment.anticheat.check.combat.VelocityCheck;
|
|
||||||
import net.gravitydevelopment.anticheat.util.Distance;
|
|
||||||
|
|
||||||
public class EntityListener extends EventListener {
|
public class EntityListener extends EventListener {
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
+8
-7
@@ -16,17 +16,18 @@
|
|||||||
* 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 net.gravitydevelopment.anticheat.event;
|
package com.rammelkast.anticheatreloaded.event;
|
||||||
|
|
||||||
import net.gravitydevelopment.anticheat.AntiCheat;
|
|
||||||
import net.gravitydevelopment.anticheat.check.Backend;
|
|
||||||
import net.gravitydevelopment.anticheat.check.CheckType;
|
|
||||||
import net.gravitydevelopment.anticheat.config.Configuration;
|
|
||||||
import net.gravitydevelopment.anticheat.manage.*;
|
|
||||||
import net.gravitydevelopment.anticheat.util.User;
|
|
||||||
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.check.Backend;
|
||||||
|
import com.rammelkast.anticheatreloaded.check.CheckType;
|
||||||
|
import com.rammelkast.anticheatreloaded.config.Configuration;
|
||||||
|
import com.rammelkast.anticheatreloaded.manage.*;
|
||||||
|
import com.rammelkast.anticheatreloaded.util.User;
|
||||||
|
|
||||||
import java.util.EnumMap;
|
import java.util.EnumMap;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
+6
-5
@@ -16,12 +16,8 @@
|
|||||||
* 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 net.gravitydevelopment.anticheat.event;
|
package com.rammelkast.anticheatreloaded.event;
|
||||||
|
|
||||||
import net.gravitydevelopment.anticheat.AntiCheat;
|
|
||||||
import net.gravitydevelopment.anticheat.check.CheckType;
|
|
||||||
import net.gravitydevelopment.anticheat.util.User;
|
|
||||||
import net.gravitydevelopment.anticheat.check.CheckResult;
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||||
@@ -29,6 +25,11 @@ 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.check.CheckResult;
|
||||||
|
import com.rammelkast.anticheatreloaded.check.CheckType;
|
||||||
|
import com.rammelkast.anticheatreloaded.util.User;
|
||||||
|
|
||||||
public class InventoryListener extends EventListener {
|
public class InventoryListener extends EventListener {
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
+16
-16
@@ -16,7 +16,7 @@
|
|||||||
* 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 net.gravitydevelopment.anticheat.event;
|
package com.rammelkast.anticheatreloaded.event;
|
||||||
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.GameMode;
|
import org.bukkit.GameMode;
|
||||||
@@ -51,21 +51,21 @@ 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 net.gravitydevelopment.anticheat.AntiCheat;
|
import com.rammelkast.anticheatreloaded.AntiCheat;
|
||||||
import net.gravitydevelopment.anticheat.check.CheckResult;
|
import com.rammelkast.anticheatreloaded.check.CheckResult;
|
||||||
import net.gravitydevelopment.anticheat.check.CheckType;
|
import com.rammelkast.anticheatreloaded.check.CheckType;
|
||||||
import net.gravitydevelopment.anticheat.check.combat.KillAuraCheck;
|
import com.rammelkast.anticheatreloaded.check.combat.KillAuraCheck;
|
||||||
import net.gravitydevelopment.anticheat.check.movement.ElytraFly;
|
import com.rammelkast.anticheatreloaded.check.movement.ElytraFly;
|
||||||
import net.gravitydevelopment.anticheat.check.movement.FlightCheck;
|
import com.rammelkast.anticheatreloaded.check.movement.FlightCheck;
|
||||||
import net.gravitydevelopment.anticheat.check.movement.GlideCheck;
|
import com.rammelkast.anticheatreloaded.check.movement.GlideCheck;
|
||||||
import net.gravitydevelopment.anticheat.check.movement.SpeedCheck;
|
import com.rammelkast.anticheatreloaded.check.movement.SpeedCheck;
|
||||||
import net.gravitydevelopment.anticheat.check.movement.WaterWalkCheck;
|
import com.rammelkast.anticheatreloaded.check.movement.WaterWalkCheck;
|
||||||
import net.gravitydevelopment.anticheat.check.movement.YAxisCheck;
|
import com.rammelkast.anticheatreloaded.check.movement.YAxisCheck;
|
||||||
import net.gravitydevelopment.anticheat.util.Distance;
|
import com.rammelkast.anticheatreloaded.util.Distance;
|
||||||
import net.gravitydevelopment.anticheat.util.Permission;
|
import com.rammelkast.anticheatreloaded.util.Permission;
|
||||||
import net.gravitydevelopment.anticheat.util.User;
|
import com.rammelkast.anticheatreloaded.util.User;
|
||||||
import net.gravitydevelopment.anticheat.util.Utilities;
|
import com.rammelkast.anticheatreloaded.util.Utilities;
|
||||||
import net.gravitydevelopment.anticheat.util.VersionUtil;
|
import com.rammelkast.anticheatreloaded.util.VersionUtil;
|
||||||
|
|
||||||
public class PlayerListener extends EventListener {
|
public class PlayerListener extends EventListener {
|
||||||
|
|
||||||
+3
-2
@@ -16,15 +16,16 @@
|
|||||||
* 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 net.gravitydevelopment.anticheat.event;
|
package com.rammelkast.anticheatreloaded.event;
|
||||||
|
|
||||||
import net.gravitydevelopment.anticheat.AntiCheat;
|
|
||||||
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;
|
||||||
|
|
||||||
public class VehicleListener extends EventListener {
|
public class VehicleListener extends EventListener {
|
||||||
|
|
||||||
@EventHandler(ignoreCancelled = true)
|
@EventHandler(ignoreCancelled = true)
|
||||||
+4
-4
@@ -16,7 +16,7 @@
|
|||||||
* 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 net.gravitydevelopment.anticheat.manage;
|
package com.rammelkast.anticheatreloaded.manage;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
@@ -25,9 +25,9 @@ import java.util.logging.Logger;
|
|||||||
|
|
||||||
import org.bukkit.plugin.RegisteredListener;
|
import org.bukkit.plugin.RegisteredListener;
|
||||||
|
|
||||||
import net.gravitydevelopment.anticheat.AntiCheat;
|
import com.rammelkast.anticheatreloaded.AntiCheat;
|
||||||
import net.gravitydevelopment.anticheat.check.Backend;
|
import com.rammelkast.anticheatreloaded.check.Backend;
|
||||||
import net.gravitydevelopment.anticheat.config.Configuration;
|
import com.rammelkast.anticheatreloaded.config.Configuration;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The internal hub for all managers.
|
* The internal hub for all managers.
|
||||||
+5
-4
@@ -16,14 +16,15 @@
|
|||||||
* 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 net.gravitydevelopment.anticheat.manage;
|
package com.rammelkast.anticheatreloaded.manage;
|
||||||
|
|
||||||
import net.gravitydevelopment.anticheat.AntiCheat;
|
|
||||||
import net.gravitydevelopment.anticheat.check.CheckType;
|
|
||||||
import net.gravitydevelopment.anticheat.config.Configuration;
|
|
||||||
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.check.CheckType;
|
||||||
|
import com.rammelkast.anticheatreloaded.config.Configuration;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
+6
-5
@@ -16,16 +16,17 @@
|
|||||||
* 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 net.gravitydevelopment.anticheat.manage;
|
package com.rammelkast.anticheatreloaded.manage;
|
||||||
|
|
||||||
import net.gravitydevelopment.anticheat.AntiCheat;
|
|
||||||
import net.gravitydevelopment.anticheat.config.Configuration;
|
|
||||||
import net.gravitydevelopment.anticheat.util.FileFormatter;
|
|
||||||
import net.gravitydevelopment.anticheat.util.Permission;
|
|
||||||
import org.bukkit.Bukkit;
|
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.config.Configuration;
|
||||||
|
import com.rammelkast.anticheatreloaded.util.FileFormatter;
|
||||||
|
import com.rammelkast.anticheatreloaded.util.Permission;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.CopyOnWriteArrayList;
|
import java.util.concurrent.CopyOnWriteArrayList;
|
||||||
+2
-2
@@ -1,9 +1,9 @@
|
|||||||
package net.gravitydevelopment.anticheat.manage;
|
package com.rammelkast.anticheatreloaded.manage;
|
||||||
|
|
||||||
import com.comphenix.protocol.Packets;
|
import com.comphenix.protocol.Packets;
|
||||||
import com.comphenix.protocol.ProtocolManager;
|
import com.comphenix.protocol.ProtocolManager;
|
||||||
import com.comphenix.protocol.events.*;
|
import com.comphenix.protocol.events.*;
|
||||||
import net.gravitydevelopment.anticheat.AntiCheat;
|
import com.rammelkast.anticheatreloaded.AntiCheat;
|
||||||
|
|
||||||
public class PacketManager {
|
public class PacketManager {
|
||||||
|
|
||||||
+9
-7
@@ -16,17 +16,18 @@
|
|||||||
* 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 net.gravitydevelopment.anticheat.manage;
|
package com.rammelkast.anticheatreloaded.manage;
|
||||||
|
|
||||||
import net.gravitydevelopment.anticheat.AntiCheat;
|
|
||||||
import net.gravitydevelopment.anticheat.check.CheckType;
|
|
||||||
import net.gravitydevelopment.anticheat.config.Configuration;
|
|
||||||
import net.gravitydevelopment.anticheat.util.Group;
|
|
||||||
import net.gravitydevelopment.anticheat.util.User;
|
|
||||||
import net.gravitydevelopment.anticheat.util.Utilities;
|
|
||||||
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.check.CheckType;
|
||||||
|
import com.rammelkast.anticheatreloaded.config.Configuration;
|
||||||
|
import com.rammelkast.anticheatreloaded.util.Group;
|
||||||
|
import com.rammelkast.anticheatreloaded.util.User;
|
||||||
|
import com.rammelkast.anticheatreloaded.util.Utilities;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
@@ -228,6 +229,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();
|
||||||
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);
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package net.gravitydevelopment.anticheat.metrics;
|
package com.rammelkast.anticheatreloaded.metrics;
|
||||||
|
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.DataOutputStream;
|
import java.io.DataOutputStream;
|
||||||
+1
-1
@@ -16,7 +16,7 @@
|
|||||||
* 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 net.gravitydevelopment.anticheat.util;
|
package com.rammelkast.anticheatreloaded.util;
|
||||||
|
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
|
|
||||||
+1
-1
@@ -16,7 +16,7 @@
|
|||||||
* 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 net.gravitydevelopment.anticheat.util;
|
package com.rammelkast.anticheatreloaded.util;
|
||||||
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
|
|
||||||
+1
-1
@@ -16,7 +16,7 @@
|
|||||||
* 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 net.gravitydevelopment.anticheat.util;
|
package com.rammelkast.anticheatreloaded.util;
|
||||||
|
|
||||||
import java.text.DateFormat;
|
import java.text.DateFormat;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
+3
-2
@@ -16,11 +16,12 @@
|
|||||||
* 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 net.gravitydevelopment.anticheat.util;
|
package com.rammelkast.anticheatreloaded.util;
|
||||||
|
|
||||||
import net.gravitydevelopment.anticheat.AntiCheat;
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
|
|
||||||
|
import com.rammelkast.anticheatreloaded.AntiCheat;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package net.gravitydevelopment.anticheat.util;
|
package com.rammelkast.anticheatreloaded.util;
|
||||||
|
|
||||||
import java.util.EnumSet;
|
import java.util.EnumSet;
|
||||||
|
|
||||||
+3
-3
@@ -1,4 +1,4 @@
|
|||||||
package net.gravitydevelopment.anticheat.util;
|
package com.rammelkast.anticheatreloaded.util;
|
||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
@@ -15,8 +15,8 @@ import org.bukkit.scheduler.BukkitRunnable;
|
|||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
import com.mojang.authlib.GameProfile;
|
import com.mojang.authlib.GameProfile;
|
||||||
|
import com.rammelkast.anticheatreloaded.AntiCheat;
|
||||||
|
|
||||||
import net.gravitydevelopment.anticheat.AntiCheat;
|
|
||||||
import net.minecraft.server.v1_11_R1.EntityHuman;
|
import net.minecraft.server.v1_11_R1.EntityHuman;
|
||||||
import net.minecraft.server.v1_11_R1.EntityPlayer;
|
import net.minecraft.server.v1_11_R1.EntityPlayer;
|
||||||
import net.minecraft.server.v1_11_R1.MinecraftServer;
|
import net.minecraft.server.v1_11_R1.MinecraftServer;
|
||||||
@@ -167,7 +167,7 @@ public class NPC_1_11 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void damage() {
|
public void damage() {
|
||||||
if (this.npc == null) {
|
if (this.npc == null || this.getOwner() == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (new Random().nextBoolean() && this.npc.isInvisible()) {
|
if (new Random().nextBoolean() && this.npc.isInvisible()) {
|
||||||
+11
-3
@@ -1,4 +1,4 @@
|
|||||||
package net.gravitydevelopment.anticheat.util;
|
package com.rammelkast.anticheatreloaded.util;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -12,7 +12,10 @@ public class NameGenerator {
|
|||||||
"NoHax",
|
"NoHax",
|
||||||
"Just",
|
"Just",
|
||||||
"That",
|
"That",
|
||||||
"New"
|
"New",
|
||||||
|
"Ultra",
|
||||||
|
"Killer",
|
||||||
|
"Swift"
|
||||||
});
|
});
|
||||||
|
|
||||||
private static final List<String> END = Arrays.asList(new String[]{
|
private static final List<String> END = Arrays.asList(new String[]{
|
||||||
@@ -21,7 +24,12 @@ public class NameGenerator {
|
|||||||
"JustYolo",
|
"JustYolo",
|
||||||
"Gaming",
|
"Gaming",
|
||||||
"Minecraft",
|
"Minecraft",
|
||||||
"Games"
|
"Games",
|
||||||
|
"Bawz",
|
||||||
|
"1",
|
||||||
|
"51",
|
||||||
|
"99",
|
||||||
|
"" + new Random().nextInt(100)
|
||||||
});
|
});
|
||||||
|
|
||||||
public static String generateName() {
|
public static String generateName() {
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package net.gravitydevelopment.anticheat.util;
|
package com.rammelkast.anticheatreloaded.util;
|
||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
+5
-4
@@ -16,17 +16,18 @@
|
|||||||
* 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 net.gravitydevelopment.anticheat.util;
|
package com.rammelkast.anticheatreloaded.util;
|
||||||
|
|
||||||
import net.gravitydevelopment.anticheat.AntiCheat;
|
|
||||||
import net.gravitydevelopment.anticheat.config.Configuration;
|
|
||||||
import net.gravitydevelopment.anticheat.config.providers.Magic;
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
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 org.bukkit.entity.Player;
|
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.io.*;
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.net.HttpURLConnection;
|
import java.net.HttpURLConnection;
|
||||||
+1
-1
@@ -16,7 +16,7 @@
|
|||||||
* 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 net.gravitydevelopment.anticheat.util;
|
package com.rammelkast.anticheatreloaded.util;
|
||||||
|
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
|
|
||||||
+1
-1
@@ -16,7 +16,7 @@
|
|||||||
* 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 net.gravitydevelopment.anticheat.util;
|
package com.rammelkast.anticheatreloaded.util;
|
||||||
|
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
|
|
||||||
+6
-5
@@ -16,18 +16,19 @@
|
|||||||
* 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 net.gravitydevelopment.anticheat.util;
|
package com.rammelkast.anticheatreloaded.util;
|
||||||
|
|
||||||
import net.gravitydevelopment.anticheat.AntiCheat;
|
|
||||||
import net.gravitydevelopment.anticheat.check.CheckType;
|
|
||||||
import net.gravitydevelopment.anticheat.config.Configuration;
|
|
||||||
import net.gravitydevelopment.anticheat.util.rule.Rule;
|
|
||||||
import org.bukkit.Bukkit;
|
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.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.check.CheckType;
|
||||||
|
import com.rammelkast.anticheatreloaded.config.Configuration;
|
||||||
|
import com.rammelkast.anticheatreloaded.util.rule.Rule;
|
||||||
|
|
||||||
import java.sql.Timestamp;
|
import java.sql.Timestamp;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
+3
-2
@@ -16,9 +16,8 @@
|
|||||||
* 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 net.gravitydevelopment.anticheat.util;
|
package com.rammelkast.anticheatreloaded.util;
|
||||||
|
|
||||||
import net.gravitydevelopment.anticheat.AntiCheat;
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
@@ -29,6 +28,8 @@ 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 java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package net.gravitydevelopment.anticheat.util;
|
package com.rammelkast.anticheatreloaded.util;
|
||||||
|
|
||||||
import java.util.EnumSet;
|
import java.util.EnumSet;
|
||||||
|
|
||||||
+6
-5
@@ -16,15 +16,16 @@
|
|||||||
* 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 net.gravitydevelopment.anticheat.util.enterprise;
|
package com.rammelkast.anticheatreloaded.util.enterprise;
|
||||||
|
|
||||||
import net.gravitydevelopment.anticheat.AntiCheat;
|
|
||||||
import net.gravitydevelopment.anticheat.check.CheckType;
|
|
||||||
import net.gravitydevelopment.anticheat.util.User;
|
|
||||||
import net.gravitydevelopment.anticheat.util.Utilities;
|
|
||||||
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.check.CheckType;
|
||||||
|
import com.rammelkast.anticheatreloaded.util.User;
|
||||||
|
import com.rammelkast.anticheatreloaded.util.Utilities;
|
||||||
|
|
||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
import java.sql.DriverManager;
|
import java.sql.DriverManager;
|
||||||
import java.sql.PreparedStatement;
|
import java.sql.PreparedStatement;
|
||||||
+6
-5
@@ -16,14 +16,15 @@
|
|||||||
* 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 net.gravitydevelopment.anticheat.util.rule;
|
package com.rammelkast.anticheatreloaded.util.rule;
|
||||||
|
|
||||||
import net.gravitydevelopment.anticheat.check.CheckType;
|
|
||||||
import net.gravitydevelopment.anticheat.util.User;
|
|
||||||
|
|
||||||
import javax.script.ScriptEngine;
|
import javax.script.ScriptEngine;
|
||||||
import javax.script.ScriptEngineManager;
|
import javax.script.ScriptEngineManager;
|
||||||
import javax.script.ScriptException;
|
import javax.script.ScriptException;
|
||||||
|
|
||||||
|
import com.rammelkast.anticheatreloaded.check.CheckType;
|
||||||
|
import com.rammelkast.anticheatreloaded.util.User;
|
||||||
|
|
||||||
import java.util.SortedMap;
|
import java.util.SortedMap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -42,7 +43,7 @@ import java.util.SortedMap;
|
|||||||
* Check_SPIDER > 0 ? Player.KICK : null<br />
|
* Check_SPIDER > 0 ? Player.KICK : null<br />
|
||||||
* <i>The above statement would read 'If the spider check has been failed over zero times, kick the player. Otherwise, do nothing.'</i>
|
* <i>The above statement would read 'If the spider check has been failed over zero times, kick the player. Otherwise, do nothing.'</i>
|
||||||
* <p/>
|
* <p/>
|
||||||
* To see syntax for variables and functions that you may use, see {@link net.gravitydevelopment.anticheat.util.rule.Rule}
|
* To see syntax for variables and functions that you may use, see {@link com.rammelkast.anticheatreloaded.util.rule.Rule}
|
||||||
*/
|
*/
|
||||||
public class ConditionalRule extends Rule {
|
public class ConditionalRule extends Rule {
|
||||||
|
|
||||||
+10
-9
@@ -16,15 +16,16 @@
|
|||||||
* 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 net.gravitydevelopment.anticheat.util.rule;
|
package com.rammelkast.anticheatreloaded.util.rule;
|
||||||
|
|
||||||
import net.gravitydevelopment.anticheat.AntiCheat;
|
|
||||||
import net.gravitydevelopment.anticheat.check.CheckType;
|
|
||||||
import net.gravitydevelopment.anticheat.util.User;
|
|
||||||
import net.gravitydevelopment.anticheat.util.Group;
|
|
||||||
import net.gravitydevelopment.anticheat.util.Utilities;
|
|
||||||
import org.bukkit.GameMode;
|
import org.bukkit.GameMode;
|
||||||
|
|
||||||
|
import com.rammelkast.anticheatreloaded.AntiCheat;
|
||||||
|
import com.rammelkast.anticheatreloaded.check.CheckType;
|
||||||
|
import com.rammelkast.anticheatreloaded.util.Group;
|
||||||
|
import com.rammelkast.anticheatreloaded.util.User;
|
||||||
|
import com.rammelkast.anticheatreloaded.util.Utilities;
|
||||||
|
|
||||||
import java.lang.reflect.Constructor;
|
import java.lang.reflect.Constructor;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -44,7 +45,7 @@ import java.util.TreeMap;
|
|||||||
* <ul>
|
* <ul>
|
||||||
* <li>Check
|
* <li>Check
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>Contains all valid checks as listed in {@link net.gravitydevelopment.anticheat.check.CheckType}</li>
|
* <li>Contains all valid checks as listed in {@link com.rammelkast.anticheatreloaded.check.CheckType}</li>
|
||||||
* <li>Will return the number of times this user has failed the given check</li>
|
* <li>Will return the number of times this user has failed the given check</li>
|
||||||
* <li><b>Example:</b> Check_SPRINT</li>
|
* <li><b>Example:</b> Check_SPRINT</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
@@ -76,7 +77,7 @@ import java.util.TreeMap;
|
|||||||
* <p/>
|
* <p/>
|
||||||
* The Rule class itself is not an functional rule setup,
|
* The Rule class itself is not an functional rule setup,
|
||||||
* it is inherited and made functional by different implementations of the rule parser.<br />
|
* it is inherited and made functional by different implementations of the rule parser.<br />
|
||||||
* The only current Rule implementation is the {@link net.gravitydevelopment.anticheat.util.rule.ConditionalRule}
|
* The only current Rule implementation is the {@link com.rammelkast.anticheatreloaded.util.rule.ConditionalRule}
|
||||||
*/
|
*/
|
||||||
public class Rule {
|
public class Rule {
|
||||||
|
|
||||||
@@ -145,7 +146,7 @@ public class Rule {
|
|||||||
/**
|
/**
|
||||||
* Get the type of rule this is
|
* Get the type of rule this is
|
||||||
*
|
*
|
||||||
* @return a {@link net.gravitydevelopment.anticheat.util.rule.Rule.Type}
|
* @return a {@link com.rammelkast.anticheatreloaded.util.rule.Rule.Type}
|
||||||
*/
|
*/
|
||||||
public Type getType() {
|
public Type getType() {
|
||||||
return type;
|
return type;
|
||||||
@@ -1,222 +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 net.gravitydevelopment.anticheat;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.event.Listener;
|
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
|
||||||
|
|
||||||
import com.comphenix.protocol.ProtocolLibrary;
|
|
||||||
import com.comphenix.protocol.ProtocolManager;
|
|
||||||
|
|
||||||
import net.gravitydevelopment.anticheat.check.combat.KillAuraCheck;
|
|
||||||
import net.gravitydevelopment.anticheat.check.movement.BlinkCheck;
|
|
||||||
import net.gravitydevelopment.anticheat.command.CommandHandler;
|
|
||||||
import net.gravitydevelopment.anticheat.config.Configuration;
|
|
||||||
import net.gravitydevelopment.anticheat.event.BlockListener;
|
|
||||||
import net.gravitydevelopment.anticheat.event.EntityListener;
|
|
||||||
import net.gravitydevelopment.anticheat.event.InventoryListener;
|
|
||||||
import net.gravitydevelopment.anticheat.event.PlayerListener;
|
|
||||||
import net.gravitydevelopment.anticheat.event.VehicleListener;
|
|
||||||
import net.gravitydevelopment.anticheat.manage.AntiCheatManager;
|
|
||||||
import net.gravitydevelopment.anticheat.metrics.Metrics;
|
|
||||||
import net.gravitydevelopment.anticheat.util.User;
|
|
||||||
import net.gravitydevelopment.anticheat.util.VersionUtil;
|
|
||||||
|
|
||||||
public class AntiCheat extends JavaPlugin {
|
|
||||||
|
|
||||||
private static AntiCheatManager manager;
|
|
||||||
private static AntiCheat plugin;
|
|
||||||
private static List<Listener> eventList = new ArrayList<Listener>();
|
|
||||||
private static Configuration config;
|
|
||||||
private static boolean verbose;
|
|
||||||
private static boolean developer;
|
|
||||||
private static ProtocolManager protocolManager;
|
|
||||||
private static boolean protocolLib = false;
|
|
||||||
private static Long loadTime;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onEnable() {
|
|
||||||
plugin = this;
|
|
||||||
loadTime = System.currentTimeMillis();
|
|
||||||
manager = new AntiCheatManager(this, getLogger());
|
|
||||||
eventList.add(new PlayerListener());
|
|
||||||
eventList.add(new BlockListener());
|
|
||||||
eventList.add(new EntityListener());
|
|
||||||
eventList.add(new VehicleListener());
|
|
||||||
eventList.add(new InventoryListener());
|
|
||||||
// Order is important in some cases, don't screw with these unless needed, especially config
|
|
||||||
setupConfig();
|
|
||||||
setupEvents();
|
|
||||||
setupCommands();
|
|
||||||
setupProtocol();
|
|
||||||
// Enterprise must come before levels
|
|
||||||
setupEnterprise();
|
|
||||||
restoreLevels();
|
|
||||||
// Check if NoCheatPlus is installed
|
|
||||||
Bukkit.getScheduler().runTaskLater(this, new Runnable() {
|
|
||||||
public void run() {
|
|
||||||
if (Bukkit.getPluginManager().getPlugin("NoCheatPlus") != null) {
|
|
||||||
getLogger().severe("You are also running NoCheatPlus!");
|
|
||||||
getLogger().severe("Multiple anticheats create false cheat detections.");
|
|
||||||
getLogger().severe("Please remove or disable NoCheatPlus to silence this warning.");
|
|
||||||
}else if (Bukkit.getPluginManager().getPlugin("AAC") != null) {
|
|
||||||
getLogger().severe("You are also running AAC!");
|
|
||||||
getLogger().severe("Multiple anticheats create false cheat detections.");
|
|
||||||
getLogger().severe("Please remove or disable AAC to silence this warning.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}, 40L);
|
|
||||||
// End tests
|
|
||||||
verboseLog("Finished loading.");
|
|
||||||
getLogger().info("Running version " + VersionUtil.getVersion() + "...");
|
|
||||||
|
|
||||||
// Enable packetlisteners
|
|
||||||
KillAuraCheck.listenPackets();
|
|
||||||
BlinkCheck.startTimer();
|
|
||||||
BlinkCheck.listenPackets();
|
|
||||||
|
|
||||||
// Metrics
|
|
||||||
try {
|
|
||||||
new Metrics(this);
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onDisable() {
|
|
||||||
verboseLog("Saving user levels...");
|
|
||||||
config.getLevels().saveLevelsFromUsers(getManager().getUserManager().getUsers());
|
|
||||||
|
|
||||||
AntiCheatManager.close();
|
|
||||||
getServer().getScheduler().cancelTasks(this);
|
|
||||||
cleanup();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setupProtocol() {
|
|
||||||
if (Bukkit.getPluginManager().getPlugin("ProtocolLib") != null) {
|
|
||||||
protocolLib = true;
|
|
||||||
protocolManager = ProtocolLibrary.getProtocolManager();
|
|
||||||
verboseLog("Hooked into ProtocolLib");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setupEvents() {
|
|
||||||
for (Listener listener : eventList) {
|
|
||||||
getServer().getPluginManager().registerEvents(listener, this);
|
|
||||||
verboseLog("Registered events for ".concat(listener.toString().split("@")[0].split(".anticheat.")[1]));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setupCommands() {
|
|
||||||
getCommand("anticheat").setExecutor(new CommandHandler());
|
|
||||||
verboseLog("Registered commands.");
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setupConfig() {
|
|
||||||
config = manager.getConfiguration();
|
|
||||||
verboseLog("Setup the config.");
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setupEnterprise() {
|
|
||||||
if (config.getConfig().enterprise.getValue()) {
|
|
||||||
if (config.getEnterprise().loggingEnabled.getValue()) {
|
|
||||||
config.getEnterprise().database.cleanEvents();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void restoreLevels() {
|
|
||||||
for (Player player : getServer().getOnlinePlayers()) {
|
|
||||||
UUID uuid = player.getUniqueId();
|
|
||||||
|
|
||||||
User user = new User(uuid);
|
|
||||||
user.setIsWaitingOnLevelSync(true);
|
|
||||||
config.getLevels().loadLevelToUser(user);
|
|
||||||
|
|
||||||
manager.getUserManager().addUser(user);
|
|
||||||
verboseLog("Data for " + uuid + " loaded");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static AntiCheat getPlugin() {
|
|
||||||
return plugin;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static AntiCheatManager getManager() {
|
|
||||||
return manager;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String getVersion() {
|
|
||||||
return manager.getPlugin().getDescription().getVersion();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void cleanup() {
|
|
||||||
eventList = null;
|
|
||||||
manager = null;
|
|
||||||
config = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean developerMode() {
|
|
||||||
return developer;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void setDeveloperMode(boolean b) {
|
|
||||||
developer = b;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean isUsingProtocolLib() {
|
|
||||||
return protocolLib;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void debugLog(final String string) {
|
|
||||||
Bukkit.getScheduler().runTask(getPlugin(), new Runnable() {
|
|
||||||
public void run() {
|
|
||||||
if (developer) {
|
|
||||||
manager.debugLog("[DEBUG] " + string);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public void verboseLog(final String string) {
|
|
||||||
if (verbose) {
|
|
||||||
getLogger().info(string);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setVerbose(boolean b) {
|
|
||||||
verbose = b;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getLoadTime() {
|
|
||||||
return loadTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static ProtocolManager getProtocolManager() {
|
|
||||||
return protocolManager;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,138 +0,0 @@
|
|||||||
package net.gravitydevelopment.anticheat.check.movement;
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
import org.bukkit.ChatColor;
|
|
||||||
import org.bukkit.Location;
|
|
||||||
import org.bukkit.Material;
|
|
||||||
import org.bukkit.block.BlockFace;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
|
|
||||||
import net.gravitydevelopment.anticheat.AntiCheat;
|
|
||||||
import net.gravitydevelopment.anticheat.check.CheckResult;
|
|
||||||
import net.gravitydevelopment.anticheat.util.Distance;
|
|
||||||
import net.gravitydevelopment.anticheat.util.Utilities;
|
|
||||||
import net.gravitydevelopment.anticheat.util.VersionUtil;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This is broken as f*ck
|
|
||||||
*/
|
|
||||||
public class GlideCheck {
|
|
||||||
|
|
||||||
private static final CheckResult PASS = new CheckResult(CheckResult.Result.PASSED);
|
|
||||||
|
|
||||||
public static Map<UUID, Double> lastToFall = new HashMap<UUID, Double>();
|
|
||||||
public static Map<UUID, Integer> glideBuffer = new HashMap<UUID, Integer>();
|
|
||||||
|
|
||||||
/*
|
|
||||||
* SOME OLD CODE
|
|
||||||
*
|
|
||||||
* UUID uuid = player.getUniqueId();
|
|
||||||
if(!lastYDelta.containsKey(uuid))
|
|
||||||
lastYDelta.put(uuid, 0.0);
|
|
||||||
if(!YAxisCheck.lastYcoord.containsKey(uuid))
|
|
||||||
YAxisCheck.lastYcoord.put(uuid, player.getLocation().getY());
|
|
||||||
double currentY = player.getLocation().getY();
|
|
||||||
double math = currentY - YAxisCheck.lastYcoord.get(uuid);
|
|
||||||
if((math < 0 && math > AntiCheat.getManager().getBackend().getMagic().GLIDE_MAX()) && !AntiCheat.getManager().getBackend().isMovingExempt(player))
|
|
||||||
{
|
|
||||||
if(math <= lastYDelta.get(uuid) && !(player.getEyeLocation().getBlock().getType() == Material.LADDER)
|
|
||||||
&& !Utilities.isInWater(player) && !Utilities.isInWeb(player)
|
|
||||||
&& Utilities.cantStandAt(player.getLocation().getBlock()) && !Utilities.cantStandAtSingle(player.getLocation().getBlock()) && !!Utilities.cantStandAtSingle(player.getLocation().getBlock().getRelative(BlockFace.DOWN)))
|
|
||||||
{
|
|
||||||
if(!glideBuffer.containsKey(uuid))
|
|
||||||
glideBuffer.put(uuid, 0);
|
|
||||||
int currentBuffer = glideBuffer.get(uuid);
|
|
||||||
glideBuffer.put(uuid, currentBuffer + 1);
|
|
||||||
if(currentBuffer >= AntiCheat.getManager().getBackend().getMagic().GLIDE_LIMIT())
|
|
||||||
{
|
|
||||||
double fallDist = distanceToFall(player.getLocation());
|
|
||||||
player.teleport(player.getLocation().add(0, -fallDist, 0));
|
|
||||||
player.setFallDistance((float) fallDist);
|
|
||||||
if(!AntiCheat.getManager().getBackend().silentMode())
|
|
||||||
{
|
|
||||||
player.sendMessage(ChatColor.RED + "[AntiCheat] Glide/Fly hacking detected.");
|
|
||||||
}
|
|
||||||
lastYDelta.put(uuid, math);
|
|
||||||
return new CheckResult(CheckResult.Result.FAILED, uuid + " attempted to fall too slowly!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}else {
|
|
||||||
glideBuffer.remove(uuid);
|
|
||||||
}
|
|
||||||
lastYDelta.put(uuid, math);*/
|
|
||||||
|
|
||||||
public static CheckResult runCheck(Player player, Distance distance) {
|
|
||||||
/* UUID uuid = player.getUniqueId();
|
|
||||||
if (AntiCheat.getManager().getBackend().isMovingExempt(player) || VersionUtil.isFlying(player)) {
|
|
||||||
return PASS;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!YAxisCheck.lastYcoord.containsKey(uuid)) {
|
|
||||||
YAxisCheck.lastYcoord.put(uuid, player.getLocation().getY());
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!YAxisCheck.lastYtime.containsKey(uuid)) {
|
|
||||||
YAxisCheck.lastYtime.put(uuid, System.currentTimeMillis());
|
|
||||||
}
|
|
||||||
|
|
||||||
double currentY = player.getLocation().getY();
|
|
||||||
double diff = currentY - YAxisCheck.lastYcoord.get(uuid);
|
|
||||||
double glideMax = AntiCheat.getManager().getBackend().getMagic().GLIDE_MAX();
|
|
||||||
long timeDiff = System.currentTimeMillis() - YAxisCheck.lastYtime.get(uuid);
|
|
||||||
|
|
||||||
if (diff <= glideMax || diff >= 0) {
|
|
||||||
return PASS;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!(!(player.getEyeLocation().getBlock().getType() == Material.LADDER)
|
|
||||||
|| !Utilities.isInWater(player) || !Utilities.isInWeb(player)
|
|
||||||
|| Utilities.cantStandAt(player.getLocation().getBlock()) || !Utilities.cantStandAtSingle(player.getLocation().getBlock()) || !Utilities.cantStandAtSingle(player.getLocation().getBlock().getRelative(BlockFace.DOWN)))) {
|
|
||||||
return PASS;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (timeDiff <= 150/) {
|
|
||||||
return PASS;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!lastToFall.containsKey(uuid)) {
|
|
||||||
lastToFall.put(uuid, distanceToFall(player.getLocation()));
|
|
||||||
} else {
|
|
||||||
double lastFall = lastToFall.get(uuid);
|
|
||||||
if (distanceToFall(player.getLocation()) + diff >= lastFall - 0.10125) {
|
|
||||||
if (!glideBuffer.containsKey(uuid)) {
|
|
||||||
glideBuffer.put(uuid, 1);
|
|
||||||
} else {
|
|
||||||
int buffer = glideBuffer.get(uuid);
|
|
||||||
if (buffer >= AntiCheat.getManager().getBackend().getMagic().GLIDE_LIMIT()) {
|
|
||||||
glideBuffer.remove(uuid);
|
|
||||||
if(!AntiCheat.getManager().getBackend().silentMode())
|
|
||||||
{
|
|
||||||
double fallDist = distanceToFall(player.getLocation());
|
|
||||||
player.teleport(player.getLocation().add(0, -fallDist, 0));
|
|
||||||
player.setFallDistance((float) fallDist);
|
|
||||||
}
|
|
||||||
return new CheckResult(CheckResult.Result.FAILED, uuid + " attempted to glide!");
|
|
||||||
} else {
|
|
||||||
glideBuffer.put(uuid, buffer + 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
System.out.println(diff + ":" + timeDiff + ":" + distanceToFall(player.getLocation()));
|
|
||||||
*/
|
|
||||||
return PASS;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static double distanceToFall(Location location) {
|
|
||||||
location = location.clone();
|
|
||||||
double firstY = location.getY();
|
|
||||||
while (location.clone().add(0, -0.1, 0).getBlock().getType() == Material.AIR)
|
|
||||||
location.add(0, -0.1, 0);
|
|
||||||
return firstY - location.getY();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -83,7 +83,6 @@ Y_MAXVIOTIME: 5500
|
|||||||
Y_SPEED_MAX: 0.5125
|
Y_SPEED_MAX: 0.5125
|
||||||
Y_TIME: 800
|
Y_TIME: 800
|
||||||
GLIDE_LIMIT: 10
|
GLIDE_LIMIT: 10
|
||||||
GLIDE_MAX: -3.89425
|
|
||||||
KILLAURA_BOTHITS: 4
|
KILLAURA_BOTHITS: 4
|
||||||
BLINK_PACKET: 74
|
BLINK_PACKET: 74
|
||||||
VELOCITY_AMT: 5
|
VELOCITY_AMT: 5
|
||||||
@@ -1,10 +1,9 @@
|
|||||||
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: net.gravitydevelopment.anticheat.AntiCheat
|
main: com.rammelkast.anticheatreloaded.AntiCheat
|
||||||
softdepend: [ProtocolLib]
|
softdepend: [ProtocolLib]
|
||||||
startup: postworld
|
startup: postworld
|
||||||
url: http://gravitydevelopment.net
|
|
||||||
version: ${project.build.version}
|
version: ${project.build.version}
|
||||||
commands:
|
commands:
|
||||||
anticheat:
|
anticheat:
|
||||||
|
|||||||
Reference in new issue
Block a user