+ if (!moe.monnairealms.camellia.config.modules.misc.PaperPacketLimiterConfig.forceDisable && (this.allPacketCounts != null || // Shiroha - Add config to force disable the packet limiter of Paper
+ io.papermc.paper.configuration.GlobalConfiguration.get().packetLimiter.overrides.containsKey(packet.getClass()))) { // Shiroha - Add config to force disable the packet limiter of Paper
@@ -877,7 +877,7 @@ public class ServerGamePacketListenerImpl
public void handleCustomCommandSuggestions(final ServerboundCommandSuggestionPacket packet) {
// PacketUtils.ensureRunningOnSameThread(packet, this, this.player.level()); // Paper - AsyncTabCompleteEvent; run this async
// CraftBukkit start
- if (!this.tabSpamThrottler.isIncrementAndUnderThreshold() && !this.server.getPlayerList().isOp(this.player.nameAndId()) && !this.server.isSingleplayerOwner(this.player.nameAndId())) { // Paper - configurable tab spam limits
+ if (!moe.monnairealms.camellia.config.modules.misc.PaperPacketLimiterConfig.forceDisable && !this.tabSpamThrottler.isIncrementAndUnderThreshold() && !this.server.getPlayerList().isOp(this.player.nameAndId()) && !this.server.isSingleplayerOwner(this.player.nameAndId())) { // Paper - configurable tab spam limits // Leaves - can disable
this.disconnectAsync(Component.translatable("disconnect.spam"), org.bukkit.event.player.PlayerKickEvent.Cause.SPAM); // Paper - Kick event cause // Paper - add proper async disconnect
return;
}
@@ -2111,6 +2111,7 @@ public class ServerGamePacketListenerImpl
private long lastLimitedPacket = -1;
private boolean checkLimit(long timestamp) {
+ if (moe.monnairealms.camellia.config.modules.misc.PaperPacketLimiterConfig.forceDisable) return true; // Leaves - disable
if (!io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.incomingPacketThreshold.enabled()) {
return true;
}
@@ -2677,6 +2678,8 @@ public class ServerGamePacketListenerImpl
// Spigot start - spam exclusions
private void detectRateSpam(final TickThrottler throttler, final String message) {
+ if (moe.monnairealms.camellia.config.modules.misc.PaperPacketLimiterConfig.forceDisable) return; // Leaves - disable
+ // CraftBukkit start - replaced with thread safe throttle
if (org.spigotmc.SpigotConfig.enableSpamExclusions) {
for (String exclude : org.spigotmc.SpigotConfig.spamExclusions) {
if (exclude != null && message.startsWith(exclude)) {
@@ -3475,7 +3478,7 @@ public class ServerGamePacketListenerImpl
@Override
public void handlePlaceRecipe(final ServerboundPlaceRecipePacket packet) {
// Paper start - auto recipe limit
- if (!org.bukkit.Bukkit.isPrimaryThread()) {
+ if (!moe.monnairealms.camellia.config.modules.misc.PaperPacketLimiterConfig.forceDisable && !org.bukkit.Bukkit.isPrimaryThread()) { // Leaves - can disable
if (!this.recipeSpamPackets.isIncrementAndUnderThreshold()) {
this.disconnectAsync(net.minecraft.network.chat.Component.translatable("disconnect.spam"), org.bukkit.event.player.PlayerKickEvent.Cause.SPAM); // Paper - kick event cause // Paper - add proper async disconnect