From b8692e23d26a59cac83d3acb835902fa2edee7ab Mon Sep 17 00:00:00 2001 From: Helvetica Volubi Date: Thu, 4 Jun 2026 14:56:05 +0800 Subject: [PATCH] [ci skip]remove some import in patches --- .../features/0030-Leaves-Fakeplayer.patch | 46 ++++++------------- .../features/0031-Leaves-Replay-Mod-API.patch | 18 ++++---- ...eaves-Catch-update-suppression-crash.patch | 4 +- .../features/0043-Carpet-features.patch | 8 ++-- 4 files changed, 29 insertions(+), 47 deletions(-) diff --git a/lophine-server/minecraft-patches/features/0030-Leaves-Fakeplayer.patch b/lophine-server/minecraft-patches/features/0030-Leaves-Fakeplayer.patch index a91ea51..cd26744 100644 --- a/lophine-server/minecraft-patches/features/0030-Leaves-Fakeplayer.patch +++ b/lophine-server/minecraft-patches/features/0030-Leaves-Fakeplayer.patch @@ -309,19 +309,10 @@ index 049339ae33569d627d2a00ef6cab9cad02c4c014..e05705884a285143b8a3ebad00cb489e ServerLevel.this.updateSleepingPlayerList(); } diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java -index f3afab1100a35cc9ab091944de93d1f30ef040a7..7f6d4118ede7e02fdea8961fd736d00ce41c64bb 100644 +index f3afab1100a35cc9ab091944de93d1f30ef040a7..423652d0ccef5c6a3b93480401c3d0f672bbf8a5 100644 --- a/net/minecraft/server/level/ServerPlayer.java +++ b/net/minecraft/server/level/ServerPlayer.java -@@ -23,6 +23,8 @@ import java.util.Set; - import java.util.UUID; - import java.util.concurrent.CompletableFuture; - import java.util.stream.Collectors; -+ -+import fun.bm.lophine.config.modules.function.FakeplayerConfig; - import net.minecraft.ChatFormatting; - import net.minecraft.CrashReport; - import net.minecraft.CrashReportCategory; -@@ -229,7 +231,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc +@@ -229,7 +229,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc private static final boolean DEFAULT_SPAWN_EXTRA_PARTICLES_ON_FALL = false; public ServerGamePacketListenerImpl connection; private final MinecraftServer server; @@ -330,7 +321,7 @@ index f3afab1100a35cc9ab091944de93d1f30ef040a7..7f6d4118ede7e02fdea8961fd736d00c private final PlayerAdvancements advancements; private final ServerStatsCounter stats; private float lastRecordedHealthAndAbsorption = Float.MIN_VALUE; -@@ -250,7 +252,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc +@@ -250,7 +250,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc private @Nullable Entity camera; public boolean isChangingDimension; public boolean seenCredits = false; @@ -339,7 +330,7 @@ index f3afab1100a35cc9ab091944de93d1f30ef040a7..7f6d4118ede7e02fdea8961fd736d00c private @Nullable Vec3 levitationStartPos; private int levitationStartTime; private boolean disconnected; -@@ -1514,7 +1516,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc +@@ -1514,7 +1514,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc } // Luminol End - Cross Region Damage trace @@ -348,12 +339,12 @@ index f3afab1100a35cc9ab091944de93d1f30ef040a7..7f6d4118ede7e02fdea8961fd736d00c AABB aabb = new AABB(this.blockPosition()).inflate(32.0, 10.0, 32.0); this.level() .getEntitiesOfClass(Mob.class, aabb, EntitySelector.NO_SPECTATORS) -@@ -2180,6 +2182,11 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc +@@ -2180,6 +2180,11 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc this.lastSentHealth = -1.0F; this.lastSentFood = -1; this.teleportSpectators(transition, oldLevel); + // Leaves start - bot support -+ if (FakeplayerConfig.enable) { ++ if (fun.bm.lophine.config.modules.function.FakeplayerConfig.enable) { + this.server.getBotList().bots.forEach(bot -> bot.sendFakeDataIfNeed(this, true)); // Leaves - render bot + } + // Leaves end - bot support @@ -426,24 +417,15 @@ index 484714beb5f7cdf8178834c5edd4f847fb06ebb8..ba7a280aad07f36366c15cd158b36ca9 // Paper start - utility method for common conversion back to the game profile diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java -index ebd2f2887780d9c6c3c44983bac23eab732cf43f..4edc952087c3255ca488b140402621bbf6495770 100644 +index ebd2f2887780d9c6c3c44983bac23eab732cf43f..14be3d21cc1a613b1d9164ecc699073f0da2047c 100644 --- a/net/minecraft/server/players/PlayerList.java +++ b/net/minecraft/server/players/PlayerList.java -@@ -22,6 +22,8 @@ import java.util.Set; - import java.util.UUID; - import java.util.function.Function; - import java.util.function.Predicate; -+ -+import fun.bm.lophine.config.modules.function.FakeplayerConfig; - import net.minecraft.ChatFormatting; - import net.minecraft.commands.CommandSourceStack; - import net.minecraft.core.BlockPos; -@@ -319,6 +321,19 @@ public abstract class PlayerList { +@@ -319,6 +319,19 @@ public abstract class PlayerList { org.leavesmc.leaves.protocol.core.LeavesProtocolManager.handlePlayerJoin(player); // Leaves - protocol + // Leaves start - bot support -+ if (FakeplayerConfig.enable) { ++ if (fun.bm.lophine.config.modules.function.FakeplayerConfig.enable) { + org.leavesmc.leaves.bot.ServerBot bot = this.server.getBotList().getBotByName(player.getScoreboardName()); + if (bot != null) { + this.server.getBotList().removeBot(bot, org.leavesmc.leaves.event.bot.BotRemoveEvent.RemoveReason.INTERNAL, player.getBukkitEntity(), false, false); @@ -458,19 +440,19 @@ index ebd2f2887780d9c6c3c44983bac23eab732cf43f..4edc952087c3255ca488b140402621bb final net.kyori.adventure.text.Component jm = playerJoinEvent.joinMessage(); if (jm != null && !jm.equals(net.kyori.adventure.text.Component.empty())) { // Paper - Adventure -@@ -791,6 +806,11 @@ public abstract class PlayerList { +@@ -791,6 +804,11 @@ public abstract class PlayerList { respawnReason ).callEvent(); // Paper end + // Leaves start - bot support -+ if (FakeplayerConfig.enable) { ++ if (fun.bm.lophine.config.modules.function.FakeplayerConfig.enable) { + this.server.getBotList().bots.forEach(bot -> bot.sendFakeDataIfNeed(player, true)); // Leaves - render bot + } + // Leaves end - bot support return player; } -@@ -893,11 +913,16 @@ public abstract class PlayerList { +@@ -893,11 +911,16 @@ public abstract class PlayerList { public String[] getPlayerNamesArray() { List players = new java.util.ArrayList<>(this.players); // Folia - region threading @@ -488,7 +470,7 @@ index ebd2f2887780d9c6c3c44983bac23eab732cf43f..4edc952087c3255ca488b140402621bb return names; } -@@ -1016,8 +1041,15 @@ public abstract class PlayerList { +@@ -1016,8 +1039,15 @@ public abstract class PlayerList { || this.allowCommandsForAllPlayers; } @@ -506,7 +488,7 @@ index ebd2f2887780d9c6c3c44983bac23eab732cf43f..4edc952087c3255ca488b140402621bb } public void broadcast( -@@ -1360,7 +1392,13 @@ public abstract class PlayerList { +@@ -1360,7 +1390,13 @@ public abstract class PlayerList { } public @Nullable ServerPlayer getPlayer(final UUID uuid) { diff --git a/lophine-server/minecraft-patches/features/0031-Leaves-Replay-Mod-API.patch b/lophine-server/minecraft-patches/features/0031-Leaves-Replay-Mod-API.patch index 6073e36..ec2a38b 100644 --- a/lophine-server/minecraft-patches/features/0031-Leaves-Replay-Mod-API.patch +++ b/lophine-server/minecraft-patches/features/0031-Leaves-Replay-Mod-API.patch @@ -307,10 +307,10 @@ index e05705884a285143b8a3ebad00cb489efe47d532..c51b0075cd650085cd991bc89396f605 } // Leaves end - skip diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java -index 4edc952087c3255ca488b140402621bbf6495770..a39480a7cd19074daf93accb1f9e7c41e33e775c 100644 +index 14be3d21cc1a613b1d9164ecc699073f0da2047c..9fa7d9ae8c4c4d408a98c8a2425569f9777c0fca 100644 --- a/net/minecraft/server/players/PlayerList.java +++ b/net/minecraft/server/players/PlayerList.java -@@ -132,6 +132,7 @@ public abstract class PlayerList { +@@ -130,6 +130,7 @@ public abstract class PlayerList { private int simulationDistance; private boolean allowCommandsForAllPlayers; private int sendAllPlayerInfoIn; @@ -318,7 +318,7 @@ index 4edc952087c3255ca488b140402621bbf6495770..a39480a7cd19074daf93accb1f9e7c41 // CraftBukkit start private org.bukkit.craftbukkit.CraftServer cserver; -@@ -193,6 +194,7 @@ public abstract class PlayerList { +@@ -191,6 +192,7 @@ public abstract class PlayerList { private boolean countConnection(Connection conn, int limit) { synchronized (this.connectionsStateLock) { @@ -326,7 +326,7 @@ index 4edc952087c3255ca488b140402621bbf6495770..a39480a7cd19074daf93accb1f9e7c41 int count = this.usersCountedAgainstLimit.size(); if (count >= limit) { return false; -@@ -223,6 +225,124 @@ public abstract class PlayerList { +@@ -221,6 +223,124 @@ public abstract class PlayerList { abstract public void loadAndSaveFiles(); // Paper - fix converting txt to json file; moved from DedicatedPlayerList constructor @@ -451,7 +451,7 @@ index 4edc952087c3255ca488b140402621bbf6495770..a39480a7cd19074daf93accb1f9e7c41 public void placeNewPlayer(final Connection connection, final ServerPlayer player, final CommonListenerCookie cookie) { player.isRealPlayer = true; // Paper player.loginTime = System.currentTimeMillis(); // Paper - Replace OfflinePlayer#getLastPlayed -@@ -296,6 +416,7 @@ public abstract class PlayerList { +@@ -294,6 +414,7 @@ public abstract class PlayerList { // player.connection.send(ClientboundPlayerInfoUpdatePacket.createPlayerInitializing(this.players)); // CraftBukkit - replaced with loop below this.players.add(player); @@ -459,7 +459,7 @@ index 4edc952087c3255ca488b140402621bbf6495770..a39480a7cd19074daf93accb1f9e7c41 this.playersByName.put(player.getScoreboardName().toLowerCase(java.util.Locale.ROOT), player); // Spigot this.playersByUUID.put(player.getUUID(), player); // this.broadcastAll(ClientboundPlayerInfoUpdatePacket.createPlayerInitializing(List.of(player))); // CraftBukkit - replaced with loop below -@@ -515,6 +636,7 @@ public abstract class PlayerList { +@@ -513,6 +634,7 @@ public abstract class PlayerList { } protected void save(final ServerPlayer player) { @@ -467,7 +467,7 @@ index 4edc952087c3255ca488b140402621bbf6495770..a39480a7cd19074daf93accb1f9e7c41 if (!player.getBukkitEntity().isPersistent()) return; // CraftBukkit player.lastSave = System.nanoTime(); // Folia - region threading - changed to nanoTime tracking this.playerIo.save(player); -@@ -529,6 +651,47 @@ public abstract class PlayerList { +@@ -527,6 +649,47 @@ public abstract class PlayerList { } } @@ -515,7 +515,7 @@ index 4edc952087c3255ca488b140402621bbf6495770..a39480a7cd19074daf93accb1f9e7c41 public net.kyori.adventure.text.@Nullable Component remove(final ServerPlayer player) { // CraftBukkit - return string // Paper - return Component // Paper start - Fix kick event leave message not being sent return this.remove(player, net.kyori.adventure.text.Component.translatable("multiplayer.player.left", net.kyori.adventure.text.format.NamedTextColor.YELLOW, io.papermc.paper.configuration.GlobalConfiguration.get().messages.useDisplayNameInQuitMessage ? player.getBukkitEntity().displayName() : io.papermc.paper.adventure.PaperAdventure.asAdventure(player.getDisplayName()))); -@@ -602,6 +765,7 @@ public abstract class PlayerList { +@@ -600,6 +763,7 @@ public abstract class PlayerList { player.getBukkitEntity().packetProcessor.close(); // Folia - region threading player.getAdvancements().stopListening(); this.players.remove(player); @@ -523,7 +523,7 @@ index 4edc952087c3255ca488b140402621bbf6495770..a39480a7cd19074daf93accb1f9e7c41 this.playersByName.remove(player.getScoreboardName().toLowerCase(java.util.Locale.ROOT)); // Spigot this.server.getCustomBossEvents().onPlayerDisconnect(player); UUID uuid = player.getUUID(); -@@ -912,15 +1076,15 @@ public abstract class PlayerList { +@@ -910,15 +1074,15 @@ public abstract class PlayerList { } public String[] getPlayerNamesArray() { diff --git a/lophine-server/minecraft-patches/features/0035-Leaves-Catch-update-suppression-crash.patch b/lophine-server/minecraft-patches/features/0035-Leaves-Catch-update-suppression-crash.patch index a9cba66..417ddda 100644 --- a/lophine-server/minecraft-patches/features/0035-Leaves-Catch-update-suppression-crash.patch +++ b/lophine-server/minecraft-patches/features/0035-Leaves-Catch-update-suppression-crash.patch @@ -88,10 +88,10 @@ index fe9c292ec4b550d8456eb6d1f0dbf6bc1dd47c54..f44f772628f5705c5dee9cb92295362b } } diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java -index 7f6d4118ede7e02fdea8961fd736d00ce41c64bb..91ec7f6b751159f2935165268166f44d27579426 100644 +index 423652d0ccef5c6a3b93480401c3d0f672bbf8a5..65965089d184695588c74294afb2f5c0b28bbf17 100644 --- a/net/minecraft/server/level/ServerPlayer.java +++ b/net/minecraft/server/level/ServerPlayer.java -@@ -1132,6 +1132,10 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc +@@ -1130,6 +1130,10 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc // Folia - region threading - move to main tick loop where we can detect duplicates // CraftBukkit end diff --git a/lophine-server/minecraft-patches/features/0043-Carpet-features.patch b/lophine-server/minecraft-patches/features/0043-Carpet-features.patch index c799647..e1e3afa 100644 --- a/lophine-server/minecraft-patches/features/0043-Carpet-features.patch +++ b/lophine-server/minecraft-patches/features/0043-Carpet-features.patch @@ -118,10 +118,10 @@ index 1a2b57a100c997b39f8f25ad3da121e04700d5d2..be345feecfa5b4e27a7b8a88ab5a5e5b // Paper start - fix converting txt to json file; moved from constructor } diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java -index 91ec7f6b751159f2935165268166f44d27579426..6e529edc0be2a090f1068384e59817f6a05ba1f9 100644 +index 65965089d184695588c74294afb2f5c0b28bbf17..5ebff729bb7e75e1c84449c0e3021b972ad0d936 100644 --- a/net/minecraft/server/level/ServerPlayer.java +++ b/net/minecraft/server/level/ServerPlayer.java -@@ -259,6 +259,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc +@@ -257,6 +257,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc private int requestedViewDistance = 2; public String language = null; // Paper - default to null public java.util.Locale adventure$locale = java.util.Locale.US; // Paper @@ -129,7 +129,7 @@ index 91ec7f6b751159f2935165268166f44d27579426..6e529edc0be2a090f1068384e59817f6 private @Nullable Vec3 startingToFallPosition; private @Nullable Vec3 enteredNetherPosition; private @Nullable Vec3 enteredLavaOnVehiclePosition; -@@ -2828,6 +2829,9 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc +@@ -2826,6 +2827,9 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc this.setShoulderEntityRight(oldPlayer.getShoulderEntityRight()); this.setLastDeathLocation(oldPlayer.getLastDeathLocation()); this.waypointIcon().copyFrom(oldPlayer.waypointIcon()); @@ -139,7 +139,7 @@ index 91ec7f6b751159f2935165268166f44d27579426..6e529edc0be2a090f1068384e59817f6 } private void transferInventoryXpAndScore(final Player oldPlayer) { -@@ -3111,6 +3115,9 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc +@@ -3109,6 +3113,9 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc this.particleStatus = information.particleStatus(); this.getEntityData().set(DATA_PLAYER_MODE_CUSTOMISATION, (byte)information.modelCustomisation()); this.getEntityData().set(DATA_PLAYER_MAIN_HAND, information.mainHand());