-
-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dont respond ping before start fully
- Loading branch information
1 parent
d28a165
commit 3b98bb8
Showing
2 changed files
with
31 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
patches/server/0089-Dont-respond-ping-before-start-fully.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: violetc <58360096+s-yh-china@users.noreply.github.com> | ||
Date: Mon, 17 Jul 2023 23:16:58 +0800 | ||
Subject: [PATCH] Dont respond ping before start fully | ||
|
||
This patch is Powered by Gale(https://github.com/GaleMC/Gale) | ||
|
||
diff --git a/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java | ||
index 2c13147bc063a09bb7907d6f90c3a1e811a09eb1..b6332639468dbfc3086f100809fdb3d471867d12 100644 | ||
--- a/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java | ||
+++ b/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java | ||
@@ -153,6 +153,12 @@ public class ServerStatusPacketListenerImpl implements ServerStatusPacketListene | ||
this.connection.send(new ClientboundStatusResponsePacket(ping)); | ||
// CraftBukkit end | ||
*/ | ||
+ // Leaves start - dont respond it before start full | ||
+ var status = MinecraftServer.getServer().getStatus(); | ||
+ if (top.leavesmc.leaves.LeavesConfig.dontRespondPingBeforeStart && (status == null || status.version() == null || status.version().isEmpty())) { | ||
+ return; | ||
+ } | ||
+ // Leaves end - dont respond it before start full | ||
com.destroystokyo.paper.network.StandardPaperServerListPingEventImpl.processRequest(MinecraftServer.getServer(), this.connection); | ||
// Paper end | ||
} |