From 1ae30bb6b2c71db3b06a716c86aca0bf4f2efb2a Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Wed, 25 Jul 2018 01:24:28 -0400
Subject: [PATCH] Fix RCON Ip Defaulting to wrong value - Closes #1267

---
 .../0105-Configurable-RCON-IP-address.patch   |  6 ++---
 ...air-bad-rcon.ip-settings-temporarily.patch | 24 +++++++++++++++++++
 2 files changed, 27 insertions(+), 3 deletions(-)
 create mode 100644 Spigot-Server-Patches/0312-repair-bad-rcon.ip-settings-temporarily.patch

diff --git a/Spigot-Server-Patches/0105-Configurable-RCON-IP-address.patch b/Spigot-Server-Patches/0105-Configurable-RCON-IP-address.patch
index f4c56ee17..c843fae7b 100644
--- a/Spigot-Server-Patches/0105-Configurable-RCON-IP-address.patch
+++ b/Spigot-Server-Patches/0105-Configurable-RCON-IP-address.patch
@@ -1,4 +1,4 @@
-From 34fc50dad287d6b268931ec670644fe4e6ffcc50 Mon Sep 17 00:00:00 2001
+From d865cb389ffae2dd8e7bc86b347c9230c26350bb 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
@@ -6,7 +6,7 @@ Subject: [PATCH] Configurable RCON IP address
 For servers with multiple IP's, ability to bind to a specific interface.
 
 diff --git a/src/main/java/net/minecraft/server/RemoteControlListener.java b/src/main/java/net/minecraft/server/RemoteControlListener.java
-index 6f0176f6f..1e5caa13a 100644
+index 6f0176f6ff..c237f239f3 100644
 --- a/src/main/java/net/minecraft/server/RemoteControlListener.java
 +++ b/src/main/java/net/minecraft/server/RemoteControlListener.java
 @@ -24,7 +24,7 @@ public class RemoteControlListener extends RemoteConnectionThread {
@@ -14,7 +14,7 @@ index 6f0176f6f..1e5caa13a 100644
          this.h = iminecraftserver.a("rcon.port", 0);
          this.l = iminecraftserver.a("rcon.password", "");
 -        this.j = iminecraftserver.e();
-+        this.j = iminecraftserver.a("rcon.ip", iminecraftserver.d_()); // Paper
++        this.j = iminecraftserver.a("rcon.ip", ((DedicatedServer) iminecraftserver).getServerIp()); // Paper
          this.i = iminecraftserver.f();
          if (0 == this.h) {
              this.h = this.i + 10;
diff --git a/Spigot-Server-Patches/0312-repair-bad-rcon.ip-settings-temporarily.patch b/Spigot-Server-Patches/0312-repair-bad-rcon.ip-settings-temporarily.patch
new file mode 100644
index 000000000..31ffb2f8e
--- /dev/null
+++ b/Spigot-Server-Patches/0312-repair-bad-rcon.ip-settings-temporarily.patch
@@ -0,0 +1,24 @@
+From d4006d0f3ce1a5323bbdfce7446b59723f11512f Mon Sep 17 00:00:00 2001
+From: Aikar <aikar@aikar.co>
+Date: Wed, 25 Jul 2018 01:21:05 -0400
+Subject: [PATCH] repair bad rcon.ip settings temporarily
+
+accidently missed mapping change, and we defaulted rcon.ip to the server.properties file path
+
+clean up values for people, drop this patch after like 2 weeks.
+
+diff --git a/src/main/java/net/minecraft/server/RemoteControlListener.java b/src/main/java/net/minecraft/server/RemoteControlListener.java
+index c237f239f3..1319b3b916 100644
+--- a/src/main/java/net/minecraft/server/RemoteControlListener.java
++++ b/src/main/java/net/minecraft/server/RemoteControlListener.java
+@@ -25,6 +25,7 @@ public class RemoteControlListener extends RemoteConnectionThread {
+         this.h = iminecraftserver.a("rcon.port", 0);
+         this.l = iminecraftserver.a("rcon.password", "");
+         this.j = iminecraftserver.a("rcon.ip", ((DedicatedServer) iminecraftserver).getServerIp()); // Paper
++        if (this.j.equals(iminecraftserver.d_())) this.j = ((DedicatedServer) iminecraftserver).getServerIp(); // Paper - temporary - remove this after like 2 weeks - repair bad settings
+         this.i = iminecraftserver.f();
+         if (0 == this.h) {
+             this.h = this.i + 10;
+-- 
+2.18.0
+