Check if kicking on command rate limit is enabled
This commit is contained in:
@@ -38,7 +38,7 @@ public abstract class RateLimitedCommandHandler<T extends MinecraftPacket> imple
|
|||||||
public boolean handlePlayerCommand(MinecraftPacket packet) {
|
public boolean handlePlayerCommand(MinecraftPacket packet) {
|
||||||
if (packetClass().isInstance(packet)) {
|
if (packetClass().isInstance(packet)) {
|
||||||
if (!velocityServer.getCommandRateLimiter().attempt(player.getUniqueId())) {
|
if (!velocityServer.getCommandRateLimiter().attempt(player.getUniqueId())) {
|
||||||
if (failedAttempts++ >= velocityServer.getConfiguration().getKickAfterRateLimitedCommands()) {
|
if (velocityServer.getConfiguration().isKickOnCommandRateLimit() && failedAttempts++ >= velocityServer.getConfiguration().getKickAfterRateLimitedCommands()) {
|
||||||
player.disconnect(Component.translatable("velocity.kick.command-rate-limit"));
|
player.disconnect(Component.translatable("velocity.kick.command-rate-limit"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user