Skip to content

Commit

Permalink
Move method to Utils
Browse files Browse the repository at this point in the history
  • Loading branch information
HaHaWTH committed Mar 10, 2024
1 parent b5cf9a6 commit ba3315c
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/main/java/io/wdsj/asw/AdvancedSensitiveWords.java
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,6 @@ public void doInitTasks() {
isInitialized = true;
});
}
public static String getIgnoreFormatCodeRegex() {
return "[§" + settingsManager.getProperty(PluginSettings.ALT_COLOR_CODE) + "][0-9A-Fa-fK-Ok-oRr]";
}

@Override
public void onDisable() {
Expand Down
1 change: 1 addition & 0 deletions src/main/java/io/wdsj/asw/listener/AnvilListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

import static io.wdsj.asw.AdvancedSensitiveWords.*;
import static io.wdsj.asw.util.TimingUtils.addProcessStatistic;
import static io.wdsj.asw.util.Utils.getIgnoreFormatCodeRegex;
import static io.wdsj.asw.util.Utils.messagesFilteredNum;

public class AnvilListener implements Listener {
Expand Down
1 change: 1 addition & 0 deletions src/main/java/io/wdsj/asw/listener/BookListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

import static io.wdsj.asw.AdvancedSensitiveWords.*;
import static io.wdsj.asw.util.TimingUtils.addProcessStatistic;
import static io.wdsj.asw.util.Utils.getIgnoreFormatCodeRegex;
import static io.wdsj.asw.util.Utils.messagesFilteredNum;

public class BookListener implements Listener {
Expand Down
1 change: 1 addition & 0 deletions src/main/java/io/wdsj/asw/listener/BroadCastListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

import static io.wdsj.asw.AdvancedSensitiveWords.*;
import static io.wdsj.asw.util.TimingUtils.addProcessStatistic;
import static io.wdsj.asw.util.Utils.getIgnoreFormatCodeRegex;
import static io.wdsj.asw.util.Utils.messagesFilteredNum;

public class BroadCastListener implements Listener {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import java.util.List;

import static io.wdsj.asw.AdvancedSensitiveWords.*;
import static io.wdsj.asw.util.Utils.getIgnoreFormatCodeRegex;

public class PlayerHeldItemListener implements Listener {

Expand Down
1 change: 1 addition & 0 deletions src/main/java/io/wdsj/asw/listener/SignListener.java
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.TimingUtils.addProcessStatistic;
import static io.wdsj.asw.util.Utils.getIgnoreFormatCodeRegex;
import static io.wdsj.asw.util.Utils.messagesFilteredNum;

public class SignListener implements Listener {
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/io/wdsj/asw/util/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ public static String getSplitCommandArgs(String command) {
if (splitCommand.length <= 1) return "";
return String.join(" ", Arrays.copyOfRange(splitCommand, 1, splitCommand.length));
}
public static String getIgnoreFormatCodeRegex() {
return "[§" + settingsManager.getProperty(PluginSettings.ALT_COLOR_CODE) + "][0-9A-Fa-fK-Ok-oRr]";
}


public static boolean isCommandAndWhiteListed(String command) {
if (!command.startsWith("/")) return false;
Expand Down

0 comments on commit ba3315c

Please sign in to comment.