aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0254-Configurable-connection-throttle-kick-message.patch
blob: 4da61fc469239b51b583eacddb610d97f605e124 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Tue, 2 Oct 2018 09:57:50 +0100
Subject: [PATCH] Configurable connection throttle kick message


diff --git a/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java
index 65333e0244d7c3c415266f1740929761ca890af7..f9314bee1ed9b0e4c4591c0acf8a305721765850 100644
--- a/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java
@@ -86,7 +86,7 @@ public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketL
             synchronized (ServerHandshakePacketListenerImpl.throttleTracker) {
                 if (ServerHandshakePacketListenerImpl.throttleTracker.containsKey(address) && !"127.0.0.1".equals(address.getHostAddress()) && currentTime - ServerHandshakePacketListenerImpl.throttleTracker.get(address) < connectionThrottle) {
                     ServerHandshakePacketListenerImpl.throttleTracker.put(address, currentTime);
-                    MutableComponent chatmessage = Component.literal("Connection throttled! Please wait before reconnecting.");
+                            Component chatmessage = io.papermc.paper.adventure.PaperAdventure.asVanilla(io.papermc.paper.configuration.GlobalConfiguration.get().messages.kick.connectionThrottle); // Paper - Configurable connection throttle kick message
                     this.connection.send(new ClientboundLoginDisconnectPacket(chatmessage));
                     this.connection.disconnect(chatmessage);
                     return;