diff --git a/Plugins/Mineplex.Core/src/mineplex/core/antihack/AntiHack.java b/Plugins/Mineplex.Core/src/mineplex/core/antihack/AntiHack.java index a3afe9508..d5351e02f 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/antihack/AntiHack.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/antihack/AntiHack.java @@ -61,7 +61,7 @@ import java.util.function.Predicate; @ReflectivelyCreateMiniPlugin public class AntiHack extends MiniPlugin { - private static final Map _checks = ImmutableMap.of( + public static final Map CHECKS = ImmutableMap.of( "Killaura (Type A)", new CheckThresholds("Kill Aura", 25, 50), "Killaura (Type B)", new CheckThresholds("High CPS", 0, Integer.MAX_VALUE), "Killaura (Type C)", new CheckThresholds("Reach", Integer.MAX_VALUE, Integer.MAX_VALUE), @@ -373,7 +373,7 @@ public class AntiHack extends MiniPlugin .setColor(EnumChatFormat.YELLOW) ) ) - .addSibling(_checks.get(violation.getHackType()).format(violation.getViolations())); + .addSibling(CHECKS.get(violation.getHackType()).format(violation.getViolations())); if (!violation.getOriginatingServer().equals(this._thisServer)) { @@ -552,19 +552,17 @@ public class AntiHack extends MiniPlugin { runSync(() -> { - int totalPunishments = getPunishments(player); - int daysBanned = getDaysBanned(player); CoreClient coreClient = _clientManager.Get(player); if (coreClient.GetRank().has(Rank.TWITCH)) { - require(Punish.class).AddPunishment(coreClient.getName(), Category.Hacking, message, AntiHack.NAME, totalPunishments + 1, true, daysBanned == -1 ? -1 : TimeUnit.DAYS.toHours(daysBanned), true); + require(Punish.class).AddPunishment(coreClient.getName(), Category.Hacking, message, AntiHack.NAME, 3, true, -1, true); } else { runBanAnimation(player, () -> { - require(Punish.class).AddPunishment(coreClient.getName(), Category.Hacking, message, AntiHack.NAME, totalPunishments + 1, true, daysBanned == -1 ? -1 : TimeUnit.DAYS.toHours(daysBanned), true); + require(Punish.class).AddPunishment(coreClient.getName(), Category.Hacking, message, AntiHack.NAME, 3, true, -1, true); announceBan(player); }); } @@ -974,7 +972,7 @@ public class AntiHack extends MiniPlugin { if (event.shouldTellStaff()) { - String key = event.getPlayer().getName() + "." + event.getHackType() + "." + _checks.get(event.getHackType()).getSeverity(event.getViolations()).toString(); + String key = event.getPlayer().getName() + "." + event.getHackType() + "." + CHECKS.get(event.getHackType()).getSeverity(event.getViolations()).toString(); Integer pastVl = this._cooldown.getIfPresent(key); if (pastVl != null) { diff --git a/Plugins/Mineplex.Core/src/mineplex/core/antihack/CheckThresholds.java b/Plugins/Mineplex.Core/src/mineplex/core/antihack/CheckThresholds.java index 4c6b34b94..b00207db6 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/antihack/CheckThresholds.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/antihack/CheckThresholds.java @@ -18,6 +18,11 @@ public class CheckThresholds _high = high; } + public String getFriendlyName() + { + return _friendlyName; + } + public IChatBaseComponent format(int violationLevel) { EnumChatFormat color = getSeverity(violationLevel)._color; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/antihack/actions/ImmediateBanAction.java b/Plugins/Mineplex.Core/src/mineplex/core/antihack/actions/ImmediateBanAction.java index 70f3a7609..668d82389 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/antihack/actions/ImmediateBanAction.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/antihack/actions/ImmediateBanAction.java @@ -3,10 +3,7 @@ package mineplex.core.antihack.actions; import com.mineplex.anticheat.api.PlayerViolationEvent; import mineplex.core.Managers; import mineplex.core.antihack.AntiHack; -import mineplex.core.punish.Category; -import mineplex.core.punish.Punish; - -import java.util.concurrent.TimeUnit; +import mineplex.core.common.util.UtilServer; class ImmediateBanAction extends AntiHackAction { @@ -20,7 +17,12 @@ class ImmediateBanAction extends AntiHackAction { if (event.getViolations() >= this.getMinVl()) { - Managers.get(AntiHack.class).doBan(event.getPlayer(), event.getMessage()); + String server = UtilServer.getServerName(); + if (server.contains("-")) + { + server = server.substring(0, server.indexOf('-')); + } + Managers.get(AntiHack.class).doBan(event.getPlayer(), "[GWEN] Hacking - " + AntiHack.CHECKS.get(event.getHackType()).getFriendlyName() + " [" + server + "]"); } } }