diff --git a/bukkit/pom.xml b/bukkit/pom.xml
index 13c43ef..7fab1e9 100644
--- a/bukkit/pom.xml
+++ b/bukkit/pom.xml
@@ -69,14 +69,6 @@
-
- org.hjug.refactorfirst.plugin
- refactor-first-maven-plugin
- 0.5.0
-
- false
-
-
org.jetbrains.kotlin
kotlin-maven-plugin
diff --git a/bukkit/src/main/java/io/wdsj/asw/bukkit/AdvancedSensitiveWords.java b/bukkit/src/main/java/io/wdsj/asw/bukkit/AdvancedSensitiveWords.java
index 6024452..2c79262 100644
--- a/bukkit/src/main/java/io/wdsj/asw/bukkit/AdvancedSensitiveWords.java
+++ b/bukkit/src/main/java/io/wdsj/asw/bukkit/AdvancedSensitiveWords.java
@@ -23,11 +23,11 @@
import io.wdsj.asw.bukkit.listener.*;
import io.wdsj.asw.bukkit.listener.packet.ASWBookPacketListener;
import io.wdsj.asw.bukkit.listener.packet.ASWChatPacketListener;
-import io.wdsj.asw.bukkit.manage.permission.cache.CachingPermTool;
import io.wdsj.asw.bukkit.manage.punish.PlayerAltController;
import io.wdsj.asw.bukkit.manage.punish.PlayerShadowController;
import io.wdsj.asw.bukkit.manage.punish.ViolationCounter;
import io.wdsj.asw.bukkit.method.*;
+import io.wdsj.asw.bukkit.permission.cache.CachingPermTool;
import io.wdsj.asw.bukkit.proxy.bungee.BungeeCordChannel;
import io.wdsj.asw.bukkit.proxy.bungee.BungeeReceiver;
import io.wdsj.asw.bukkit.proxy.velocity.VelocityChannel;
diff --git a/bukkit/src/main/java/io/wdsj/asw/bukkit/ai/AIProcessor.java b/bukkit/src/main/java/io/wdsj/asw/bukkit/ai/AIProcessor.java
index 78c30ce..5c0079d 100644
--- a/bukkit/src/main/java/io/wdsj/asw/bukkit/ai/AIProcessor.java
+++ b/bukkit/src/main/java/io/wdsj/asw/bukkit/ai/AIProcessor.java
@@ -10,6 +10,9 @@
* Interface for AI processors (Maybe more in the future?)
*/
public interface AIProcessor {
+ /**
+ * Shared thread pool for AI processors
+ */
ExecutorService THREAD_POOL = VirtualThreadUtils.newVirtualThreadPerTaskExecutorOrProvided(Executors.newCachedThreadPool(new ThreadFactoryBuilder().setNameFormat("ASW AIProcessor Thread-%d").setDaemon(true).build()));
default void shutdown() {
THREAD_POOL.shutdownNow();
diff --git a/bukkit/src/main/java/io/wdsj/asw/bukkit/ai/OllamaProcessor.java b/bukkit/src/main/java/io/wdsj/asw/bukkit/ai/OllamaProcessor.java
index bb4f7f2..268ba4f 100644
--- a/bukkit/src/main/java/io/wdsj/asw/bukkit/ai/OllamaProcessor.java
+++ b/bukkit/src/main/java/io/wdsj/asw/bukkit/ai/OllamaProcessor.java
@@ -5,12 +5,16 @@
import io.github.amithkoujalgi.ollama4j.core.utils.OptionsBuilder;
import io.github.amithkoujalgi.ollama4j.core.utils.PromptBuilder;
import io.wdsj.asw.bukkit.setting.PluginSettings;
+import org.jetbrains.annotations.NotNull;
import java.util.concurrent.CompletableFuture;
import static io.wdsj.asw.bukkit.AdvancedSensitiveWords.LOGGER;
import static io.wdsj.asw.bukkit.AdvancedSensitiveWords.settingsManager;
+/**
+ * Ollama AI processor
+ */
public class OllamaProcessor implements AIProcessor {
public static boolean isOllamaInit = false;
private static PromptBuilder promptBuilder;
@@ -19,6 +23,13 @@ public class OllamaProcessor implements AIProcessor {
public OllamaProcessor() {
}
+ /**
+ * Initialize the Ollama service
+ * @param modelAddress Ollama server address
+ * @param name Model name to use
+ * @param timeOut Timeout in seconds
+ * @param debug Whether to enable debug logging
+ */
public void initService(String modelAddress, String name, int timeOut, boolean debug) {
modelName = name;
api = new OllamaAPI(modelAddress);
@@ -51,6 +62,12 @@ public void shutdown() {
isOllamaInit = false;
}
+ /**
+ * Process the input message using OllamaProcessor
+ * @param inputMessage The message to process
+ * @return A future that will contain the returned message from Ollama server, the future inside may be null
+ */
+ @NotNull
public static CompletableFuture process(String inputMessage) {
if (!isOllamaInit) {
throw new IllegalStateException("OllamaProcessor is not initialized");
diff --git a/bukkit/src/main/java/io/wdsj/asw/bukkit/ai/OpenAIProcessor.java b/bukkit/src/main/java/io/wdsj/asw/bukkit/ai/OpenAIProcessor.java
index a66ea28..b82a932 100644
--- a/bukkit/src/main/java/io/wdsj/asw/bukkit/ai/OpenAIProcessor.java
+++ b/bukkit/src/main/java/io/wdsj/asw/bukkit/ai/OpenAIProcessor.java
@@ -12,12 +12,20 @@
import static io.wdsj.asw.bukkit.AdvancedSensitiveWords.LOGGER;
import static io.wdsj.asw.bukkit.AdvancedSensitiveWords.settingsManager;
+/**
+ * OpenAI Moderation Processor.
+ */
public class OpenAIProcessor implements AIProcessor {
public static boolean isOpenAiInit = false;
private static OpenAiClient client;
public OpenAIProcessor() {
}
+ /**
+ * Initialize the OpenAI moderation service.
+ * @param apikey the openai key
+ * @param debug whether to enable debug logging
+ */
public void initService(String apikey, boolean debug) {
@SuppressWarnings("rawtypes")
OpenAiClient.Builder builder = OpenAiClient.builder()
@@ -44,6 +52,11 @@ public void shutdown() {
isOpenAiInit = false;
}
+ /**
+ * Process the input message using OpenAI moderation.
+ * @param inputMessage the input message
+ * @return A future contains the moderation response
+ */
public static CompletableFuture process(String inputMessage) {
if (!isOpenAiInit) {
throw new IllegalStateException("OpenAI Moderation Processor is not initialized");
diff --git a/bukkit/src/main/java/io/wdsj/asw/bukkit/command/ConstructCommandExecutor.java b/bukkit/src/main/java/io/wdsj/asw/bukkit/command/ConstructCommandExecutor.java
index 1045791..f5aba4f 100644
--- a/bukkit/src/main/java/io/wdsj/asw/bukkit/command/ConstructCommandExecutor.java
+++ b/bukkit/src/main/java/io/wdsj/asw/bukkit/command/ConstructCommandExecutor.java
@@ -2,9 +2,9 @@
import com.github.houbb.heaven.util.util.OsUtil;
import io.wdsj.asw.bukkit.AdvancedSensitiveWords;
-import io.wdsj.asw.bukkit.manage.permission.PermissionsEnum;
import io.wdsj.asw.bukkit.manage.punish.Punishment;
import io.wdsj.asw.bukkit.manage.punish.ViolationCounter;
+import io.wdsj.asw.bukkit.permission.PermissionsEnum;
import io.wdsj.asw.bukkit.setting.PluginMessages;
import io.wdsj.asw.bukkit.setting.PluginSettings;
import io.wdsj.asw.bukkit.util.cache.BookCache;
diff --git a/bukkit/src/main/java/io/wdsj/asw/bukkit/command/ConstructTabCompleter.java b/bukkit/src/main/java/io/wdsj/asw/bukkit/command/ConstructTabCompleter.java
index 4ed8231..4b46943 100644
--- a/bukkit/src/main/java/io/wdsj/asw/bukkit/command/ConstructTabCompleter.java
+++ b/bukkit/src/main/java/io/wdsj/asw/bukkit/command/ConstructTabCompleter.java
@@ -1,6 +1,6 @@
package io.wdsj.asw.bukkit.command;
-import io.wdsj.asw.bukkit.manage.permission.PermissionsEnum;
+import io.wdsj.asw.bukkit.permission.PermissionsEnum;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.ConsoleCommandSender;
diff --git a/bukkit/src/main/java/io/wdsj/asw/bukkit/manage/notice/Notifier.java b/bukkit/src/main/java/io/wdsj/asw/bukkit/manage/notice/Notifier.java
index a7ad33d..d750701 100644
--- a/bukkit/src/main/java/io/wdsj/asw/bukkit/manage/notice/Notifier.java
+++ b/bukkit/src/main/java/io/wdsj/asw/bukkit/manage/notice/Notifier.java
@@ -1,10 +1,11 @@
package io.wdsj.asw.bukkit.manage.notice;
-import io.wdsj.asw.bukkit.manage.permission.PermissionsEnum;
-import io.wdsj.asw.bukkit.manage.permission.cache.CachingPermTool;
import io.wdsj.asw.bukkit.manage.punish.ViolationCounter;
+import io.wdsj.asw.bukkit.permission.PermissionsEnum;
+import io.wdsj.asw.bukkit.permission.cache.CachingPermTool;
import io.wdsj.asw.bukkit.setting.PluginMessages;
import io.wdsj.asw.bukkit.type.ModuleType;
+import io.wdsj.asw.bukkit.util.SchedulingUtils;
import io.wdsj.asw.bukkit.util.message.MessageUtils;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
@@ -12,8 +13,6 @@
import java.util.Collection;
import java.util.List;
-import static io.wdsj.asw.bukkit.AdvancedSensitiveWords.getScheduler;
-
public class Notifier {
/**
* Notice the operators
@@ -23,7 +22,7 @@ public class Notifier {
* @param censoredList censored list
*/
public static void notice(Player violatedPlayer, ModuleType moduleType, String originalMessage, List censoredList) {
- getScheduler().runTask(() -> {
+ SchedulingUtils.runSyncIfNotOnMainThread(() -> {
Collection extends Player> players = Bukkit.getOnlinePlayers();
String message = MessageUtils.retrieveMessage(PluginMessages.ADMIN_REMINDER).replace("%player%", violatedPlayer.getName()).replace("%type%", moduleType.toString()).replace("%message%", originalMessage).replace("%censored_list%", censoredList.toString()).replace("%violation%", String.valueOf(ViolationCounter.getViolationCount(violatedPlayer)));
for (Player player : players) {
@@ -35,7 +34,7 @@ public static void notice(Player violatedPlayer, ModuleType moduleType, String o
}
public static void normalNotice(String message) {
- getScheduler().runTask(() -> {
+ SchedulingUtils.runSyncIfNotOnMainThread(() -> {
Collection extends Player> players = Bukkit.getOnlinePlayers();
for (Player player : players) {
if (CachingPermTool.hasPermission(PermissionsEnum.NOTICE, player)) {
diff --git a/bukkit/src/main/java/io/wdsj/asw/bukkit/manage/permission/PermissionsEnum.java b/bukkit/src/main/java/io/wdsj/asw/bukkit/permission/PermissionsEnum.java
similarity index 94%
rename from bukkit/src/main/java/io/wdsj/asw/bukkit/manage/permission/PermissionsEnum.java
rename to bukkit/src/main/java/io/wdsj/asw/bukkit/permission/PermissionsEnum.java
index c25c1a6..526f54e 100644
--- a/bukkit/src/main/java/io/wdsj/asw/bukkit/manage/permission/PermissionsEnum.java
+++ b/bukkit/src/main/java/io/wdsj/asw/bukkit/permission/PermissionsEnum.java
@@ -1,4 +1,4 @@
-package io.wdsj.asw.bukkit.manage.permission;
+package io.wdsj.asw.bukkit.permission;
/**
* Permission enums
diff --git a/bukkit/src/main/java/io/wdsj/asw/bukkit/manage/permission/cache/CachingPermTool.java b/bukkit/src/main/java/io/wdsj/asw/bukkit/permission/cache/CachingPermTool.java
similarity index 95%
rename from bukkit/src/main/java/io/wdsj/asw/bukkit/manage/permission/cache/CachingPermTool.java
rename to bukkit/src/main/java/io/wdsj/asw/bukkit/permission/cache/CachingPermTool.java
index 580f51e..309c549 100644
--- a/bukkit/src/main/java/io/wdsj/asw/bukkit/manage/permission/cache/CachingPermTool.java
+++ b/bukkit/src/main/java/io/wdsj/asw/bukkit/permission/cache/CachingPermTool.java
@@ -1,8 +1,8 @@
-package io.wdsj.asw.bukkit.manage.permission.cache;
+package io.wdsj.asw.bukkit.permission.cache;
import com.github.benmanes.caffeine.cache.Cache;
import com.github.benmanes.caffeine.cache.Caffeine;
-import io.wdsj.asw.bukkit.manage.permission.PermissionsEnum;
+import io.wdsj.asw.bukkit.permission.PermissionsEnum;
import org.bukkit.entity.HumanEntity;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
diff --git a/bukkit/src/main/kotlin/io/wdsj/asw/bukkit/listener/AnvilListener.kt b/bukkit/src/main/kotlin/io/wdsj/asw/bukkit/listener/AnvilListener.kt
index 09bdb3a..34f6f0b 100644
--- a/bukkit/src/main/kotlin/io/wdsj/asw/bukkit/listener/AnvilListener.kt
+++ b/bukkit/src/main/kotlin/io/wdsj/asw/bukkit/listener/AnvilListener.kt
@@ -3,10 +3,10 @@ package io.wdsj.asw.bukkit.listener
import io.wdsj.asw.bukkit.AdvancedSensitiveWords
import io.wdsj.asw.bukkit.AdvancedSensitiveWords.settingsManager
import io.wdsj.asw.bukkit.manage.notice.Notifier
-import io.wdsj.asw.bukkit.manage.permission.PermissionsEnum
-import io.wdsj.asw.bukkit.manage.permission.cache.CachingPermTool
import io.wdsj.asw.bukkit.manage.punish.Punishment
import io.wdsj.asw.bukkit.manage.punish.ViolationCounter
+import io.wdsj.asw.bukkit.permission.PermissionsEnum
+import io.wdsj.asw.bukkit.permission.cache.CachingPermTool
import io.wdsj.asw.bukkit.proxy.bungee.BungeeSender
import io.wdsj.asw.bukkit.proxy.velocity.VelocitySender
import io.wdsj.asw.bukkit.setting.PluginMessages
diff --git a/bukkit/src/main/kotlin/io/wdsj/asw/bukkit/listener/BookListener.kt b/bukkit/src/main/kotlin/io/wdsj/asw/bukkit/listener/BookListener.kt
index 9b72404..813f93e 100644
--- a/bukkit/src/main/kotlin/io/wdsj/asw/bukkit/listener/BookListener.kt
+++ b/bukkit/src/main/kotlin/io/wdsj/asw/bukkit/listener/BookListener.kt
@@ -3,10 +3,10 @@ package io.wdsj.asw.bukkit.listener
import io.wdsj.asw.bukkit.AdvancedSensitiveWords
import io.wdsj.asw.bukkit.AdvancedSensitiveWords.settingsManager
import io.wdsj.asw.bukkit.manage.notice.Notifier
-import io.wdsj.asw.bukkit.manage.permission.PermissionsEnum
-import io.wdsj.asw.bukkit.manage.permission.cache.CachingPermTool
import io.wdsj.asw.bukkit.manage.punish.Punishment
import io.wdsj.asw.bukkit.manage.punish.ViolationCounter
+import io.wdsj.asw.bukkit.permission.PermissionsEnum
+import io.wdsj.asw.bukkit.permission.cache.CachingPermTool
import io.wdsj.asw.bukkit.proxy.bungee.BungeeSender
import io.wdsj.asw.bukkit.proxy.velocity.VelocitySender
import io.wdsj.asw.bukkit.setting.PluginMessages
diff --git a/bukkit/src/main/kotlin/io/wdsj/asw/bukkit/listener/ChatListener.kt b/bukkit/src/main/kotlin/io/wdsj/asw/bukkit/listener/ChatListener.kt
index 48e3cac..fbc4bfa 100644
--- a/bukkit/src/main/kotlin/io/wdsj/asw/bukkit/listener/ChatListener.kt
+++ b/bukkit/src/main/kotlin/io/wdsj/asw/bukkit/listener/ChatListener.kt
@@ -6,10 +6,10 @@ import io.wdsj.asw.bukkit.AdvancedSensitiveWords.*
import io.wdsj.asw.bukkit.ai.OllamaProcessor
import io.wdsj.asw.bukkit.ai.OpenAIProcessor
import io.wdsj.asw.bukkit.manage.notice.Notifier
-import io.wdsj.asw.bukkit.manage.permission.PermissionsEnum
-import io.wdsj.asw.bukkit.manage.permission.cache.CachingPermTool
import io.wdsj.asw.bukkit.manage.punish.Punishment
import io.wdsj.asw.bukkit.manage.punish.ViolationCounter
+import io.wdsj.asw.bukkit.permission.PermissionsEnum
+import io.wdsj.asw.bukkit.permission.cache.CachingPermTool
import io.wdsj.asw.bukkit.proxy.bungee.BungeeSender
import io.wdsj.asw.bukkit.proxy.velocity.VelocitySender
import io.wdsj.asw.bukkit.setting.PluginMessages
@@ -199,7 +199,8 @@ class ChatListener : Listener {
private fun shouldNotProcess(player: Player): Boolean {
- if (isInitialized && !CachingPermTool.hasPermission(PermissionsEnum.BYPASS, player)) {
+ if (isInitialized && !CachingPermTool.hasPermission(
+ PermissionsEnum.BYPASS, player)) {
if (isAuthMeAvailable && settingsManager.getProperty(PluginSettings.ENABLE_AUTHME_COMPATIBILITY)) {
if (!AuthMeApi.getInstance().isAuthenticated(player)) return true
}
diff --git a/bukkit/src/main/kotlin/io/wdsj/asw/bukkit/listener/CommandListener.kt b/bukkit/src/main/kotlin/io/wdsj/asw/bukkit/listener/CommandListener.kt
index ab0be10..d635674 100644
--- a/bukkit/src/main/kotlin/io/wdsj/asw/bukkit/listener/CommandListener.kt
+++ b/bukkit/src/main/kotlin/io/wdsj/asw/bukkit/listener/CommandListener.kt
@@ -4,10 +4,10 @@ import cc.baka9.catseedlogin.bukkit.CatSeedLoginAPI
import fr.xephi.authme.api.v3.AuthMeApi
import io.wdsj.asw.bukkit.AdvancedSensitiveWords.*
import io.wdsj.asw.bukkit.manage.notice.Notifier
-import io.wdsj.asw.bukkit.manage.permission.PermissionsEnum
-import io.wdsj.asw.bukkit.manage.permission.cache.CachingPermTool
import io.wdsj.asw.bukkit.manage.punish.Punishment
import io.wdsj.asw.bukkit.manage.punish.ViolationCounter
+import io.wdsj.asw.bukkit.permission.PermissionsEnum
+import io.wdsj.asw.bukkit.permission.cache.CachingPermTool
import io.wdsj.asw.bukkit.proxy.bungee.BungeeSender
import io.wdsj.asw.bukkit.proxy.velocity.VelocitySender
import io.wdsj.asw.bukkit.setting.PluginMessages
@@ -83,7 +83,8 @@ class CommandListener : Listener {
}
private fun shouldNotProcess(player: Player, message: String): Boolean {
- if (isInitialized && !CachingPermTool.hasPermission(PermissionsEnum.BYPASS, player) && !Utils.isCommandAndWhiteListed(message)) {
+ if (isInitialized && !CachingPermTool.hasPermission(
+ PermissionsEnum.BYPASS, player) && !Utils.isCommandAndWhiteListed(message)) {
if (isAuthMeAvailable && settingsManager.getProperty(PluginSettings.ENABLE_AUTHME_COMPATIBILITY)) {
if (!AuthMeApi.getInstance().isAuthenticated(player)) return true
}
diff --git a/bukkit/src/main/kotlin/io/wdsj/asw/bukkit/listener/JoinUpdateNotifier.kt b/bukkit/src/main/kotlin/io/wdsj/asw/bukkit/listener/JoinUpdateNotifier.kt
index 3345c1e..1ceb66a 100644
--- a/bukkit/src/main/kotlin/io/wdsj/asw/bukkit/listener/JoinUpdateNotifier.kt
+++ b/bukkit/src/main/kotlin/io/wdsj/asw/bukkit/listener/JoinUpdateNotifier.kt
@@ -2,8 +2,8 @@ package io.wdsj.asw.bukkit.listener
import io.wdsj.asw.bukkit.AdvancedSensitiveWords.messagesManager
import io.wdsj.asw.bukkit.AdvancedSensitiveWords.settingsManager
-import io.wdsj.asw.bukkit.manage.permission.PermissionsEnum
-import io.wdsj.asw.bukkit.manage.permission.cache.CachingPermTool
+import io.wdsj.asw.bukkit.permission.PermissionsEnum
+import io.wdsj.asw.bukkit.permission.cache.CachingPermTool
import io.wdsj.asw.bukkit.setting.PluginMessages
import io.wdsj.asw.bukkit.setting.PluginSettings
import io.wdsj.asw.bukkit.update.Updater
diff --git a/bukkit/src/main/kotlin/io/wdsj/asw/bukkit/listener/PlayerItemListener.kt b/bukkit/src/main/kotlin/io/wdsj/asw/bukkit/listener/PlayerItemListener.kt
index c387994..3f25b1c 100644
--- a/bukkit/src/main/kotlin/io/wdsj/asw/bukkit/listener/PlayerItemListener.kt
+++ b/bukkit/src/main/kotlin/io/wdsj/asw/bukkit/listener/PlayerItemListener.kt
@@ -3,10 +3,10 @@ package io.wdsj.asw.bukkit.listener
import io.wdsj.asw.bukkit.AdvancedSensitiveWords
import io.wdsj.asw.bukkit.AdvancedSensitiveWords.settingsManager
import io.wdsj.asw.bukkit.manage.notice.Notifier
-import io.wdsj.asw.bukkit.manage.permission.PermissionsEnum
-import io.wdsj.asw.bukkit.manage.permission.cache.CachingPermTool
import io.wdsj.asw.bukkit.manage.punish.Punishment
import io.wdsj.asw.bukkit.manage.punish.ViolationCounter
+import io.wdsj.asw.bukkit.permission.PermissionsEnum
+import io.wdsj.asw.bukkit.permission.cache.CachingPermTool
import io.wdsj.asw.bukkit.proxy.bungee.BungeeSender
import io.wdsj.asw.bukkit.proxy.velocity.VelocitySender
import io.wdsj.asw.bukkit.setting.PluginMessages
diff --git a/bukkit/src/main/kotlin/io/wdsj/asw/bukkit/listener/PlayerLoginListener.kt b/bukkit/src/main/kotlin/io/wdsj/asw/bukkit/listener/PlayerLoginListener.kt
index 5f18971..a822c8e 100644
--- a/bukkit/src/main/kotlin/io/wdsj/asw/bukkit/listener/PlayerLoginListener.kt
+++ b/bukkit/src/main/kotlin/io/wdsj/asw/bukkit/listener/PlayerLoginListener.kt
@@ -2,10 +2,10 @@ package io.wdsj.asw.bukkit.listener
import io.wdsj.asw.bukkit.AdvancedSensitiveWords.*
import io.wdsj.asw.bukkit.manage.notice.Notifier
-import io.wdsj.asw.bukkit.manage.permission.PermissionsEnum
-import io.wdsj.asw.bukkit.manage.permission.cache.CachingPermTool
import io.wdsj.asw.bukkit.manage.punish.Punishment
import io.wdsj.asw.bukkit.manage.punish.ViolationCounter
+import io.wdsj.asw.bukkit.permission.PermissionsEnum
+import io.wdsj.asw.bukkit.permission.cache.CachingPermTool
import io.wdsj.asw.bukkit.proxy.bungee.BungeeSender
import io.wdsj.asw.bukkit.proxy.velocity.VelocitySender
import io.wdsj.asw.bukkit.setting.PluginMessages
diff --git a/bukkit/src/main/kotlin/io/wdsj/asw/bukkit/listener/SignListener.kt b/bukkit/src/main/kotlin/io/wdsj/asw/bukkit/listener/SignListener.kt
index 1a33be6..d1dde73 100644
--- a/bukkit/src/main/kotlin/io/wdsj/asw/bukkit/listener/SignListener.kt
+++ b/bukkit/src/main/kotlin/io/wdsj/asw/bukkit/listener/SignListener.kt
@@ -3,10 +3,10 @@ package io.wdsj.asw.bukkit.listener
import com.github.houbb.heaven.util.lang.StringUtil
import io.wdsj.asw.bukkit.AdvancedSensitiveWords.*
import io.wdsj.asw.bukkit.manage.notice.Notifier
-import io.wdsj.asw.bukkit.manage.permission.PermissionsEnum
-import io.wdsj.asw.bukkit.manage.permission.cache.CachingPermTool
import io.wdsj.asw.bukkit.manage.punish.Punishment
import io.wdsj.asw.bukkit.manage.punish.ViolationCounter
+import io.wdsj.asw.bukkit.permission.PermissionsEnum
+import io.wdsj.asw.bukkit.permission.cache.CachingPermTool
import io.wdsj.asw.bukkit.proxy.bungee.BungeeSender
import io.wdsj.asw.bukkit.proxy.velocity.VelocitySender
import io.wdsj.asw.bukkit.setting.PluginMessages
diff --git a/bukkit/src/main/kotlin/io/wdsj/asw/bukkit/listener/packet/ASWBookPacketListener.kt b/bukkit/src/main/kotlin/io/wdsj/asw/bukkit/listener/packet/ASWBookPacketListener.kt
index d5c528c..c3886f5 100644
--- a/bukkit/src/main/kotlin/io/wdsj/asw/bukkit/listener/packet/ASWBookPacketListener.kt
+++ b/bukkit/src/main/kotlin/io/wdsj/asw/bukkit/listener/packet/ASWBookPacketListener.kt
@@ -8,10 +8,10 @@ import com.github.retrooper.packetevents.wrapper.play.client.WrapperPlayClientEd
import io.wdsj.asw.bukkit.AdvancedSensitiveWords
import io.wdsj.asw.bukkit.AdvancedSensitiveWords.settingsManager
import io.wdsj.asw.bukkit.manage.notice.Notifier
-import io.wdsj.asw.bukkit.manage.permission.PermissionsEnum
-import io.wdsj.asw.bukkit.manage.permission.cache.CachingPermTool
import io.wdsj.asw.bukkit.manage.punish.Punishment
import io.wdsj.asw.bukkit.manage.punish.ViolationCounter
+import io.wdsj.asw.bukkit.permission.PermissionsEnum
+import io.wdsj.asw.bukkit.permission.cache.CachingPermTool
import io.wdsj.asw.bukkit.proxy.bungee.BungeeSender
import io.wdsj.asw.bukkit.proxy.velocity.VelocitySender
import io.wdsj.asw.bukkit.setting.PluginMessages
diff --git a/bukkit/src/main/kotlin/io/wdsj/asw/bukkit/listener/packet/ASWChatPacketListener.kt b/bukkit/src/main/kotlin/io/wdsj/asw/bukkit/listener/packet/ASWChatPacketListener.kt
index 193182b..f89f1c4 100644
--- a/bukkit/src/main/kotlin/io/wdsj/asw/bukkit/listener/packet/ASWChatPacketListener.kt
+++ b/bukkit/src/main/kotlin/io/wdsj/asw/bukkit/listener/packet/ASWChatPacketListener.kt
@@ -13,10 +13,10 @@ import io.wdsj.asw.bukkit.ai.OllamaProcessor
import io.wdsj.asw.bukkit.ai.OpenAIProcessor
import io.wdsj.asw.bukkit.listener.FakeMessageExecutor
import io.wdsj.asw.bukkit.manage.notice.Notifier
-import io.wdsj.asw.bukkit.manage.permission.PermissionsEnum
-import io.wdsj.asw.bukkit.manage.permission.cache.CachingPermTool
import io.wdsj.asw.bukkit.manage.punish.Punishment
import io.wdsj.asw.bukkit.manage.punish.ViolationCounter
+import io.wdsj.asw.bukkit.permission.PermissionsEnum
+import io.wdsj.asw.bukkit.permission.cache.CachingPermTool
import io.wdsj.asw.bukkit.proxy.bungee.BungeeSender
import io.wdsj.asw.bukkit.proxy.velocity.VelocitySender
import io.wdsj.asw.bukkit.setting.PluginMessages
@@ -292,7 +292,8 @@ class ASWChatPacketListener : PacketListenerAbstract(PacketListenerPriority.LOW)
}
private fun shouldNotProcess(player: Player, message: String): Boolean {
- if (isInitialized && !CachingPermTool.hasPermission(PermissionsEnum.BYPASS, player) && !Utils.isCommandAndWhiteListed(message)) {
+ if (isInitialized && !CachingPermTool.hasPermission(
+ PermissionsEnum.BYPASS, player) && !Utils.isCommandAndWhiteListed(message)) {
if (isAuthMeAvailable && settingsManager.getProperty(PluginSettings.ENABLE_AUTHME_COMPATIBILITY)) {
if (!AuthMeApi.getInstance().isAuthenticated(player)) return true
}