Add config option for command spam whitelist

This commit is contained in:
Shane Freeder
2025-03-23 18:31:39 +00:00
parent 894631f0d0
commit 2aad131e74
5 changed files with 26 additions and 10 deletions

View File

@@ -1561,7 +1561,7 @@
}
return optional;
@@ -1451,22 +_,155 @@
@@ -1451,22 +_,157 @@
return false;
}
@@ -1707,9 +1707,11 @@
+ // Spigot start - spam exclusions
+ private void detectRateSpam(String message) {
+ // CraftBukkit start - replaced with thread safe throttle
+ for (String exclude : org.spigotmc.SpigotConfig.spamExclusions) {
+ if (exclude != null && message.startsWith(exclude)) {
+ return;
+ if (org.spigotmc.SpigotConfig.enableSpamExclusions) {
+ for (String exclude : org.spigotmc.SpigotConfig.spamExclusions) {
+ if (exclude != null && message.startsWith(exclude)) {
+ return;
+ }
+ }
+ }
+ // Spigot end