diff --git a/Spigot-API-Patches/Add-extended-PaperServerListPingEvent.patch b/Spigot-API-Patches/Add-extended-PaperServerListPingEvent.patch index 0f93504d9c..f5a84ee1e7 100644 --- a/Spigot-API-Patches/Add-extended-PaperServerListPingEvent.patch +++ b/Spigot-API-Patches/Add-extended-PaperServerListPingEvent.patch @@ -8,7 +8,7 @@ and allows full control of the response sent to the client. diff --git a/src/main/java/com/destroystokyo/paper/event/server/PaperServerListPingEvent.java b/src/main/java/com/destroystokyo/paper/event/server/PaperServerListPingEvent.java new file mode 100644 -index 00000000..dd1deafd +index 00000000..b2a8476c --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/server/PaperServerListPingEvent.java @@ -0,0 +0,0 @@ @@ -185,7 +185,8 @@ index 00000000..dd1deafd + * Returns the protocol version that will be sent as the protocol version + * of the server to the client. + * -+ * @return The protocol version of the server ++ * @return The protocol version of the server, or {@code -1} if the server ++ * has not finished initialization yet + */ + public int getProtocolVersion() { + return protocolVersion; diff --git a/Spigot-Server-Patches/Implement-extended-PaperServerListPingEvent.patch b/Spigot-Server-Patches/Implement-extended-PaperServerListPingEvent.patch index 675daf40e9..15abfc10f0 100644 --- a/Spigot-Server-Patches/Implement-extended-PaperServerListPingEvent.patch +++ b/Spigot-Server-Patches/Implement-extended-PaperServerListPingEvent.patch @@ -60,7 +60,7 @@ index 000000000..a2a409e63 +} diff --git a/src/main/java/com/destroystokyo/paper/network/StandardPaperServerListPingEventImpl.java b/src/main/java/com/destroystokyo/paper/network/StandardPaperServerListPingEventImpl.java new file mode 100644 -index 000000000..26e3031d2 +index 000000000..a85466bc7 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/network/StandardPaperServerListPingEventImpl.java @@ -0,0 +0,0 @@ @@ -90,7 +90,7 @@ index 000000000..26e3031d2 + private GameProfile[] originalSample; + + private StandardPaperServerListPingEventImpl(MinecraftServer server, NetworkManager networkManager, ServerPing ping) { -+ super(server, new PaperStatusClient(networkManager), ping.getServerData().getProtocolVersion(), server.server.getServerIcon()); ++ super(server, new PaperStatusClient(networkManager), ping.getServerData() != null ? ping.getServerData().getProtocolVersion() : -1, server.server.getServerIcon()); + this.originalSample = ping.getPlayers() == null ? null : ping.getPlayers().getSample(); // GH-1473 - pre-tick race condition NPE + } +