From 80e45357ae6af82a320d8eb6e7718aacd79db838 Mon Sep 17 00:00:00 2001 From: violetc <58360096+s-yh-china@users.noreply.github.com> Date: Mon, 4 Sep 2023 23:45:29 +0800 Subject: [PATCH] Fix fakeplayer.always-send-data (#125) --- patches/server/0008-Fakeplayer-support.patch | 22 ++++++++++++++++---- patches/server/0016-No-chat-sign.patch | 4 ++-- patches/server/0043-BBOR-Protocol.patch | 6 +++--- patches/server/0055-Xaero-Map-Protocol.patch | 4 ++-- patches/server/0121-Delete-Timings.patch | 8 +++---- 5 files changed, 29 insertions(+), 15 deletions(-) diff --git a/patches/server/0008-Fakeplayer-support.patch b/patches/server/0008-Fakeplayer-support.patch index e262ec88..493ab23d 100644 --- a/patches/server/0008-Fakeplayer-support.patch +++ b/patches/server/0008-Fakeplayer-support.patch @@ -148,7 +148,7 @@ index b382da838acc04a1c5d89064b4fa43bcdd38ae71..0cc848a600fa0f8af4f5f991834dd1d0 PlayerChangedWorldEvent changeEvent = new PlayerChangedWorldEvent(this.getBukkitEntity(), worldserver1.getWorld()); this.level().getCraftServer().getPluginManager().callEvent(changeEvent); diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index f097ec5b4e3ad6b1a7c464a8cff4f8b2568fcf4f..5ec8999aa305f614b605d7e858d9e817b1830735 100644 +index f097ec5b4e3ad6b1a7c464a8cff4f8b2568fcf4f..c64c53075efdefc5bb845f954de87c3f3f9d3fcf 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -81,6 +81,7 @@ import net.minecraft.server.ServerScoreboard; @@ -187,7 +187,21 @@ index f097ec5b4e3ad6b1a7c464a8cff4f8b2568fcf4f..5ec8999aa305f614b605d7e858d9e817 final net.kyori.adventure.text.Component jm = playerJoinEvent.joinMessage(); if (jm != null && !jm.equals(net.kyori.adventure.text.Component.empty())) { // Paper - Adventure -@@ -1095,11 +1110,16 @@ public abstract class PlayerList { +@@ -985,6 +1000,13 @@ public abstract class PlayerList { + } + // Paper end + ++ // Leaves start - bot support ++ if (top.leavesmc.leaves.LeavesConfig.fakeplayerSupport) { ++ top.leavesmc.leaves.bot.ServerBot.getBots().forEach(bot1 -> ++ bot1.render(entityplayer1, true)); // Leaves - render bot ++ } ++ // Leaves end - bot support ++ + // CraftBukkit end + return entityplayer1; + } +@@ -1095,11 +1117,16 @@ public abstract class PlayerList { } public String[] getPlayerNamesArray() { @@ -205,7 +219,7 @@ index f097ec5b4e3ad6b1a7c464a8cff4f8b2568fcf4f..5ec8999aa305f614b605d7e858d9e817 return astring; } -@@ -1578,4 +1598,16 @@ public abstract class PlayerList { +@@ -1578,4 +1605,16 @@ public abstract class PlayerList { public boolean isAllowCheatsForAllPlayers() { return this.allowCheatsForAllPlayers; } @@ -361,7 +375,7 @@ index 2dbe8b870fd39b4d22e9725912f443757ae70761..8388c2a56cbe531cf5f60a18866c85fa } // Water Animals diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java -index c02c51f824be1173d24b20394b5855fc857fc0a4..8b19b4c7d3d14d57a2eb3674b63ff352b0fe83bd 100644 +index d739f8b96caea228335543f412546d187c7f246c..904d1fe0bf325c09b67e43bdaa81c902d57b8e26 100644 --- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java +++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java @@ -8,6 +8,9 @@ import org.bukkit.command.Command; diff --git a/patches/server/0016-No-chat-sign.patch b/patches/server/0016-No-chat-sign.patch index 923abcca..25c24fed 100644 --- a/patches/server/0016-No-chat-sign.patch +++ b/patches/server/0016-No-chat-sign.patch @@ -155,10 +155,10 @@ index 3c0651fa5a5db880202c9a3805a6455269c5f16d..434e5e1fd280dc5b1bd29fc2a196ce0b if (packet == null || this.processedDisconnect) { // Spigot return; diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 5ec8999aa305f614b605d7e858d9e817b1830735..1cdf89c196f34b0036e14c3e445e67306cb026a5 100644 +index c64c53075efdefc5bb845f954de87c3f3f9d3fcf..bdf17bce2b4c0a2c64abefcc82a6e9690f96d186 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -1459,7 +1459,7 @@ public abstract class PlayerList { +@@ -1466,7 +1466,7 @@ public abstract class PlayerList { } public boolean verifyChatTrusted(PlayerChatMessage message) { // Paper - private -> public diff --git a/patches/server/0043-BBOR-Protocol.patch b/patches/server/0043-BBOR-Protocol.patch index ce3de48a..efa3698b 100644 --- a/patches/server/0043-BBOR-Protocol.patch +++ b/patches/server/0043-BBOR-Protocol.patch @@ -5,7 +5,7 @@ Subject: [PATCH] BBOR Protocol diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 8f2d2e27a4296d6cb5f1fe4ff83781d81b9331a2..9e68a0da8be6483319e070d4641eab85c75a38a1 100644 +index 745ab8b97e6bf3e9a1621558883711eab25f8725..8150ac9c98a30afff5fc04fdec8af6d340c4b9f5 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -1602,6 +1602,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { // Paper - Ensure main @@ -1730,7 +1730,7 @@ index f76142b61dc44ebf6312a3027fa9b66ff2a37653..916c159fdd3d9e7300d0a50adbc31ec8 int numSaved = 0; long now = MinecraftServer.currentTick; for (int i = 0; i < this.players.size(); ++i) { -@@ -1429,7 +1427,6 @@ public abstract class PlayerList { +@@ -1436,7 +1434,6 @@ public abstract class PlayerList { } // Paper end }