From 23be0436a5a3ac25a7173983ec387326fc32889b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=82=E3=81=90=E3=82=82=E3=81=90=E3=81=B7=E3=82=8A?= =?UTF-8?q?=E3=82=93?= Date: Fri, 13 Sep 2024 01:40:13 +0900 Subject: [PATCH] small change --- src/main/java/com/mogukun/sentry/Sentry.java | 1 + src/main/java/com/mogukun/sentry/check/CheckManager.java | 6 ++++-- .../check/checks/combats/autoclicker/AutoClickerA.java | 3 ++- .../check/checks/combats/autoclicker/AutoClickerB.java | 3 ++- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/mogukun/sentry/Sentry.java b/src/main/java/com/mogukun/sentry/Sentry.java index de38bf1..cf59db3 100644 --- a/src/main/java/com/mogukun/sentry/Sentry.java +++ b/src/main/java/com/mogukun/sentry/Sentry.java @@ -48,6 +48,7 @@ public void onEnable() { getServer().getPluginManager().registerEvents( new PlayerListener(), this ); getCommand("sentry").setExecutor( new SentryCommand() ); for ( Player p : Bukkit.getOnlinePlayers() ) Sentry.instance.checkManager.checkMap.remove(p.getUniqueId()); + System.out.println("[Sentry] Loaded Sentry AntiCheat in " + ( System.currentTimeMillis() - startLoading ) + "ms."); } } diff --git a/src/main/java/com/mogukun/sentry/check/CheckManager.java b/src/main/java/com/mogukun/sentry/check/CheckManager.java index dbf1a09..024e19c 100644 --- a/src/main/java/com/mogukun/sentry/check/CheckManager.java +++ b/src/main/java/com/mogukun/sentry/check/CheckManager.java @@ -162,8 +162,10 @@ public void runCheck(Player player, Packet packet) { for ( Check check : init(player) ) { - check.handle(packet); - if ( data != null ) check.handle(data); + try { + check.handle(packet); + if ( data != null ) check.handle(data); + } catch (Exception ignore) {} } }).start(); } diff --git a/src/main/java/com/mogukun/sentry/check/checks/combats/autoclicker/AutoClickerA.java b/src/main/java/com/mogukun/sentry/check/checks/combats/autoclicker/AutoClickerA.java index 7559beb..ed0b2b3 100644 --- a/src/main/java/com/mogukun/sentry/check/checks/combats/autoclicker/AutoClickerA.java +++ b/src/main/java/com/mogukun/sentry/check/checks/combats/autoclicker/AutoClickerA.java @@ -9,6 +9,7 @@ import org.bukkit.event.entity.EntityDamageByEntityEvent; import java.util.ArrayList; +import java.util.concurrent.ConcurrentLinkedDeque; @CheckInfo( name = "AutoClicker (A)", @@ -19,7 +20,7 @@ public class AutoClickerA extends Check { - ArrayList samples = new ArrayList<>(); + ConcurrentLinkedDeque samples = new ConcurrentLinkedDeque<>(); boolean isBreaking = false; long lastArm = 0; int buffer = 0; diff --git a/src/main/java/com/mogukun/sentry/check/checks/combats/autoclicker/AutoClickerB.java b/src/main/java/com/mogukun/sentry/check/checks/combats/autoclicker/AutoClickerB.java index 2d150a2..28adafb 100644 --- a/src/main/java/com/mogukun/sentry/check/checks/combats/autoclicker/AutoClickerB.java +++ b/src/main/java/com/mogukun/sentry/check/checks/combats/autoclicker/AutoClickerB.java @@ -13,6 +13,7 @@ import org.bukkit.event.entity.EntityDamageByEntityEvent; import java.util.ArrayList; +import java.util.concurrent.ConcurrentLinkedDeque; @CheckInfo( name = "AutoClicker (B)", @@ -27,7 +28,7 @@ public class AutoClickerB extends Check { long lastArm = 0; long lastPlace = 0; - ArrayList samples = new ArrayList<>(); + ConcurrentLinkedDeque samples = new ConcurrentLinkedDeque<>(); int buffer = 0;