From 15db978831df5f9dc6ebe2e7d531a6a76fba7900 Mon Sep 17 00:00:00 2001 From: HaHaWTH Date: Sun, 10 Mar 2024 11:26:27 +0800 Subject: [PATCH] Add counter --- src/main/java/io/wdsj/asw/listener/PlayerHeldItemListener.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/io/wdsj/asw/listener/PlayerHeldItemListener.java b/src/main/java/io/wdsj/asw/listener/PlayerHeldItemListener.java index 758c736..def2cf3 100644 --- a/src/main/java/io/wdsj/asw/listener/PlayerHeldItemListener.java +++ b/src/main/java/io/wdsj/asw/listener/PlayerHeldItemListener.java @@ -20,6 +20,7 @@ import static io.wdsj.asw.AdvancedSensitiveWords.*; import static io.wdsj.asw.util.Utils.getIgnoreFormatCodeRegex; +import static io.wdsj.asw.util.Utils.messagesFilteredNum; public class PlayerHeldItemListener implements Listener { @@ -37,6 +38,7 @@ public void onPlayerHeldItem(PlayerItemHeldEvent event) { long startTime = System.currentTimeMillis(); List censoredWordList = sensitiveWordBs.findAll(originalName); if (!censoredWordList.isEmpty()) { + messagesFilteredNum.getAndIncrement(); String processedName = sensitiveWordBs.replace(originalName); if (settingsManager.getProperty(PluginSettings.ITEM_METHOD).equalsIgnoreCase("cancel")) { event.setCancelled(true);