Skip to content

Commit

Permalink
Add counter
Browse files Browse the repository at this point in the history
  • Loading branch information
HaHaWTH committed Mar 10, 2024
1 parent ba3315c commit 15db978
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand All @@ -37,6 +38,7 @@ public void onPlayerHeldItem(PlayerItemHeldEvent event) {
long startTime = System.currentTimeMillis();
List<String> 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);
Expand Down

0 comments on commit 15db978

Please sign in to comment.