2021-06-11 14:02:28 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Aikar <aikar@aikar.co>
|
|
|
|
Date: Sat, 16 Apr 2016 00:39:33 -0400
|
|
|
|
Subject: [PATCH] Configurable RCON IP address
|
|
|
|
|
|
|
|
For servers with multiple IP's, ability to bind to a specific interface.
|
|
|
|
|
2022-11-20 00:53:20 +01:00
|
|
|
== AT ==
|
|
|
|
public net.minecraft.server.dedicated.Settings getStringRaw(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
|
2021-06-11 14:02:28 +02:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
|
2024-10-22 20:04:31 +02:00
|
|
|
index 341123c078e97862ca8895534e85c324f256f4d6..47835226b61b726c750fe192fd94d3f8ba47565c 100644
|
2021-06-11 14:02:28 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
|
2024-06-13 19:30:39 +02:00
|
|
|
@@ -110,6 +110,8 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
|
2022-12-07 19:52:24 +01:00
|
|
|
public final WorldOptions worldOptions;
|
2024-04-24 03:25:14 +02:00
|
|
|
public boolean acceptsTransfers;
|
2021-06-11 14:02:28 +02:00
|
|
|
|
2024-01-23 14:34:17 +01:00
|
|
|
+ public final String rconIp; // Paper - Configurable rcon ip
|
2021-06-11 14:02:28 +02:00
|
|
|
+
|
|
|
|
// CraftBukkit start
|
2021-06-12 06:38:04 +02:00
|
|
|
public DedicatedServerProperties(Properties properties, OptionSet optionset) {
|
2021-06-11 14:02:28 +02:00
|
|
|
super(properties, optionset);
|
2024-10-22 20:04:31 +02:00
|
|
|
@@ -172,6 +174,10 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
|
2022-06-07 21:55:39 +02:00
|
|
|
}, WorldPresets.NORMAL.location().toString()));
|
2023-12-05 20:54:55 +01:00
|
|
|
this.serverResourcePackInfo = DedicatedServerProperties.getServerPackInfo(this.get("resource-pack-id", ""), this.get("resource-pack", ""), this.get("resource-pack-sha1", ""), this.getLegacyString("resource-pack-hash"), this.get("require-resource-pack", false), this.get("resource-pack-prompt", ""));
|
2022-12-07 19:52:24 +01:00
|
|
|
this.initialDataPackConfiguration = DedicatedServerProperties.getDatapackConfig(this.get("initial-enabled-packs", String.join(",", WorldDataConfiguration.DEFAULT.dataPacks().getEnabled())), this.get("initial-disabled-packs", String.join(",", WorldDataConfiguration.DEFAULT.dataPacks().getDisabled())));
|
2021-06-11 14:02:28 +02:00
|
|
|
+ // Paper start - Configurable rcon ip
|
2021-06-12 06:38:04 +02:00
|
|
|
+ final String rconIp = this.getStringRaw("rcon.ip");
|
2021-06-11 14:02:28 +02:00
|
|
|
+ this.rconIp = rconIp == null ? this.serverIp : rconIp;
|
2024-01-23 14:34:17 +01:00
|
|
|
+ // Paper end - Configurable rcon ip
|
2021-06-11 14:02:28 +02:00
|
|
|
}
|
|
|
|
|
2021-06-12 06:38:04 +02:00
|
|
|
// CraftBukkit start
|
2021-06-11 14:02:28 +02:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/rcon/thread/RconThread.java b/src/main/java/net/minecraft/server/rcon/thread/RconThread.java
|
2024-04-12 21:14:06 +02:00
|
|
|
index cf6ff562614e07dfdc0ae1d2d68df67d61136df0..594fbb033b63b8c9fb8752b1fcc78f8e9f7a2a83 100644
|
2021-06-11 14:02:28 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/rcon/thread/RconThread.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/rcon/thread/RconThread.java
|
2024-04-12 21:14:06 +02:00
|
|
|
@@ -57,7 +57,7 @@ public class RconThread extends GenericThread {
|
2021-06-11 14:02:28 +02:00
|
|
|
@Nullable
|
|
|
|
public static RconThread create(ServerInterface server) {
|
2021-06-12 06:38:04 +02:00
|
|
|
DedicatedServerProperties dedicatedServerProperties = server.getProperties();
|
|
|
|
- String string = server.getServerIp();
|
|
|
|
+ String string = dedicatedServerProperties.rconIp; // Paper - Configurable rcon ip
|
|
|
|
if (string.isEmpty()) {
|
|
|
|
string = "0.0.0.0";
|
|
|
|
}
|