Move to configurate for paper.yml (#7609)

This commit is contained in:
Jake Potrebic
2022-06-09 01:51:45 -07:00
parent 01cf853f91
commit 2168417373
193 changed files with 4094 additions and 3835 deletions

View File

@@ -16,20 +16,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
// Paper end
implementation("org.apache.logging.log4j:log4j-iostreams:2.17.1") // Paper
implementation("org.apache.logging.log4j:log4j-slf4j18-impl:2.17.1") // Paper
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
@@ -0,0 +0,0 @@ public class PaperConfig {
private static void useDimensionTypeForCustomSpawners() {
useDimensionTypeForCustomSpawners = getBoolean("settings.use-dimension-type-for-custom-spawners", false);
}
+
+ public static boolean useProxyProtocol;
+ private static void useProxyProtocol() {
+ useProxyProtocol = getBoolean("settings.proxy-protocol", false);
+ }
}
diff --git a/src/main/java/net/minecraft/server/network/ServerConnectionListener.java b/src/main/java/net/minecraft/server/network/ServerConnectionListener.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/network/ServerConnectionListener.java
@@ -39,7 +25,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
// Paper end
+ // Paper start - indicate Proxy Protocol usage
+ if (com.destroystokyo.paper.PaperConfig.useProxyProtocol) {
+ if (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.proxyProtocol) {
+ ServerConnectionListener.LOGGER.info("Paper: Using Proxy Protocol");
+ }
+ // Paper end
@@ -52,7 +38,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
Object object = j > 0 ? new RateKickingConnection(j) : new Connection(PacketFlow.SERVERBOUND);
+ // Paper start - Add support for Proxy Protocol
+ if (com.destroystokyo.paper.PaperConfig.useProxyProtocol) {
+ if (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.proxyProtocol) {
+ channel.pipeline().addAfter("timeout", "haproxy-decoder", new io.netty.handler.codec.haproxy.HAProxyMessageDecoder());
+ channel.pipeline().addAfter("haproxy-decoder", "haproxy-handler", new ChannelInboundHandlerAdapter() {
+ @Override