Set connection thottle to -1 when Velocity IP forwarding is enabled

Port of 3c6f46936e
This commit is contained in:
Mark Vainomaa 2019-06-02 21:58:14 -05:00 committed by Zach Brown
parent da0aa69e44
commit 68eec9621f
No known key found for this signature in database
GPG key ID: CC9DA35FC5450B76

View file

@ -1,4 +1,4 @@
From 11e86765bb25800e0b6c6a030e4f9f5d14000f2f Mon Sep 17 00:00:00 2001
From a1f8c1906de53521774263e39bb27d64fe3ab6f3 Mon Sep 17 00:00:00 2001
From: Andrew Steinborn <git@steinborn.me>
Date: Mon, 8 Oct 2018 14:36:14 -0400
Subject: [PATCH] Add Velocity IP Forwarding Support
@ -277,6 +277,19 @@ index ae74dc9e1..7eb230f1b 100644
@Override
public void a(PacketDataSerializer packetdataserializer) throws IOException {
this.a = packetdataserializer.i();
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 88c6d1d02..e667bfb70 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -641,7 +641,7 @@ public final class CraftServer implements Server {
@Override
public long getConnectionThrottle() {
// Spigot Start - Automatically set connection throttle for bungee configurations
- if (org.spigotmc.SpigotConfig.bungee) {
+ if (org.spigotmc.SpigotConfig.bungee || com.destroystokyo.paper.PaperConfig.velocitySupport) { // Paper - Velocity support
return -1;
} else {
return this.configuration.getInt("settings.connection-throttle");
--
2.21.0