From a863590fd5287bad0156d44e262871546250a3cc Mon Sep 17 00:00:00 2001 From: Warrior <50800980+Warriorrrr@users.noreply.github.com> Date: Sat, 10 Feb 2024 20:23:50 +0100 Subject: [PATCH] Propagate failed to bind to port error (#10235) --- patches/server/Improve-logging-and-errors.patch | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/patches/server/Improve-logging-and-errors.patch b/patches/server/Improve-logging-and-errors.patch index bb8f5f23dc..85d7e42f3d 100644 --- a/patches/server/Improve-logging-and-errors.patch +++ b/patches/server/Improve-logging-and-errors.patch @@ -39,6 +39,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 Iterator iterator = advancementtree.roots().iterator(); while (iterator.hasNext()) { +diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java ++++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +@@ -0,0 +0,0 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface + DedicatedServer.LOGGER.warn("**** FAILED TO BIND TO PORT!"); + DedicatedServer.LOGGER.warn("The exception was: {}", ioexception.toString()); + DedicatedServer.LOGGER.warn("Perhaps a server is already running on that port?"); ++ if (true) throw new IllegalStateException("Failed to bind to port", ioexception); // Paper - Propagate failed to bind to port error + return false; + } + diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java