diff --git a/leaf-api/paper-patches/features/0009-Leaves-Replay-Mod-API.patch b/leaf-api/paper-patches/features/0009-Leaves-Replay-Mod-API.patch index e23ed9c1..5a1d8188 100644 --- a/leaf-api/paper-patches/features/0009-Leaves-Replay-Mod-API.patch +++ b/leaf-api/paper-patches/features/0009-Leaves-Replay-Mod-API.patch @@ -11,18 +11,10 @@ Original project: https://github.com/LeavesMC/Leaves This patch is Powered by ReplayMod(https://github.com/ReplayMod) diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index d67af3fdc4434817cea29673069430a33fb30a8e..1e32c10f3e7687cbd55985a2e03f0ab6c5f93b31 100644 +index d67af3fdc4434817cea29673069430a33fb30a8e..c8699e7b186caf0735a888f78ed4b777e1c119fe 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java -@@ -3047,6 +3047,7 @@ public final class Bukkit { - return server.spigot(); - } - -+ - // Purpur start - Bring back server name - /** - * Get the name of this server -@@ -3175,4 +3176,10 @@ public final class Bukkit { +@@ -3175,4 +3175,10 @@ public final class Bukkit { server.clearBlockHighlights(); } // Purpur end - Debug Marker API @@ -34,24 +26,16 @@ index d67af3fdc4434817cea29673069430a33fb30a8e..1e32c10f3e7687cbd55985a2e03f0ab6 + // Leaves end - Photographer API } diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index 6790ca1648a17cf30063522f68b3ac3e82e3bd8c..223f3a4545996073872d1650c9a84feacfd2c493 100644 +index 6790ca1648a17cf30063522f68b3ac3e82e3bd8c..91c6808a6500c3f2e43818a7a30ab5d83d89f539 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -66,6 +66,7 @@ import org.jetbrains.annotations.ApiStatus; - import org.jetbrains.annotations.Contract; - import org.jetbrains.annotations.NotNull; - import org.jetbrains.annotations.Nullable; -+import org.leavesmc.leaves.entity.PhotographerManager; - - /** - * Represents a server implementation. -@@ -2858,4 +2859,8 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi +@@ -2858,4 +2858,8 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi */ void clearBlockHighlights(); // Purpur end - Debug Marker API + + // Leaves start - Photographer API -+ @NotNull PhotographerManager getPhotographerManager(); ++ @NotNull org.leavesmc.leaves.entity.PhotographerManager getPhotographerManager(); + // Leaves end - Photographer API } diff --git a/src/main/java/org/leavesmc/leaves/entity/Photographer.java b/src/main/java/org/leavesmc/leaves/entity/Photographer.java diff --git a/leaf-server/minecraft-patches/features/0025-Leaves-Disable-moved-wrongly-threshold.patch b/leaf-archived-patches/removed/hardfork/server/0025-Leaves-Disable-moved-wrongly-threshold.patch similarity index 97% rename from leaf-server/minecraft-patches/features/0025-Leaves-Disable-moved-wrongly-threshold.patch rename to leaf-archived-patches/removed/hardfork/server/0025-Leaves-Disable-moved-wrongly-threshold.patch index 5c1c5dbe..be082941 100644 --- a/leaf-server/minecraft-patches/features/0025-Leaves-Disable-moved-wrongly-threshold.patch +++ b/leaf-archived-patches/removed/hardfork/server/0025-Leaves-Disable-moved-wrongly-threshold.patch @@ -3,6 +3,9 @@ From: violetc <58360096+s-yh-china@users.noreply.github.com> Date: Thu, 28 Sep 2023 20:30:46 +0800 Subject: [PATCH] Leaves: Disable moved wrongly threshold +Removed since MC 1.21.4, Mojang added it as gamerule, +use `/gamerule disablePlayerMovementCheck` instead + Original license: GPLv3 Original project: https://github.com/LeavesMC/Leaves diff --git a/leaf-server/minecraft-patches/features/0020-Leaves-Protocol-Core.patch b/leaf-server/minecraft-patches/features/0020-Leaves-Protocol-Core.patch index 5d64f9da..20285061 100644 --- a/leaf-server/minecraft-patches/features/0020-Leaves-Protocol-Core.patch +++ b/leaf-server/minecraft-patches/features/0020-Leaves-Protocol-Core.patch @@ -9,10 +9,10 @@ and change store way to sql maybe? Original license: GPLv3 Original project: https://github.com/LeavesMC/Leaves -Commit: 0O0oO00o0oO +Commit: f07c26c892bc919de82ee0c90ccd5bdca41f20ed diff --git a/net/minecraft/network/protocol/common/custom/CustomPacketPayload.java b/net/minecraft/network/protocol/common/custom/CustomPacketPayload.java -index fb263fa1f30a7dfcb7ec2656abfb38e5fe88eac9..96ec0a0133ec244a5eb79dfcb34e7f9de22ea0f4 100644 +index fb263fa1f30a7dfcb7ec2656abfb38e5fe88eac9..7e19dfe90a63ff26f03b95891dacb7360bba5a3c 100644 --- a/net/minecraft/network/protocol/common/custom/CustomPacketPayload.java +++ b/net/minecraft/network/protocol/common/custom/CustomPacketPayload.java @@ -40,13 +40,23 @@ public interface CustomPacketPayload { @@ -20,9 +20,9 @@ index fb263fa1f30a7dfcb7ec2656abfb38e5fe88eac9..96ec0a0133ec244a5eb79dfcb34e7f9d @Override public void encode(B buffer, CustomPacketPayload value) { + // Leaves start - protocol core -+ if (value instanceof org.leavesmc.leaves.protocol.core.LeavesCustomPayload leavesCustomPayload) { -+ buffer.writeResourceLocation(leavesCustomPayload.id()); -+ leavesCustomPayload.write(buffer); ++ if (value instanceof org.leavesmc.leaves.protocol.core.LeavesCustomPayload payload) { ++ buffer.writeResourceLocation(payload.id()); ++ payload.write(buffer); + return; + } + // Leaves end - protocol core @@ -34,25 +34,12 @@ index fb263fa1f30a7dfcb7ec2656abfb38e5fe88eac9..96ec0a0133ec244a5eb79dfcb34e7f9d ResourceLocation resourceLocation = buffer.readResourceLocation(); - return (CustomPacketPayload)this.findCodec(resourceLocation).decode(buffer); + // Leaves start - protocol core -+ var leavesCustomPayload = org.leavesmc.leaves.protocol.core.LeavesProtocolManager.decode(resourceLocation, buffer); -+ return java.util.Objects.requireNonNullElseGet(leavesCustomPayload, () -> this.findCodec(resourceLocation).decode(buffer)); ++ var payload = org.leavesmc.leaves.protocol.core.LeavesProtocolManager.decode(resourceLocation, buffer); ++ return java.util.Objects.requireNonNullElseGet(payload, () -> this.findCodec(resourceLocation).decode(buffer)); + // Leaves end - protocol core } }; } -diff --git a/net/minecraft/resources/ResourceLocation.java b/net/minecraft/resources/ResourceLocation.java -index ea8cfa76093c70a44d065c1f80adaa9127fe4e07..7435e2c3f0defe98cbaa488219974887ee572c57 100644 ---- a/net/minecraft/resources/ResourceLocation.java -+++ b/net/minecraft/resources/ResourceLocation.java -@@ -36,7 +36,7 @@ public final class ResourceLocation implements Comparable { - private final String namespace; - private final String path; - -- private ResourceLocation(String namespace, String path) { -+ public ResourceLocation(String namespace, String path) { // Leaves - private -> public - assert isValidNamespace(namespace); - - assert isValidPath(path); diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java index 047a09cf4a2c32e714aacedeccb0928ef2c7dfa9..dddbb18992348fb7e8a6552423d134809cd7fdbc 100644 --- a/net/minecraft/server/MinecraftServer.java @@ -91,7 +78,7 @@ index de115ee71fa240440b54c553e0d3ddaf4c0dfca0..ee8cdd532b73180cb484fcc37c36f09c } catch (Exception ex) { ServerGamePacketListenerImpl.LOGGER.error("Couldn't register custom payload", ex); diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java -index d2c11832d3ff9b01ccc3cdd5f77673eb7a844dae..0e81a445a4f960eab5c873bc16f79a9ebfab0122 100644 +index ef189bdd6c52c3f062774a6e9ae73a186d1d8346..924faf76763588fb41b8aee53236ccb05b1239b1 100644 --- a/net/minecraft/server/players/PlayerList.java +++ b/net/minecraft/server/players/PlayerList.java @@ -341,6 +341,8 @@ public abstract class PlayerList { diff --git a/leaf-server/minecraft-patches/features/0024-Leaves-Replay-Mod-API.patch b/leaf-server/minecraft-patches/features/0024-Leaves-Replay-Mod-API.patch index 7d86a187..c23b7e59 100644 --- a/leaf-server/minecraft-patches/features/0024-Leaves-Replay-Mod-API.patch +++ b/leaf-server/minecraft-patches/features/0024-Leaves-Replay-Mod-API.patch @@ -11,51 +11,20 @@ Original project: https://github.com/LeavesMC/Leaves This patch is Powered by ReplayMod(https://github.com/ReplayMod) diff --git a/net/minecraft/commands/CommandSourceStack.java b/net/minecraft/commands/CommandSourceStack.java -index 59c70c567051bc7dba0d308387352d1b15f3c842..6c13bf624bbb1af62f879ea08b72346a9932d75e 100644 +index 59c70c567051bc7dba0d308387352d1b15f3c842..e654387167cf3e9a88f0e62be940fe398387cffa 100644 --- a/net/minecraft/commands/CommandSourceStack.java +++ b/net/minecraft/commands/CommandSourceStack.java -@@ -629,6 +629,13 @@ public class CommandSourceStack implements ExecutionCommandSource sourcePlayer.getBukkitEntity().canSee(serverPlayer.getBukkitEntity())).map(serverPlayer -> serverPlayer.getGameProfile().getName()).toList() : Lists.newArrayList(this.server.getPlayerNames()); // Paper - Make CommandSourceStack respect hidden players - } +@@ -626,7 +626,7 @@ public class CommandSourceStack implements ExecutionCommandSource getOnlineRealPlayerNames() { -+ return this.entity instanceof ServerPlayer sourcePlayer && !sourcePlayer.getBukkitEntity().hasPermission("paper.bypass-visibility.tab-completion") ? this.getServer().getPlayerList().getPlayers().stream().filter(serverPlayer -> !(serverPlayer instanceof org.leavesmc.leaves.replay.ServerPhotographer) && sourcePlayer.getBukkitEntity().canSee(serverPlayer.getBukkitEntity())).map(serverPlayer -> serverPlayer.getGameProfile().getName()).toList() : Lists.newArrayList(this.server.getPlayerNames()); // Paper - Make CommandSourceStack respect hidden players -+ } -+ // Leaves end - skip photographer -+ @Override - public Collection getAllTeams() { - return this.server.getScoreboard().getTeamNames(); -diff --git a/net/minecraft/commands/SharedSuggestionProvider.java b/net/minecraft/commands/SharedSuggestionProvider.java -index a2f13a86c635acef24ded974c96a400e1439011d..78e7948dfc99dda55455e964c3356b6c5002869c 100644 ---- a/net/minecraft/commands/SharedSuggestionProvider.java -+++ b/net/minecraft/commands/SharedSuggestionProvider.java -@@ -29,6 +29,8 @@ public interface SharedSuggestionProvider { - - Collection getOnlinePlayerNames(); - -+ Collection getOnlineRealPlayerNames(); // Leaves - skip photographer -+ - default Collection getCustomTabSugggestions() { - return this.getOnlinePlayerNames(); + public Collection getOnlinePlayerNames() { +- return this.entity instanceof ServerPlayer sourcePlayer && !sourcePlayer.getBukkitEntity().hasPermission("paper.bypass-visibility.tab-completion") ? this.getServer().getPlayerList().getPlayers().stream().filter(serverPlayer -> sourcePlayer.getBukkitEntity().canSee(serverPlayer.getBukkitEntity())).map(serverPlayer -> serverPlayer.getGameProfile().getName()).toList() : Lists.newArrayList(this.server.getPlayerNames()); // Paper - Make CommandSourceStack respect hidden players ++ return this.entity instanceof ServerPlayer sourcePlayer && !(sourcePlayer instanceof org.leavesmc.leaves.replay.ServerPhotographer) && !sourcePlayer.getBukkitEntity().hasPermission("paper.bypass-visibility.tab-completion") ? this.getServer().getPlayerList().getPlayers().stream().filter(serverPlayer -> sourcePlayer.getBukkitEntity().canSee(serverPlayer.getBukkitEntity())).map(serverPlayer -> serverPlayer.getGameProfile().getName()).toList() : Lists.newArrayList(this.server.getPlayerNames()); // Paper - Make CommandSourceStack respect hidden players // Leaves - only real player } -diff --git a/net/minecraft/commands/arguments/EntityArgument.java b/net/minecraft/commands/arguments/EntityArgument.java -index 0a01df6ebd14afe79bc76364cb1df5e0c5c08074..7eea7e3345b889b885e9a118bb23fa08bc237150 100644 ---- a/net/minecraft/commands/arguments/EntityArgument.java -+++ b/net/minecraft/commands/arguments/EntityArgument.java -@@ -149,7 +149,7 @@ public class EntityArgument implements ArgumentType { - return entitySelectorParser.fillSuggestions( - builder, - offsetBuilder -> { -- Collection onlinePlayerNames = sharedSuggestionProvider.getOnlinePlayerNames(); -+ Collection onlinePlayerNames = sharedSuggestionProvider.getOnlineRealPlayerNames(); // Leaves - skip photographer - Iterable iterable = (Iterable)(this.playersOnly - ? onlinePlayerNames - : Iterables.concat(onlinePlayerNames, sharedSuggestionProvider.getSelectedEntities())); + + @Override diff --git a/net/minecraft/commands/arguments/selector/EntitySelector.java b/net/minecraft/commands/arguments/selector/EntitySelector.java -index b305ba9bab617bf4e52d0e6ddf160bacc5751a94..b8215b71971d16705bc11f19343823acf9970a3a 100644 +index b305ba9bab617bf4e52d0e6ddf160bacc5751a94..c9b4f00d5ccde83898ecf69efdbfee7a3f91b96d 100644 --- a/net/minecraft/commands/arguments/selector/EntitySelector.java +++ b/net/minecraft/commands/arguments/selector/EntitySelector.java @@ -128,11 +128,12 @@ public class EntitySelector { @@ -89,7 +58,7 @@ index b305ba9bab617bf4e52d0e6ddf160bacc5751a94..b8215b71971d16705bc11f19343823ac return this.sortAndLimit(vec3, list); } -@@ -192,27 +194,29 @@ public class EntitySelector { +@@ -192,27 +194,30 @@ public class EntitySelector { this.checkPermissions(source); if (this.playerName != null) { ServerPlayer playerByName = source.getServer().getPlayerList().getPlayerByName(this.playerName); @@ -104,8 +73,8 @@ index b305ba9bab617bf4e52d0e6ddf160bacc5751a94..b8215b71971d16705bc11f19343823ac AABB absoluteAabb = this.getAbsoluteAabb(vec3); Predicate predicate = this.getPredicate(vec3, absoluteAabb, null); if (this.currentEntity) { -- return source.getEntity() instanceof ServerPlayer serverPlayer && predicate.test(serverPlayer) && canSee(source, serverPlayer) ? List.of(serverPlayer) : List.of(); // Purpur - Hide hidden players from entity selector -+ return source.getEntity() instanceof ServerPlayer serverPlayer && predicate.test(serverPlayer) && !(serverPlayer instanceof org.leavesmc.leaves.replay.ServerPhotographer) && canSee(source, serverPlayer) ? List.of(serverPlayer) : List.of(); // Purpur - Hide hidden players from entity selector // Leaves - skip photographer ++ //return source.getEntity() instanceof ServerPlayer serverPlayer && predicate.test(serverPlayer) && !(serverPlayer instanceof org.leavesmc.leaves.replay.ServerPhotographer) && canSee(source, serverPlayer) ? List.of(serverPlayer) : List.of(); // Purpur - Hide hidden players from entity selector // Leaves - skip photographer + return source.getEntity() instanceof ServerPlayer serverPlayer && predicate.test(serverPlayer) && canSee(source, serverPlayer) ? List.of(serverPlayer) : List.of(); // Purpur - Hide hidden players from entity selector } else { int resultLimit = this.getResultLimit(); List players; @@ -152,7 +121,7 @@ index 792ba93b531e9586e26aafa00830022a8996fc04..e4ea26ae84efde7ce54e08a246a6ea2a AdvancementProgress orStartProgress = this.getOrStartProgress(advancement); boolean isDone = orStartProgress.isDone(); diff --git a/net/minecraft/server/commands/OpCommand.java b/net/minecraft/server/commands/OpCommand.java -index 5c0a04db38821dbb0cba2bb6f0787f113d167efd..8a071166262fbb7d24735fec394cb19d4dd98096 100644 +index 5c0a04db38821dbb0cba2bb6f0787f113d167efd..cd153db93f709c3142942fac88ae3ca2226a65b3 100644 --- a/net/minecraft/server/commands/OpCommand.java +++ b/net/minecraft/server/commands/OpCommand.java @@ -25,7 +25,7 @@ public class OpCommand { @@ -160,7 +129,7 @@ index 5c0a04db38821dbb0cba2bb6f0787f113d167efd..8a071166262fbb7d24735fec394cb19d PlayerList playerList = context.getSource().getServer().getPlayerList(); return SharedSuggestionProvider.suggest( - playerList.getPlayers() -+ playerList.realPlayers // Leaves - skip ++ playerList.realPlayers // Leaves - only real player .stream() .filter(player -> !playerList.isOp(player.getGameProfile())) .map(player -> player.getGameProfile().getName()), @@ -222,7 +191,7 @@ index 622257dbbe572de33e15abef9055016268730261..dfb4524d80f642eff1b146dd2fbfa07f private final ServerStatsCounter stats; private float lastRecordedHealthAndAbsorption = Float.MIN_VALUE; diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java -index 03bf654aaf1b4f7df9608ee1ad99230f7aa507f9..8893be00aa731d26a41b5e6b3996425eced33cc4 100644 +index e3d09d5f4efb32bb276e001e5ee747a775b502ee..86ce80765eb7645533806f730b15557f8ea6a9a2 100644 --- a/net/minecraft/server/players/PlayerList.java +++ b/net/minecraft/server/players/PlayerList.java @@ -132,6 +132,7 @@ public abstract class PlayerList { @@ -233,12 +202,12 @@ index 03bf654aaf1b4f7df9608ee1ad99230f7aa507f9..8893be00aa731d26a41b5e6b3996425e // CraftBukkit start private org.bukkit.craftbukkit.CraftServer cserver; -@@ -150,6 +151,105 @@ public abstract class PlayerList { +@@ -150,6 +151,106 @@ public abstract class PlayerList { abstract public void loadAndSaveFiles(); // Paper - fix converting txt to json file; moved from DedicatedPlayerList constructor + // Leaves start - replay api -+ public void placeNewPhotographer(Connection connection, org.leavesmc.leaves.replay.ServerPhotographer player, ServerLevel worldserver, org.bukkit.Location location) { ++ public void placeNewPhotographer(Connection connection, org.leavesmc.leaves.replay.ServerPhotographer player, ServerLevel worldserver) { + player.isRealPlayer = true; // Paper + player.loginTime = System.currentTimeMillis(); // Paper + @@ -264,6 +233,7 @@ index 03bf654aaf1b4f7df9608ee1ad99230f7aa507f9..8893be00aa731d26a41b5e6b3996425e + playerconnection.send(new ClientboundSetHeldSlotPacket(player.getInventory().selected)); + RecipeManager craftingmanager = this.server.getRecipeManager(); + playerconnection.send(new ClientboundUpdateRecipesPacket(craftingmanager.getSynchronizedItemProperties(), craftingmanager.getSynchronizedStonecutterRecipes())); ++ + this.sendPlayerPermissionLevel(player); + player.getStats().markAllDirty(); + player.getRecipeBook().sendInitialRecipeBook(player); @@ -339,7 +309,7 @@ index 03bf654aaf1b4f7df9608ee1ad99230f7aa507f9..8893be00aa731d26a41b5e6b3996425e public void placeNewPlayer(Connection connection, ServerPlayer player, CommonListenerCookie cookie) { player.isRealPlayer = true; // Paper player.loginTime = System.currentTimeMillis(); // Paper - Replace OfflinePlayer#getLastPlayed -@@ -315,6 +415,7 @@ public abstract class PlayerList { +@@ -315,6 +416,7 @@ public abstract class PlayerList { // player.connection.send(ClientboundPlayerInfoUpdatePacket.createPlayerInitializing(this.players)); // CraftBukkit - replaced with loop below this.players.add(player); @@ -347,7 +317,7 @@ index 03bf654aaf1b4f7df9608ee1ad99230f7aa507f9..8893be00aa731d26a41b5e6b3996425e this.playersByName.put(player.getScoreboardName().toLowerCase(java.util.Locale.ROOT), player); // Spigot this.playersByUUID.put(player.getUUID(), player); this.addToSendAllPlayerInfoBuckets(player); // Gale - Purpur - spread out sending all player info -@@ -374,6 +475,12 @@ public abstract class PlayerList { +@@ -374,6 +476,12 @@ public abstract class PlayerList { continue; } @@ -360,7 +330,7 @@ index 03bf654aaf1b4f7df9608ee1ad99230f7aa507f9..8893be00aa731d26a41b5e6b3996425e onlinePlayers.add(entityplayer1); // Paper - Use single player info update packet on join } // Paper start - Use single player info update packet on join -@@ -515,6 +622,43 @@ public abstract class PlayerList { +@@ -515,6 +623,43 @@ public abstract class PlayerList { } } @@ -404,7 +374,7 @@ index 03bf654aaf1b4f7df9608ee1ad99230f7aa507f9..8893be00aa731d26a41b5e6b3996425e public net.kyori.adventure.text.Component remove(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()))); -@@ -591,6 +735,7 @@ public abstract class PlayerList { +@@ -591,6 +736,7 @@ public abstract class PlayerList { player.retireScheduler(); // Paper - Folia schedulers player.getAdvancements().stopListening(); this.players.remove(player); @@ -412,7 +382,7 @@ index 03bf654aaf1b4f7df9608ee1ad99230f7aa507f9..8893be00aa731d26a41b5e6b3996425e this.playersByName.remove(player.getScoreboardName().toLowerCase(java.util.Locale.ROOT)); // Spigot this.removeFromSendAllPlayerInfoBuckets(player); // Gale - Purpur - spread out sending all player info this.server.getCustomBossEvents().onPlayerDisconnect(player); -@@ -688,7 +833,7 @@ public abstract class PlayerList { +@@ -688,7 +834,7 @@ public abstract class PlayerList { // return this.players.size() >= this.maxPlayers && !this.canBypassPlayerLimit(gameProfile) // ? Component.translatable("multiplayer.disconnect.server_full") // : null; diff --git a/leaf-server/minecraft-patches/features/0026-Petal-Async-Pathfinding.patch b/leaf-server/minecraft-patches/features/0025-Petal-Async-Pathfinding.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0026-Petal-Async-Pathfinding.patch rename to leaf-server/minecraft-patches/features/0025-Petal-Async-Pathfinding.patch diff --git a/leaf-server/minecraft-patches/features/0027-Petal-reduce-work-done-by-game-event-system.patch b/leaf-server/minecraft-patches/features/0026-Petal-reduce-work-done-by-game-event-system.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0027-Petal-reduce-work-done-by-game-event-system.patch rename to leaf-server/minecraft-patches/features/0026-Petal-reduce-work-done-by-game-event-system.patch diff --git a/leaf-server/minecraft-patches/features/0028-Reduce-canSee-work.patch b/leaf-server/minecraft-patches/features/0027-Reduce-canSee-work.patch similarity index 95% rename from leaf-server/minecraft-patches/features/0028-Reduce-canSee-work.patch rename to leaf-server/minecraft-patches/features/0027-Reduce-canSee-work.patch index 7a0af77a..0896647f 100644 --- a/leaf-server/minecraft-patches/features/0028-Reduce-canSee-work.patch +++ b/leaf-server/minecraft-patches/features/0027-Reduce-canSee-work.patch @@ -7,7 +7,7 @@ Co-authored by: Martijn Muijsers Co-authored by: MachineBreaker diff --git a/net/minecraft/world/level/Level.java b/net/minecraft/world/level/Level.java -index 78654e7ae26c0b2b2512f4e29a331e2ead2d6916..13edbcdabc159e3694e7dbe824ccb5bb447fe788 100644 +index 98cb62d4b79c0918abe139f198c5be118b9133c4..b39d67ab9ed446885111a5387d3332c36b4f3cc9 100644 --- a/net/minecraft/world/level/Level.java +++ b/net/minecraft/world/level/Level.java @@ -1006,17 +1006,19 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl diff --git a/leaf-server/minecraft-patches/features/0029-Fix-sprint-glitch.patch b/leaf-server/minecraft-patches/features/0028-Fix-sprint-glitch.patch similarity index 90% rename from leaf-server/minecraft-patches/features/0029-Fix-sprint-glitch.patch rename to leaf-server/minecraft-patches/features/0028-Fix-sprint-glitch.patch index 27dea9e2..caf10d51 100644 --- a/leaf-server/minecraft-patches/features/0029-Fix-sprint-glitch.patch +++ b/leaf-server/minecraft-patches/features/0028-Fix-sprint-glitch.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Fix sprint glitch diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java -index 9f36d063168c262fec7e69a96bad375b4eaff797..d7bb99b6d0a5818ccd68aa361c77a8733023f1ea 100644 +index 4fb6102c8ef930de80356c66397ca2167b1d0174..c7f58236400dbb9d26cf4a5b83b3a9202b10471d 100644 --- a/net/minecraft/world/entity/LivingEntity.java +++ b/net/minecraft/world/entity/LivingEntity.java @@ -1379,7 +1379,8 @@ public abstract class LivingEntity extends Entity implements Attackable { diff --git a/leaf-server/minecraft-patches/features/0030-Configurable-movement-speed-of-more-entities.patch b/leaf-server/minecraft-patches/features/0029-Configurable-movement-speed-of-more-entities.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0030-Configurable-movement-speed-of-more-entities.patch rename to leaf-server/minecraft-patches/features/0029-Configurable-movement-speed-of-more-entities.patch diff --git a/leaf-server/minecraft-patches/features/0031-Faster-sequencing-of-futures-for-chunk-structure-gen.patch b/leaf-server/minecraft-patches/features/0030-Faster-sequencing-of-futures-for-chunk-structure-gen.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0031-Faster-sequencing-of-futures-for-chunk-structure-gen.patch rename to leaf-server/minecraft-patches/features/0030-Faster-sequencing-of-futures-for-chunk-structure-gen.patch diff --git a/leaf-server/minecraft-patches/features/0032-Reduce-active-items-finding-hopper-nearby-check.patch b/leaf-server/minecraft-patches/features/0031-Reduce-active-items-finding-hopper-nearby-check.patch similarity index 94% rename from leaf-server/minecraft-patches/features/0032-Reduce-active-items-finding-hopper-nearby-check.patch rename to leaf-server/minecraft-patches/features/0031-Reduce-active-items-finding-hopper-nearby-check.patch index c219f8e7..a6298b8f 100644 --- a/leaf-server/minecraft-patches/features/0032-Reduce-active-items-finding-hopper-nearby-check.patch +++ b/leaf-server/minecraft-patches/features/0031-Reduce-active-items-finding-hopper-nearby-check.patch @@ -9,7 +9,7 @@ But still recommend to turn-off `checkForMinecartNearItemWhileActive` Since `Reduce-hopper-item-checks.patch` will cause lag under massive dropped items diff --git a/net/minecraft/world/entity/item/ItemEntity.java b/net/minecraft/world/entity/item/ItemEntity.java -index 0e21c644d62597cf3425c8717ab1e70c766e22f2..3fbdb1cdb2c69340cbca6b154cdb7eae95f6391f 100644 +index 6436afc0e59a8efdc9551fdde4d03d245548f3ef..280d9d5a23f5fc8560ca8eeb4f3652ea9c1505b2 100644 --- a/net/minecraft/world/entity/item/ItemEntity.java +++ b/net/minecraft/world/entity/item/ItemEntity.java @@ -241,7 +241,11 @@ public class ItemEntity extends Entity implements TraceableEntity { diff --git a/leaf-server/minecraft-patches/features/0033-Linear-region-file-format.patch b/leaf-server/minecraft-patches/features/0032-Linear-region-file-format.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0033-Linear-region-file-format.patch rename to leaf-server/minecraft-patches/features/0032-Linear-region-file-format.patch diff --git a/leaf-server/minecraft-patches/features/0034-Plazma-Add-some-missing-Pufferfish-configurations.patch b/leaf-server/minecraft-patches/features/0033-Plazma-Add-some-missing-Pufferfish-configurations.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0034-Plazma-Add-some-missing-Pufferfish-configurations.patch rename to leaf-server/minecraft-patches/features/0033-Plazma-Add-some-missing-Pufferfish-configurations.patch diff --git a/leaf-server/minecraft-patches/features/0035-Plazma-Add-missing-purpur-configuration-options.patch b/leaf-server/minecraft-patches/features/0034-Plazma-Add-missing-purpur-configuration-options.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0035-Plazma-Add-missing-purpur-configuration-options.patch rename to leaf-server/minecraft-patches/features/0034-Plazma-Add-missing-purpur-configuration-options.patch diff --git a/leaf-server/minecraft-patches/features/0036-SparklyPaper-Skip-distanceToSqr-call-in-ServerEntity.patch b/leaf-server/minecraft-patches/features/0035-SparklyPaper-Skip-distanceToSqr-call-in-ServerEntity.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0036-SparklyPaper-Skip-distanceToSqr-call-in-ServerEntity.patch rename to leaf-server/minecraft-patches/features/0035-SparklyPaper-Skip-distanceToSqr-call-in-ServerEntity.patch diff --git a/leaf-server/minecraft-patches/features/0037-SparklyPaper-Skip-MapItem-update-if-the-map-does-not.patch b/leaf-server/minecraft-patches/features/0036-SparklyPaper-Skip-MapItem-update-if-the-map-does-not.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0037-SparklyPaper-Skip-MapItem-update-if-the-map-does-not.patch rename to leaf-server/minecraft-patches/features/0036-SparklyPaper-Skip-MapItem-update-if-the-map-does-not.patch diff --git a/leaf-server/minecraft-patches/features/0038-SparklyPaper-Skip-EntityScheduler-s-executeTick-chec.patch b/leaf-server/minecraft-patches/features/0037-SparklyPaper-Skip-EntityScheduler-s-executeTick-chec.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0038-SparklyPaper-Skip-EntityScheduler-s-executeTick-chec.patch rename to leaf-server/minecraft-patches/features/0037-SparklyPaper-Skip-EntityScheduler-s-executeTick-chec.patch diff --git a/leaf-server/minecraft-patches/features/0039-SparklyPaper-Optimize-canSee-checks.patch b/leaf-server/minecraft-patches/features/0038-SparklyPaper-Optimize-canSee-checks.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0039-SparklyPaper-Optimize-canSee-checks.patch rename to leaf-server/minecraft-patches/features/0038-SparklyPaper-Optimize-canSee-checks.patch diff --git a/leaf-server/minecraft-patches/features/0040-SparklyPaper-Allow-throttling-hopper-checks-if-the-t.patch b/leaf-server/minecraft-patches/features/0039-SparklyPaper-Allow-throttling-hopper-checks-if-the-t.patch similarity index 93% rename from leaf-server/minecraft-patches/features/0040-SparklyPaper-Allow-throttling-hopper-checks-if-the-t.patch rename to leaf-server/minecraft-patches/features/0039-SparklyPaper-Allow-throttling-hopper-checks-if-the-t.patch index 735e4761..90118a62 100644 --- a/leaf-server/minecraft-patches/features/0040-SparklyPaper-Allow-throttling-hopper-checks-if-the-t.patch +++ b/leaf-server/minecraft-patches/features/0039-SparklyPaper-Allow-throttling-hopper-checks-if-the-t.patch @@ -7,7 +7,7 @@ Subject: [PATCH] SparklyPaper: Allow throttling hopper checks if the target Original project: https://github.com/SparklyPower/SparklyPaper diff --git a/net/minecraft/world/level/block/entity/HopperBlockEntity.java b/net/minecraft/world/level/block/entity/HopperBlockEntity.java -index 276cb0dffaa253a6c13b4c68d8c703732118d0d1..962c870bc2ccff52c70be991850fec4663fa7f32 100644 +index 2549dd08b60cd81dcbf3412ed71cfc40729ae468..fe1dba198fced6f23556d95ba2f8fbc9200d878a 100644 --- a/net/minecraft/world/level/block/entity/HopperBlockEntity.java +++ b/net/minecraft/world/level/block/entity/HopperBlockEntity.java @@ -419,6 +419,11 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen diff --git a/leaf-server/minecraft-patches/features/0041-Polpot-Make-egg-and-snowball-can-knockback-player.patch b/leaf-server/minecraft-patches/features/0040-Polpot-Make-egg-and-snowball-can-knockback-player.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0041-Polpot-Make-egg-and-snowball-can-knockback-player.patch rename to leaf-server/minecraft-patches/features/0040-Polpot-Make-egg-and-snowball-can-knockback-player.patch diff --git a/leaf-server/minecraft-patches/features/0042-Redirect-vanilla-getProfiler-to-inactive-in-PathNavi.patch b/leaf-server/minecraft-patches/features/0041-Redirect-vanilla-getProfiler-to-inactive-in-PathNavi.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0042-Redirect-vanilla-getProfiler-to-inactive-in-PathNavi.patch rename to leaf-server/minecraft-patches/features/0041-Redirect-vanilla-getProfiler-to-inactive-in-PathNavi.patch diff --git a/leaf-server/minecraft-patches/features/0043-Remove-useless-creating-stats-json-bases-on-player-n.patch b/leaf-server/minecraft-patches/features/0042-Remove-useless-creating-stats-json-bases-on-player-n.patch similarity index 85% rename from leaf-server/minecraft-patches/features/0043-Remove-useless-creating-stats-json-bases-on-player-n.patch rename to leaf-server/minecraft-patches/features/0042-Remove-useless-creating-stats-json-bases-on-player-n.patch index 8b5937d7..dbb97070 100644 --- a/leaf-server/minecraft-patches/features/0043-Remove-useless-creating-stats-json-bases-on-player-n.patch +++ b/leaf-server/minecraft-patches/features/0042-Remove-useless-creating-stats-json-bases-on-player-n.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Remove useless creating stats json bases on player name logic diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java -index 8893be00aa731d26a41b5e6b3996425eced33cc4..831d1a60a5ed57d4f09b5ece6ffb50e061398cc0 100644 +index 86ce80765eb7645533806f730b15557f8ea6a9a2..29275d0fd6b3d320d5e444fb32aa4004f4370720 100644 --- a/net/minecraft/server/players/PlayerList.java +++ b/net/minecraft/server/players/PlayerList.java -@@ -1555,6 +1555,8 @@ public abstract class PlayerList { +@@ -1556,6 +1556,8 @@ public abstract class PlayerList { if (serverStatsCounter == null) { File file = this.server.getWorldPath(LevelResource.PLAYER_STATS_DIR).toFile(); File file1 = new File(file, uuid + ".json"); @@ -17,7 +17,7 @@ index 8893be00aa731d26a41b5e6b3996425eced33cc4..831d1a60a5ed57d4f09b5ece6ffb50e0 if (!file1.exists()) { File file2 = new File(file, displayName + ".json"); // CraftBukkit Path path = file2.toPath(); -@@ -1562,6 +1564,8 @@ public abstract class PlayerList { +@@ -1563,6 +1565,8 @@ public abstract class PlayerList { file2.renameTo(file1); } } diff --git a/leaf-server/minecraft-patches/features/0044-Improve-Purpur-AFK-system.patch b/leaf-server/minecraft-patches/features/0043-Improve-Purpur-AFK-system.patch similarity index 95% rename from leaf-server/minecraft-patches/features/0044-Improve-Purpur-AFK-system.patch rename to leaf-server/minecraft-patches/features/0043-Improve-Purpur-AFK-system.patch index 29047167..7e2b950b 100644 --- a/leaf-server/minecraft-patches/features/0044-Improve-Purpur-AFK-system.patch +++ b/leaf-server/minecraft-patches/features/0043-Improve-Purpur-AFK-system.patch @@ -53,10 +53,10 @@ index dfb4524d80f642eff1b146dd2fbfa07f21d844c6..2c67693cc3781eb5aee10b4dfb9617cb } else { getBukkitEntity().setPlayerListName(prefix + scoreboardName + suffix, true); diff --git a/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 5078887fc6056a0f3ef5acd5e052116107737e62..9c5ba056376a731871a2c00654cc179915d4dafd 100644 +index 5cd5234e9f2b8a17b6f9fdaa62e8fc0a9aa6331b..44f2182b5d78b0e51e8f5253fa9c89ea687b72df 100644 --- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2261,6 +2261,8 @@ public class ServerGamePacketListenerImpl +@@ -2260,6 +2260,8 @@ public class ServerGamePacketListenerImpl } } @@ -65,7 +65,7 @@ index 5078887fc6056a0f3ef5acd5e052116107737e62..9c5ba056376a731871a2c00654cc1799 @Override public void handleChatCommand(ServerboundChatCommandPacket packet) { this.tryHandleChat(packet.command(), () -> { -@@ -2281,6 +2283,32 @@ public class ServerGamePacketListenerImpl +@@ -2280,6 +2282,32 @@ public class ServerGamePacketListenerImpl LOGGER.info("{} issued server command: {}", this.player.getScoreboardName(), prefixedCommand); } @@ -98,7 +98,7 @@ index 5078887fc6056a0f3ef5acd5e052116107737e62..9c5ba056376a731871a2c00654cc1799 PlayerCommandPreprocessEvent event = new PlayerCommandPreprocessEvent(this.getCraftPlayer(), prefixedCommand, new LazyPlayerSet(this.server)); this.cserver.getPluginManager().callEvent(event); -@@ -2318,11 +2346,37 @@ public class ServerGamePacketListenerImpl +@@ -2317,11 +2345,37 @@ public class ServerGamePacketListenerImpl private void performSignedChatCommand(ServerboundChatCommandSignedPacket packet, LastSeenMessages lastSeenMessages) { // CraftBukkit start @@ -138,10 +138,10 @@ index 5078887fc6056a0f3ef5acd5e052116107737e62..9c5ba056376a731871a2c00654cc1799 this.cserver.getPluginManager().callEvent(event); command = event.getMessage().substring(1); diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java -index 831d1a60a5ed57d4f09b5ece6ffb50e061398cc0..0bb8c326a468e79a7f5a4f3395a3c2fe84352f47 100644 +index 29275d0fd6b3d320d5e444fb32aa4004f4370720..2d8c20ddd675173e9ea5734cfde6687ac042e01d 100644 --- a/net/minecraft/server/players/PlayerList.java +++ b/net/minecraft/server/players/PlayerList.java -@@ -667,6 +667,7 @@ public abstract class PlayerList { +@@ -668,6 +668,7 @@ public abstract class PlayerList { org.leavesmc.leaves.protocol.core.LeavesProtocolManager.handlePlayerLeave(player); // Leaves - protocol // Paper end - Fix kick event leave message not being sent org.purpurmc.purpur.task.BossBarTask.removeFromAll(player.getBukkitEntity()); // Purpur - Implement TPSBar @@ -150,7 +150,7 @@ index 831d1a60a5ed57d4f09b5ece6ffb50e061398cc0..0bb8c326a468e79a7f5a4f3395a3c2fe player.awardStat(Stats.LEAVE_GAME); // CraftBukkit start - Quitting must be before we do final save of data, in case plugins need to modify it diff --git a/org/purpurmc/purpur/PurpurConfig.java b/org/purpurmc/purpur/PurpurConfig.java -index c168e9d2c395044a662efd2d9ccde8b20c070b22..ee254498e71d50d461b7d6716704df8c2733037e 100644 +index b8c8806789bd0060cd3faee5815bbf25c8715a9b..c726406ac67980f0403cc524d96f08916218667a 100644 --- a/org/purpurmc/purpur/PurpurConfig.java +++ b/org/purpurmc/purpur/PurpurConfig.java @@ -175,6 +175,11 @@ public class PurpurConfig { diff --git a/leaf-server/minecraft-patches/features/0045-Virtual-thread-for-chat-executor.patch b/leaf-server/minecraft-patches/features/0044-Virtual-thread-for-chat-executor.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0045-Virtual-thread-for-chat-executor.patch rename to leaf-server/minecraft-patches/features/0044-Virtual-thread-for-chat-executor.patch diff --git a/leaf-server/minecraft-patches/features/0046-Virtual-thread-for-user-authenticator.patch b/leaf-server/minecraft-patches/features/0045-Virtual-thread-for-user-authenticator.patch similarity index 95% rename from leaf-server/minecraft-patches/features/0046-Virtual-thread-for-user-authenticator.patch rename to leaf-server/minecraft-patches/features/0045-Virtual-thread-for-user-authenticator.patch index d7c20461..6de988b1 100644 --- a/leaf-server/minecraft-patches/features/0046-Virtual-thread-for-user-authenticator.patch +++ b/leaf-server/minecraft-patches/features/0045-Virtual-thread-for-user-authenticator.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Virtual thread for user authenticator diff --git a/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -index fec84afa274f8b7cc3e0e9bf500e672c16be53d4..9081780cff9d97b0f4a93afade62f5ef0d448209 100644 +index 4567067bd91000bb98052cd5a139292e4615b13f..069477e524a28b20a0289221858bdc802704a890 100644 --- a/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/net/minecraft/server/network/ServerLoginPacketListenerImpl.java @@ -55,7 +55,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, diff --git a/leaf-server/minecraft-patches/features/0047-Mirai-Configurable-chat-message-signatures.patch b/leaf-server/minecraft-patches/features/0046-Mirai-Configurable-chat-message-signatures.patch similarity index 97% rename from leaf-server/minecraft-patches/features/0047-Mirai-Configurable-chat-message-signatures.patch rename to leaf-server/minecraft-patches/features/0046-Mirai-Configurable-chat-message-signatures.patch index 29585501..ee726040 100644 --- a/leaf-server/minecraft-patches/features/0047-Mirai-Configurable-chat-message-signatures.patch +++ b/leaf-server/minecraft-patches/features/0046-Mirai-Configurable-chat-message-signatures.patch @@ -91,7 +91,7 @@ index 30bd254542d631676494f349ff3f44f52d54ab2f..63e6411d8bac1629e143cc620fe35dba public record Favicon(byte[] iconBytes) { diff --git a/net/minecraft/server/dedicated/DedicatedServer.java b/net/minecraft/server/dedicated/DedicatedServer.java -index 22b0f33dc3ef9f51ba2ca3cb665b07a16bd1c9d9..7b1e5addd6a1b815498233ba9032f224494af12a 100644 +index 6e7ac9128378586160230bd33462edb7d6880154..92eda3826518cf54891cccb46eed9e0d3da165ba 100644 --- a/net/minecraft/server/dedicated/DedicatedServer.java +++ b/net/minecraft/server/dedicated/DedicatedServer.java @@ -667,6 +667,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface @@ -138,10 +138,10 @@ index ee8cdd532b73180cb484fcc37c36f09c40faacda..becadda1642c1b9342f2fdff1fc062a2 if (packet == null || this.processedDisconnect) { // Spigot return; diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java -index 0bb8c326a468e79a7f5a4f3395a3c2fe84352f47..fe9784751f4291ce100998bf15554d19745025ca 100644 +index 2d8c20ddd675173e9ea5734cfde6687ac042e01d..739835ce8c02e485abbe8de2e02d19ce9b3f44f9 100644 --- a/net/minecraft/server/players/PlayerList.java +++ b/net/minecraft/server/players/PlayerList.java -@@ -1515,7 +1515,7 @@ public abstract class PlayerList { +@@ -1516,7 +1516,7 @@ public abstract class PlayerList { public void broadcastChatMessage(PlayerChatMessage message, Predicate shouldFilterMessageTo, @Nullable ServerPlayer sender, ChatType.Bound boundChatType, @Nullable Function unsignedFunction) { // Paper end boolean flag = this.verifyChatTrusted(message); @@ -150,7 +150,7 @@ index 0bb8c326a468e79a7f5a4f3395a3c2fe84352f47..fe9784751f4291ce100998bf15554d19 OutgoingChatMessage outgoingChatMessage = OutgoingChatMessage.create(message); boolean flag1 = false; -@@ -1540,6 +1540,7 @@ public abstract class PlayerList { +@@ -1541,6 +1541,7 @@ public abstract class PlayerList { } public boolean verifyChatTrusted(PlayerChatMessage message) { // Paper - private -> public diff --git a/leaf-server/minecraft-patches/features/0048-Cache-player-profileResult.patch b/leaf-server/minecraft-patches/features/0047-Cache-player-profileResult.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0048-Cache-player-profileResult.patch rename to leaf-server/minecraft-patches/features/0047-Cache-player-profileResult.patch diff --git a/leaf-server/minecraft-patches/features/0049-Matter-Secure-Seed.patch b/leaf-server/minecraft-patches/features/0048-Matter-Secure-Seed.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0049-Matter-Secure-Seed.patch rename to leaf-server/minecraft-patches/features/0048-Matter-Secure-Seed.patch diff --git a/leaf-server/minecraft-patches/features/0050-Matter-Secure-Seed-command.patch b/leaf-server/minecraft-patches/features/0049-Matter-Secure-Seed-command.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0050-Matter-Secure-Seed-command.patch rename to leaf-server/minecraft-patches/features/0049-Matter-Secure-Seed-command.patch diff --git a/leaf-server/minecraft-patches/features/0051-Faster-random-generator.patch b/leaf-server/minecraft-patches/features/0050-Faster-random-generator.patch similarity index 98% rename from leaf-server/minecraft-patches/features/0051-Faster-random-generator.patch rename to leaf-server/minecraft-patches/features/0050-Faster-random-generator.patch index bc2f4ea7..9934fc97 100644 --- a/leaf-server/minecraft-patches/features/0051-Faster-random-generator.patch +++ b/leaf-server/minecraft-patches/features/0050-Faster-random-generator.patch @@ -14,7 +14,7 @@ ThreadUnsafeRandom (Moonrise): 102,265,100 ns SimpleThreadUnsafeRandom (Moonrise): 97,054,600 ns diff --git a/net/minecraft/server/level/ServerChunkCache.java b/net/minecraft/server/level/ServerChunkCache.java -index 92e70e132a86930d9cd0db32f10e106427621c7d..5b61e9e26fd63b938f38753c9ce38a474ffe80e5 100644 +index 4070a6eb52f6097e38c2d85c231d39ea3785cf46..bb76dbf98979fdc725676c98dafe64ea941cb290 100644 --- a/net/minecraft/server/level/ServerChunkCache.java +++ b/net/minecraft/server/level/ServerChunkCache.java @@ -150,7 +150,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon @@ -27,7 +27,7 @@ index 92e70e132a86930d9cd0db32f10e106427621c7d..5b61e9e26fd63b938f38753c9ce38a47 final ca.spottedleaf.moonrise.patches.chunk_system.level.chunk.ChunkData chunkData = ((ca.spottedleaf.moonrise.patches.chunk_system.level.chunk.ChunkSystemChunkHolder)((ca.spottedleaf.moonrise.patches.chunk_system.level.chunk.ChunkSystemLevelChunk)levelChunk).moonrise$getChunkAndHolder().holder()) .moonrise$getRealChunkHolder().holderData; diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java -index 22b929d30938a26837b21511425c62fc1665a669..677e5f31089879235677b82ff554e5b89e335a6d 100644 +index 40b6b5e4a1f73ee447ff0ee192d5d8ba5045f286..f9e335c86684969b744a7d7c1d96458e830bbd35 100644 --- a/net/minecraft/server/level/ServerLevel.java +++ b/net/minecraft/server/level/ServerLevel.java @@ -902,7 +902,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe @@ -89,7 +89,7 @@ index 98a54bc4de251014342cda6d0951b7fea79ce553..6d56134cc9ed9d73104ae77b1a0baa5a RandomSource fork(); diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java -index 539cd1fe6ff15a4ebcbd65f41d8711d1f4ce5b97..034e10e912ab9b4b5435ad88c0cd4183c8b5c1a1 100644 +index 761b3806ddec0675935dc2e24d36e4b221c53c9b..8bb2abb01f1af34d6829cbbf759a425d871f3e3f 100644 --- a/net/minecraft/world/entity/Entity.java +++ b/net/minecraft/world/entity/Entity.java @@ -143,7 +143,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -102,7 +102,7 @@ index 539cd1fe6ff15a4ebcbd65f41d8711d1f4ce5b97..034e10e912ab9b4b5435ad88c0cd4183 private static final class RandomRandomSource extends ca.spottedleaf.moonrise.common.util.ThreadUnsafeRandom { public RandomRandomSource() { diff --git a/net/minecraft/world/level/Level.java b/net/minecraft/world/level/Level.java -index 13edbcdabc159e3694e7dbe824ccb5bb447fe788..367ba07f63917dc75883d5fd3dde93dc9ffc144a 100644 +index b39d67ab9ed446885111a5387d3332c36b4f3cc9..53cabe7dabc83618c8941c95e95c5b7e23ee694e 100644 --- a/net/minecraft/world/level/Level.java +++ b/net/minecraft/world/level/Level.java @@ -126,7 +126,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl diff --git a/leaf-server/minecraft-patches/features/0052-Don-t-save-primed-tnt-entity.patch b/leaf-server/minecraft-patches/features/0051-Don-t-save-primed-tnt-entity.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0052-Don-t-save-primed-tnt-entity.patch rename to leaf-server/minecraft-patches/features/0051-Don-t-save-primed-tnt-entity.patch diff --git a/leaf-server/minecraft-patches/features/0053-Don-t-save-falling-block-entity.patch b/leaf-server/minecraft-patches/features/0052-Don-t-save-falling-block-entity.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0053-Don-t-save-falling-block-entity.patch rename to leaf-server/minecraft-patches/features/0052-Don-t-save-falling-block-entity.patch diff --git a/leaf-server/minecraft-patches/features/0054-Configurable-connection-message.patch b/leaf-server/minecraft-patches/features/0053-Configurable-connection-message.patch similarity index 93% rename from leaf-server/minecraft-patches/features/0054-Configurable-connection-message.patch rename to leaf-server/minecraft-patches/features/0053-Configurable-connection-message.patch index a4f9c2c1..b17436c6 100644 --- a/leaf-server/minecraft-patches/features/0054-Configurable-connection-message.patch +++ b/leaf-server/minecraft-patches/features/0053-Configurable-connection-message.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Configurable connection message diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java -index fe9784751f4291ce100998bf15554d19745025ca..c69fcc9725738136341cc2e9d63b5e2ef11e1fe5 100644 +index 739835ce8c02e485abbe8de2e02d19ce9b3f44f9..9aa924cb58ea6d50572d67f628d35eebb809ae72 100644 --- a/net/minecraft/server/players/PlayerList.java +++ b/net/minecraft/server/players/PlayerList.java -@@ -433,7 +433,7 @@ public abstract class PlayerList { +@@ -434,7 +434,7 @@ public abstract class PlayerList { // Ensure that player inventory is populated with its viewer player.containerMenu.transferTo(player.containerMenu, bukkitPlayer); @@ -17,7 +17,7 @@ index fe9784751f4291ce100998bf15554d19745025ca..c69fcc9725738136341cc2e9d63b5e2e this.cserver.getPluginManager().callEvent(playerJoinEvent); if (!player.connection.isAcceptingMessages()) { -@@ -446,7 +446,7 @@ public abstract class PlayerList { +@@ -447,7 +447,7 @@ public abstract class PlayerList { final net.kyori.adventure.text.Component jm = playerJoinEvent.joinMessage(); @@ -26,7 +26,7 @@ index fe9784751f4291ce100998bf15554d19745025ca..c69fcc9725738136341cc2e9d63b5e2e joinMessage = io.papermc.paper.adventure.PaperAdventure.asVanilla(jm); // Paper - Adventure this.server.getPlayerList().broadcastSystemMessage(joinMessage, false); // Paper - Adventure } -@@ -676,7 +676,7 @@ public abstract class PlayerList { +@@ -677,7 +677,7 @@ public abstract class PlayerList { player.closeContainer(org.bukkit.event.inventory.InventoryCloseEvent.Reason.DISCONNECT); // Paper - Inventory close reason } @@ -35,7 +35,7 @@ index fe9784751f4291ce100998bf15554d19745025ca..c69fcc9725738136341cc2e9d63b5e2e this.cserver.getPluginManager().callEvent(playerQuitEvent); player.getBukkitEntity().disconnect(playerQuitEvent.getQuitMessage()); -@@ -1667,4 +1667,34 @@ public abstract class PlayerList { +@@ -1668,4 +1668,34 @@ public abstract class PlayerList { public boolean isAllowCommandsForAllPlayers() { return this.allowCommandsForAllPlayers; } diff --git a/leaf-server/minecraft-patches/features/0055-Configurable-unknown-command-message.patch b/leaf-server/minecraft-patches/features/0054-Configurable-unknown-command-message.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0055-Configurable-unknown-command-message.patch rename to leaf-server/minecraft-patches/features/0054-Configurable-unknown-command-message.patch diff --git a/leaf-server/minecraft-patches/features/0056-Remove-stream-in-BlockBehaviour-cache-blockstate.patch b/leaf-server/minecraft-patches/features/0055-Remove-stream-in-BlockBehaviour-cache-blockstate.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0056-Remove-stream-in-BlockBehaviour-cache-blockstate.patch rename to leaf-server/minecraft-patches/features/0055-Remove-stream-in-BlockBehaviour-cache-blockstate.patch diff --git a/leaf-server/minecraft-patches/features/0057-Remove-stream-in-entity-visible-effects-filter.patch b/leaf-server/minecraft-patches/features/0056-Remove-stream-in-entity-visible-effects-filter.patch similarity index 93% rename from leaf-server/minecraft-patches/features/0057-Remove-stream-in-entity-visible-effects-filter.patch rename to leaf-server/minecraft-patches/features/0056-Remove-stream-in-entity-visible-effects-filter.patch index f2e98fdb..17d0b8cb 100644 --- a/leaf-server/minecraft-patches/features/0057-Remove-stream-in-entity-visible-effects-filter.patch +++ b/leaf-server/minecraft-patches/features/0056-Remove-stream-in-entity-visible-effects-filter.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Remove stream in entity visible effects filter diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java -index c041cba43b4687e2f2f057edfae448a42f6d8753..8b096a0f9f23a9b90ef88414e8749a514e3910cf 100644 +index c7f58236400dbb9d26cf4a5b83b3a9202b10471d..7bdf6db0dd0e72d798de301d1acd190216dc8bc7 100644 --- a/net/minecraft/world/entity/LivingEntity.java +++ b/net/minecraft/world/entity/LivingEntity.java @@ -988,12 +988,15 @@ public abstract class LivingEntity extends Entity implements Attackable { diff --git a/leaf-server/minecraft-patches/features/0058-Remove-stream-and-double-iteration-in-enough-deep-sl.patch b/leaf-server/minecraft-patches/features/0057-Remove-stream-and-double-iteration-in-enough-deep-sl.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0058-Remove-stream-and-double-iteration-in-enough-deep-sl.patch rename to leaf-server/minecraft-patches/features/0057-Remove-stream-and-double-iteration-in-enough-deep-sl.patch diff --git a/leaf-server/minecraft-patches/features/0059-Remove-stream-in-trial-spawner-ticking.patch b/leaf-server/minecraft-patches/features/0058-Remove-stream-in-trial-spawner-ticking.patch similarity index 97% rename from leaf-server/minecraft-patches/features/0059-Remove-stream-in-trial-spawner-ticking.patch rename to leaf-server/minecraft-patches/features/0058-Remove-stream-in-trial-spawner-ticking.patch index f6677c25..a3f098b6 100644 --- a/leaf-server/minecraft-patches/features/0059-Remove-stream-in-trial-spawner-ticking.patch +++ b/leaf-server/minecraft-patches/features/0058-Remove-stream-in-trial-spawner-ticking.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Remove stream in trial spawner ticking diff --git a/net/minecraft/world/level/block/entity/trialspawner/TrialSpawnerState.java b/net/minecraft/world/level/block/entity/trialspawner/TrialSpawnerState.java -index 02723e61684fcf36094d7b9c81f6ab87ad6f620a..fc340def138824c7f922788e3dce48adfc1258dd 100644 +index 3e8d0c8d8409b6ba2e2846d7d64cdcc8fc6094a4..2f8324ce552f982f6b3388d9fa5a63fb9bee625b 100644 --- a/net/minecraft/world/level/block/entity/trialspawner/TrialSpawnerState.java +++ b/net/minecraft/world/level/block/entity/trialspawner/TrialSpawnerState.java @@ -173,17 +173,21 @@ public enum TrialSpawnerState implements StringRepresentable { diff --git a/leaf-server/minecraft-patches/features/0060-Remove-stream-in-Brain.patch b/leaf-server/minecraft-patches/features/0059-Remove-stream-in-Brain.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0060-Remove-stream-in-Brain.patch rename to leaf-server/minecraft-patches/features/0059-Remove-stream-in-Brain.patch diff --git a/leaf-server/minecraft-patches/features/0061-Remove-stream-in-BehaviorUtils.patch b/leaf-server/minecraft-patches/features/0060-Remove-stream-in-BehaviorUtils.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0061-Remove-stream-in-BehaviorUtils.patch rename to leaf-server/minecraft-patches/features/0060-Remove-stream-in-BehaviorUtils.patch diff --git a/leaf-server/minecraft-patches/features/0062-Remove-stream-in-YieldJobSite.patch b/leaf-server/minecraft-patches/features/0061-Remove-stream-in-YieldJobSite.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0062-Remove-stream-in-YieldJobSite.patch rename to leaf-server/minecraft-patches/features/0061-Remove-stream-in-YieldJobSite.patch diff --git a/leaf-server/minecraft-patches/features/0063-Remove-stream-in-PlayerSensor.patch b/leaf-server/minecraft-patches/features/0062-Remove-stream-in-PlayerSensor.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0063-Remove-stream-in-PlayerSensor.patch rename to leaf-server/minecraft-patches/features/0062-Remove-stream-in-PlayerSensor.patch diff --git a/leaf-server/minecraft-patches/features/0064-Remove-stream-in-GolemSensor.patch b/leaf-server/minecraft-patches/features/0063-Remove-stream-in-GolemSensor.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0064-Remove-stream-in-GolemSensor.patch rename to leaf-server/minecraft-patches/features/0063-Remove-stream-in-GolemSensor.patch diff --git a/leaf-server/minecraft-patches/features/0065-Remove-stream-in-GateBehavior.patch b/leaf-server/minecraft-patches/features/0064-Remove-stream-in-GateBehavior.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0065-Remove-stream-in-GateBehavior.patch rename to leaf-server/minecraft-patches/features/0064-Remove-stream-in-GateBehavior.patch diff --git a/leaf-server/minecraft-patches/features/0066-Remove-stream-in-updateFluidOnEyes.patch b/leaf-server/minecraft-patches/features/0065-Remove-stream-in-updateFluidOnEyes.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0066-Remove-stream-in-updateFluidOnEyes.patch rename to leaf-server/minecraft-patches/features/0065-Remove-stream-in-updateFluidOnEyes.patch diff --git a/leaf-server/minecraft-patches/features/0067-Remove-stream-in-matchingSlot.patch b/leaf-server/minecraft-patches/features/0066-Remove-stream-in-matchingSlot.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0067-Remove-stream-in-matchingSlot.patch rename to leaf-server/minecraft-patches/features/0066-Remove-stream-in-matchingSlot.patch diff --git a/leaf-server/minecraft-patches/features/0068-Replace-Entity-active-effects-map-with-optimized-col.patch b/leaf-server/minecraft-patches/features/0067-Replace-Entity-active-effects-map-with-optimized-col.patch similarity index 96% rename from leaf-server/minecraft-patches/features/0068-Replace-Entity-active-effects-map-with-optimized-col.patch rename to leaf-server/minecraft-patches/features/0067-Replace-Entity-active-effects-map-with-optimized-col.patch index 1c62be1c..e77ec39f 100644 --- a/leaf-server/minecraft-patches/features/0068-Replace-Entity-active-effects-map-with-optimized-col.patch +++ b/leaf-server/minecraft-patches/features/0067-Replace-Entity-active-effects-map-with-optimized-col.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Replace Entity active effects map with optimized collection Dreeam TODO: check this diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java -index 8b096a0f9f23a9b90ef88414e8749a514e3910cf..d8a93bd85580c4bdc52d6f368b78ad210c265ae5 100644 +index 7bdf6db0dd0e72d798de301d1acd190216dc8bc7..54b7ae45de54dc335a88a8c48e5212e7e663bc54 100644 --- a/net/minecraft/world/entity/LivingEntity.java +++ b/net/minecraft/world/entity/LivingEntity.java @@ -211,6 +211,10 @@ public abstract class LivingEntity extends Entity implements Attackable { diff --git a/leaf-server/minecraft-patches/features/0069-Replace-criterion-map-with-optimized-collection.patch b/leaf-server/minecraft-patches/features/0068-Replace-criterion-map-with-optimized-collection.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0069-Replace-criterion-map-with-optimized-collection.patch rename to leaf-server/minecraft-patches/features/0068-Replace-criterion-map-with-optimized-collection.patch diff --git a/leaf-server/minecraft-patches/features/0070-Replace-brain-maps-with-optimized-collection.patch b/leaf-server/minecraft-patches/features/0069-Replace-brain-maps-with-optimized-collection.patch similarity index 96% rename from leaf-server/minecraft-patches/features/0070-Replace-brain-maps-with-optimized-collection.patch rename to leaf-server/minecraft-patches/features/0069-Replace-brain-maps-with-optimized-collection.patch index 5c09f5a6..7e942c78 100644 --- a/leaf-server/minecraft-patches/features/0070-Replace-brain-maps-with-optimized-collection.patch +++ b/leaf-server/minecraft-patches/features/0069-Replace-brain-maps-with-optimized-collection.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Replace brain maps with optimized collection diff --git a/net/minecraft/world/entity/ai/Brain.java b/net/minecraft/world/entity/ai/Brain.java -index 402279ff78f9e9eb74c63d35ec1968d239228d70..5eaa1dec9fbe72a22c34331a28f7b7115fb3aeba 100644 +index 083eb9a7a0bc14d30db944f356d98ca552fa1784..c561b749fb9b76ba9b1e9689089b743248c65d50 100644 --- a/net/minecraft/world/entity/ai/Brain.java +++ b/net/minecraft/world/entity/ai/Brain.java @@ -45,14 +45,18 @@ public class Brain { diff --git a/leaf-server/minecraft-patches/features/0071-Reduce-worldgen-allocations.patch b/leaf-server/minecraft-patches/features/0070-Reduce-worldgen-allocations.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0071-Reduce-worldgen-allocations.patch rename to leaf-server/minecraft-patches/features/0070-Reduce-worldgen-allocations.patch diff --git a/leaf-server/minecraft-patches/features/0072-Use-caffeine-cache-for-kickPermission-instead-of-usi.patch b/leaf-server/minecraft-patches/features/0071-Use-caffeine-cache-for-kickPermission-instead-of-usi.patch similarity index 96% rename from leaf-server/minecraft-patches/features/0072-Use-caffeine-cache-for-kickPermission-instead-of-usi.patch rename to leaf-server/minecraft-patches/features/0071-Use-caffeine-cache-for-kickPermission-instead-of-usi.patch index b00dafe5..4ccf9dcd 100644 --- a/leaf-server/minecraft-patches/features/0072-Use-caffeine-cache-for-kickPermission-instead-of-usi.patch +++ b/leaf-server/minecraft-patches/features/0071-Use-caffeine-cache-for-kickPermission-instead-of-usi.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Use caffeine cache for kickPermission instead of using diff --git a/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 2857e71ddb37f2a98c72df8cb439e2eab97d6f67..23092d6f6bca4eff4aaceabed51927e13156b30d 100644 +index 44f2182b5d78b0e51e8f5253fa9c89ea687b72df..7b493b28f57977c92c4a45049cedcb0cedbe8ae9 100644 --- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -328,17 +328,12 @@ public class ServerGamePacketListenerImpl diff --git a/leaf-server/minecraft-patches/features/0073-Do-not-place-player-if-the-server-is-full.patch b/leaf-server/minecraft-patches/features/0072-Do-not-place-player-if-the-server-is-full.patch similarity index 93% rename from leaf-server/minecraft-patches/features/0073-Do-not-place-player-if-the-server-is-full.patch rename to leaf-server/minecraft-patches/features/0072-Do-not-place-player-if-the-server-is-full.patch index 4ef57305..40c2c8be 100644 --- a/leaf-server/minecraft-patches/features/0073-Do-not-place-player-if-the-server-is-full.patch +++ b/leaf-server/minecraft-patches/features/0072-Do-not-place-player-if-the-server-is-full.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Do not place player if the server is full Fix https://github.com/PaperMC/Paper/issues/10668 diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java -index 5fe6a295f5b5285a20c535a026e1342f89896fd7..8233b250a8d0e9f26302f6756931d2edfe017504 100644 +index 9aa924cb58ea6d50572d67f628d35eebb809ae72..6327d508252b35fcbd2daebad078f00d44291c6e 100644 --- a/net/minecraft/server/players/PlayerList.java +++ b/net/minecraft/server/players/PlayerList.java -@@ -340,6 +340,13 @@ public abstract class PlayerList { +@@ -341,6 +341,13 @@ public abstract class PlayerList { return; } // Gale end - MultiPaper - do not place player in world if kicked before being spawned in @@ -23,7 +23,7 @@ index 5fe6a295f5b5285a20c535a026e1342f89896fd7..8233b250a8d0e9f26302f6756931d2ed org.bukkit.Location loc = ev.getSpawnLocation(); serverLevel = ((org.bukkit.craftbukkit.CraftWorld) loc.getWorld()).getHandle(); -@@ -834,7 +841,7 @@ public abstract class PlayerList { +@@ -835,7 +842,7 @@ public abstract class PlayerList { // return this.players.size() >= this.maxPlayers && !this.canBypassPlayerLimit(gameProfile) // ? Component.translatable("multiplayer.disconnect.server_full") // : null; diff --git a/leaf-server/minecraft-patches/features/0074-Fix-MC-65198.patch b/leaf-server/minecraft-patches/features/0073-Fix-MC-65198.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0074-Fix-MC-65198.patch rename to leaf-server/minecraft-patches/features/0073-Fix-MC-65198.patch diff --git a/leaf-server/minecraft-patches/features/0075-Fix-MC-200418.patch b/leaf-server/minecraft-patches/features/0074-Fix-MC-200418.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0075-Fix-MC-200418.patch rename to leaf-server/minecraft-patches/features/0074-Fix-MC-200418.patch diff --git a/leaf-server/minecraft-patches/features/0076-Fix-MC-119417.patch b/leaf-server/minecraft-patches/features/0075-Fix-MC-119417.patch similarity index 91% rename from leaf-server/minecraft-patches/features/0076-Fix-MC-119417.patch rename to leaf-server/minecraft-patches/features/0075-Fix-MC-119417.patch index f7a5c413..335be159 100644 --- a/leaf-server/minecraft-patches/features/0076-Fix-MC-119417.patch +++ b/leaf-server/minecraft-patches/features/0075-Fix-MC-119417.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Fix-MC-119417 Related MC issue: https://bugs.mojang.com/browse/MC-119417 diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java -index 09c9ca038f359372bda3a3d8b743d497a530ce97..ef20741ab2a7feaa8a86759ee0ae6283e4d4651c 100644 +index 2c67693cc3781eb5aee10b4dfb9617cbe107e922..e1a1bddfc11da20f3a1b9a2773b19d4317fac914 100644 --- a/net/minecraft/server/level/ServerPlayer.java +++ b/net/minecraft/server/level/ServerPlayer.java @@ -2260,6 +2260,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc diff --git a/leaf-server/minecraft-patches/features/0077-Fix-MC-223153.patch b/leaf-server/minecraft-patches/features/0076-Fix-MC-223153.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0077-Fix-MC-223153.patch rename to leaf-server/minecraft-patches/features/0076-Fix-MC-223153.patch diff --git a/leaf-server/minecraft-patches/features/0078-Configurable-player-knockback-zombie.patch b/leaf-server/minecraft-patches/features/0077-Configurable-player-knockback-zombie.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0078-Configurable-player-knockback-zombie.patch rename to leaf-server/minecraft-patches/features/0077-Configurable-player-knockback-zombie.patch diff --git a/leaf-server/minecraft-patches/features/0079-Paper-PR-Skip-AI-during-inactive-ticks-for-non-aware.patch b/leaf-server/minecraft-patches/features/0078-Paper-PR-Skip-AI-during-inactive-ticks-for-non-aware.patch similarity index 96% rename from leaf-server/minecraft-patches/features/0079-Paper-PR-Skip-AI-during-inactive-ticks-for-non-aware.patch rename to leaf-server/minecraft-patches/features/0078-Paper-PR-Skip-AI-during-inactive-ticks-for-non-aware.patch index 94a6bee2..2078d623 100644 --- a/leaf-server/minecraft-patches/features/0079-Paper-PR-Skip-AI-during-inactive-ticks-for-non-aware.patch +++ b/leaf-server/minecraft-patches/features/0078-Paper-PR-Skip-AI-during-inactive-ticks-for-non-aware.patch @@ -24,7 +24,7 @@ index 8b3dfb1385a2252a4aaead5558c0ffbd5c204971..c32086ddf90fafcc55600f9e0724b9f9 if (this.goalSelector.inactiveTick(this.activatedPriority, true) && !isThrottled) { // Pufferfish - pass activated priroity // Pufferfish - throttle inactive goal selector ticking this.goalSelector.tick(); diff --git a/net/minecraft/world/entity/npc/Villager.java b/net/minecraft/world/entity/npc/Villager.java -index 5dbf28c15f828505d42dc31c1a2185e01a7542c1..3799cf1059e18448fc6da120d12d08f6bbbfbf49 100644 +index e8e2848c12e3cf2ad86fc3bd18f03182ee291775..bee017f2c47a9f0876e2e05ce1c720332fb74566 100644 --- a/net/minecraft/world/entity/npc/Villager.java +++ b/net/minecraft/world/entity/npc/Villager.java @@ -371,7 +371,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler diff --git a/leaf-server/minecraft-patches/features/0080-Paper-PR-Prevent-zombie-reinforcements-loading-chunk.patch b/leaf-server/minecraft-patches/features/0079-Paper-PR-Prevent-zombie-reinforcements-loading-chunk.patch similarity index 95% rename from leaf-server/minecraft-patches/features/0080-Paper-PR-Prevent-zombie-reinforcements-loading-chunk.patch rename to leaf-server/minecraft-patches/features/0079-Paper-PR-Prevent-zombie-reinforcements-loading-chunk.patch index 4a49cded..086eeb7f 100644 --- a/leaf-server/minecraft-patches/features/0080-Paper-PR-Prevent-zombie-reinforcements-loading-chunk.patch +++ b/leaf-server/minecraft-patches/features/0079-Paper-PR-Prevent-zombie-reinforcements-loading-chunk.patch @@ -12,7 +12,7 @@ before spawning, it checks isSpawnPositionOk() for the position which loads the This patch ensures the chunk at the random location is loaded before trying to spawn the reinforcement zombie in it. diff --git a/net/minecraft/world/entity/monster/Zombie.java b/net/minecraft/world/entity/monster/Zombie.java -index cab69c308a0524137636fd50dc7a0dd0d2a4a2c3..660dff3fe7aacfe964dae22bb38b72aa36f0b8e3 100644 +index e64f9308fc848c0f22d8dbd6e544b7862054be7b..ecdfadca31c5833e2a685163925540df4b72dc81 100644 --- a/net/minecraft/world/entity/monster/Zombie.java +++ b/net/minecraft/world/entity/monster/Zombie.java @@ -396,6 +396,13 @@ public class Zombie extends Monster { diff --git a/leaf-server/minecraft-patches/features/0081-PaperPR-Fix-some-beacon-event-issues.patch b/leaf-server/minecraft-patches/features/0080-PaperPR-Fix-some-beacon-event-issues.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0081-PaperPR-Fix-some-beacon-event-issues.patch rename to leaf-server/minecraft-patches/features/0080-PaperPR-Fix-some-beacon-event-issues.patch diff --git a/leaf-server/minecraft-patches/features/0082-Dont-send-useless-entity-packets.patch b/leaf-server/minecraft-patches/features/0081-Dont-send-useless-entity-packets.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0082-Dont-send-useless-entity-packets.patch rename to leaf-server/minecraft-patches/features/0081-Dont-send-useless-entity-packets.patch diff --git a/leaf-server/minecraft-patches/features/0083-Don-t-spawn-if-lastSpawnState-is-null.patch b/leaf-server/minecraft-patches/features/0082-Don-t-spawn-if-lastSpawnState-is-null.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0083-Don-t-spawn-if-lastSpawnState-is-null.patch rename to leaf-server/minecraft-patches/features/0082-Don-t-spawn-if-lastSpawnState-is-null.patch diff --git a/leaf-server/minecraft-patches/features/0084-Multithreaded-Tracker.patch b/leaf-server/minecraft-patches/features/0083-Multithreaded-Tracker.patch similarity index 99% rename from leaf-server/minecraft-patches/features/0084-Multithreaded-Tracker.patch rename to leaf-server/minecraft-patches/features/0083-Multithreaded-Tracker.patch index 0db7bf41..035b9cca 100644 --- a/leaf-server/minecraft-patches/features/0084-Multithreaded-Tracker.patch +++ b/leaf-server/minecraft-patches/features/0083-Multithreaded-Tracker.patch @@ -218,10 +218,10 @@ index f9e335c86684969b744a7d7c1d96458e830bbd35..9f3fe9ffdbd2973754898233cca60b73 } diff --git a/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index b03ec4f449bf7c7bd56bf763fe5c2841ca1408ef..d9dfa7c0c79166156c6e166d721e804264d3c59c 100644 +index 7b493b28f57977c92c4a45049cedcb0cedbe8ae9..89a9a9738ae1a6b67fa3840000af496ebcff67da 100644 --- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1817,7 +1817,7 @@ public class ServerGamePacketListenerImpl +@@ -1816,7 +1816,7 @@ public class ServerGamePacketListenerImpl } public void internalTeleport(PositionMoveRotation posMoveRotation, Set relatives) { diff --git a/leaf-server/minecraft-patches/features/0085-Nitori-Async-playerdata-Save.patch b/leaf-server/minecraft-patches/features/0084-Nitori-Async-playerdata-Save.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0085-Nitori-Async-playerdata-Save.patch rename to leaf-server/minecraft-patches/features/0084-Nitori-Async-playerdata-Save.patch diff --git a/leaf-server/minecraft-patches/features/0086-Optimize-nearby-alive-players-for-spawning.patch b/leaf-server/minecraft-patches/features/0085-Optimize-nearby-alive-players-for-spawning.patch similarity index 97% rename from leaf-server/minecraft-patches/features/0086-Optimize-nearby-alive-players-for-spawning.patch rename to leaf-server/minecraft-patches/features/0085-Optimize-nearby-alive-players-for-spawning.patch index 01c9df8b..77cee482 100644 --- a/leaf-server/minecraft-patches/features/0086-Optimize-nearby-alive-players-for-spawning.patch +++ b/leaf-server/minecraft-patches/features/0085-Optimize-nearby-alive-players-for-spawning.patch @@ -20,7 +20,7 @@ index 002ec5f1ec14411ca48ae04b3379db0c70f81942..d2ca99f8b5ad46c59b663cd56f3ee2bd // Paper end - Affects Spawning API diff --git a/net/minecraft/world/entity/monster/Zombie.java b/net/minecraft/world/entity/monster/Zombie.java -index 660dff3fe7aacfe964dae22bb38b72aa36f0b8e3..4f7a5d6391f045693a6208ff5cd99e5e0b58b194 100644 +index ecdfadca31c5833e2a685163925540df4b72dc81..9c83f1406c0aaad36383a23cebf270b8dc6ced33 100644 --- a/net/minecraft/world/entity/monster/Zombie.java +++ b/net/minecraft/world/entity/monster/Zombie.java @@ -406,7 +406,7 @@ public class Zombie extends Monster { @@ -46,7 +46,7 @@ index 8de482367f3d9d91048b7c85cbaefcda9f9fbcdc..8c6f8cb08b247dcf497822ae991aa3af public void clientTick(Level level, BlockPos pos) { diff --git a/net/minecraft/world/level/EntityGetter.java b/net/minecraft/world/level/EntityGetter.java -index f41e41d01aa42f3578ffb3bc888416e74d17cd1d..9d3b5ea3f0cd8d662ffe99e70bf0af22f6ba0512 100644 +index 7719bc8ff1fbbc67cdf15e1fec28dc9233cea207..670860df81a3abfc1b8b53be505fce0ee32ee2c4 100644 --- a/net/minecraft/world/level/EntityGetter.java +++ b/net/minecraft/world/level/EntityGetter.java @@ -112,6 +112,89 @@ public interface EntityGetter extends ca.spottedleaf.moonrise.patches.chunk_syst diff --git a/leaf-server/minecraft-patches/features/0087-Cache-blockstate-cache-array.patch b/leaf-server/minecraft-patches/features/0086-Cache-blockstate-cache-array.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0087-Cache-blockstate-cache-array.patch rename to leaf-server/minecraft-patches/features/0086-Cache-blockstate-cache-array.patch diff --git a/leaf-server/minecraft-patches/features/0088-Asynchronous-locator.patch b/leaf-server/minecraft-patches/features/0087-Asynchronous-locator.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0088-Asynchronous-locator.patch rename to leaf-server/minecraft-patches/features/0087-Asynchronous-locator.patch diff --git a/leaf-server/minecraft-patches/features/0089-Smart-sort-entities-in-NearestLivingEntitySensor.patch b/leaf-server/minecraft-patches/features/0088-Smart-sort-entities-in-NearestLivingEntitySensor.patch similarity index 98% rename from leaf-server/minecraft-patches/features/0089-Smart-sort-entities-in-NearestLivingEntitySensor.patch rename to leaf-server/minecraft-patches/features/0088-Smart-sort-entities-in-NearestLivingEntitySensor.patch index bd250b86..3a84fdd6 100644 --- a/leaf-server/minecraft-patches/features/0089-Smart-sort-entities-in-NearestLivingEntitySensor.patch +++ b/leaf-server/minecraft-patches/features/0088-Smart-sort-entities-in-NearestLivingEntitySensor.patch @@ -14,7 +14,7 @@ In non-strict testing, this can give ~20-40% improvement (54MSPT -> 44MSPT), under 625 villagers situation. diff --git a/net/minecraft/world/entity/ai/sensing/NearestLivingEntitySensor.java b/net/minecraft/world/entity/ai/sensing/NearestLivingEntitySensor.java -index b0c5e41fefc7c9adf1a61bd5b52861736657d37e..4898381d51cd9ea321ed75c5c253de96bdd46f7d 100644 +index b0c5e41fefc7c9adf1a61bd5b52861736657d37e..66374b79ade5cd10fa6e1d9187bf6b1112da4827 100644 --- a/net/minecraft/world/entity/ai/sensing/NearestLivingEntitySensor.java +++ b/net/minecraft/world/entity/ai/sensing/NearestLivingEntitySensor.java @@ -13,6 +13,21 @@ import net.minecraft.world.entity.ai.memory.NearestVisibleLivingEntities; diff --git a/leaf-server/minecraft-patches/features/0090-Further-reduce-memory-footprint-of-CompoundTag.patch b/leaf-server/minecraft-patches/features/0089-Further-reduce-memory-footprint-of-CompoundTag.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0090-Further-reduce-memory-footprint-of-CompoundTag.patch rename to leaf-server/minecraft-patches/features/0089-Further-reduce-memory-footprint-of-CompoundTag.patch diff --git a/leaf-server/minecraft-patches/features/0091-Optimize-Entity-distanceToSqr.patch b/leaf-server/minecraft-patches/features/0090-Optimize-Entity-distanceToSqr.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0091-Optimize-Entity-distanceToSqr.patch rename to leaf-server/minecraft-patches/features/0090-Optimize-Entity-distanceToSqr.patch diff --git a/leaf-server/minecraft-patches/features/0092-EMC-Don-t-use-snapshots-for-TileEntity-getOwner.patch b/leaf-server/minecraft-patches/features/0091-EMC-Don-t-use-snapshots-for-TileEntity-getOwner.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0092-EMC-Don-t-use-snapshots-for-TileEntity-getOwner.patch rename to leaf-server/minecraft-patches/features/0091-EMC-Don-t-use-snapshots-for-TileEntity-getOwner.patch diff --git a/leaf-server/minecraft-patches/features/0093-Cache-tile-entity-position.patch b/leaf-server/minecraft-patches/features/0092-Cache-tile-entity-position.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0093-Cache-tile-entity-position.patch rename to leaf-server/minecraft-patches/features/0092-Cache-tile-entity-position.patch diff --git a/leaf-server/minecraft-patches/features/0094-TT20-Lag-compensation.patch b/leaf-server/minecraft-patches/features/0093-TT20-Lag-compensation.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0094-TT20-Lag-compensation.patch rename to leaf-server/minecraft-patches/features/0093-TT20-Lag-compensation.patch diff --git a/leaf-server/minecraft-patches/features/0095-C2ME-Reduce-Allocations.patch b/leaf-server/minecraft-patches/features/0094-C2ME-Reduce-Allocations.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0095-C2ME-Reduce-Allocations.patch rename to leaf-server/minecraft-patches/features/0094-C2ME-Reduce-Allocations.patch diff --git a/leaf-server/minecraft-patches/features/0096-Lithium-Skip-unnecessary-calculations-if-player-is-n.patch b/leaf-server/minecraft-patches/features/0095-Lithium-Skip-unnecessary-calculations-if-player-is-n.patch similarity index 94% rename from leaf-server/minecraft-patches/features/0096-Lithium-Skip-unnecessary-calculations-if-player-is-n.patch rename to leaf-server/minecraft-patches/features/0095-Lithium-Skip-unnecessary-calculations-if-player-is-n.patch index 06d5209c..60526426 100644 --- a/leaf-server/minecraft-patches/features/0096-Lithium-Skip-unnecessary-calculations-if-player-is-n.patch +++ b/leaf-server/minecraft-patches/features/0095-Lithium-Skip-unnecessary-calculations-if-player-is-n.patch @@ -12,7 +12,7 @@ As part of: Lithium (https://github.com/CaffeineMC/lithium-fabric) Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html) diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java -index 6aa4153a5368645ad3f1a0b879428f9a60d8fbc6..4819ff258b3abffcbf8a443b157c3a28afd1c52a 100644 +index a7f87ba5a447be8bd1a4029da999aca34a583b5e..4c9c41b3d0f8752e6dc60c513a951b79945a4549 100644 --- a/net/minecraft/world/entity/LivingEntity.java +++ b/net/minecraft/world/entity/LivingEntity.java @@ -2732,6 +2732,7 @@ public abstract class LivingEntity extends Entity implements Attackable { diff --git a/leaf-server/minecraft-patches/features/0097-Lithium-fast-util.patch b/leaf-server/minecraft-patches/features/0096-Lithium-fast-util.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0097-Lithium-fast-util.patch rename to leaf-server/minecraft-patches/features/0096-Lithium-fast-util.patch diff --git a/leaf-server/minecraft-patches/features/0098-Lithium-CompactSineLUT.patch b/leaf-server/minecraft-patches/features/0097-Lithium-CompactSineLUT.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0098-Lithium-CompactSineLUT.patch rename to leaf-server/minecraft-patches/features/0097-Lithium-CompactSineLUT.patch diff --git a/leaf-server/minecraft-patches/features/0099-Lithium-cached-iterate-outwards.patch b/leaf-server/minecraft-patches/features/0098-Lithium-cached-iterate-outwards.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0099-Lithium-cached-iterate-outwards.patch rename to leaf-server/minecraft-patches/features/0098-Lithium-cached-iterate-outwards.patch diff --git a/leaf-server/minecraft-patches/features/0100-Smooth-teleport-config.patch b/leaf-server/minecraft-patches/features/0099-Smooth-teleport-config.patch similarity index 95% rename from leaf-server/minecraft-patches/features/0100-Smooth-teleport-config.patch rename to leaf-server/minecraft-patches/features/0099-Smooth-teleport-config.patch index 44892a15..6b809f32 100644 --- a/leaf-server/minecraft-patches/features/0100-Smooth-teleport-config.patch +++ b/leaf-server/minecraft-patches/features/0099-Smooth-teleport-config.patch @@ -9,7 +9,7 @@ happen but the visual "refresh" of a world change is hidden. Depending on the de this can act as a "smooth teleport" to a world if the new world is very similar looking to the old one. diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java -index d0c4c46c38eeb923b5352a0969e2e4ef8937d9f7..b4ca5d43401d03bf1e9580e95fd473b7c28916ac 100644 +index e1a1bddfc11da20f3a1b9a2773b19d4317fac914..01c30802a1d0127f2ed36efa7511c2ac6b2b5cfa 100644 --- a/net/minecraft/server/level/ServerPlayer.java +++ b/net/minecraft/server/level/ServerPlayer.java @@ -1468,6 +1468,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc @@ -30,10 +30,10 @@ index d0c4c46c38eeb923b5352a0969e2e4ef8937d9f7..b4ca5d43401d03bf1e9580e95fd473b7 level.addDuringTeleport(this); this.triggerDimensionChangeTriggers(serverLevel); diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java -index 7fe5b9006de5c1a549aa3fc1a0947f3042b15c56..75e5540337706f1be213adfc778e6ebd32409f96 100644 +index 6327d508252b35fcbd2daebad078f00d44291c6e..e686d435dcca9dc74a0d569878e51f643210653c 100644 --- a/net/minecraft/server/players/PlayerList.java +++ b/net/minecraft/server/players/PlayerList.java -@@ -954,11 +954,11 @@ public abstract class PlayerList { +@@ -955,11 +955,11 @@ public abstract class PlayerList { byte b = (byte)(keepInventory ? 1 : 0); ServerLevel serverLevel = serverPlayer.serverLevel(); LevelData levelData = serverLevel.getLevelData(); diff --git a/leaf-server/minecraft-patches/features/0101-Use-faster-and-thread-safe-ban-list-date-format-pars.patch b/leaf-server/minecraft-patches/features/0100-Use-faster-and-thread-safe-ban-list-date-format-pars.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0101-Use-faster-and-thread-safe-ban-list-date-format-pars.patch rename to leaf-server/minecraft-patches/features/0100-Use-faster-and-thread-safe-ban-list-date-format-pars.patch diff --git a/leaf-server/minecraft-patches/features/0102-Collect-then-startEachNonRunningBehavior-in-Brain.patch b/leaf-server/minecraft-patches/features/0101-Collect-then-startEachNonRunningBehavior-in-Brain.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0102-Collect-then-startEachNonRunningBehavior-in-Brain.patch rename to leaf-server/minecraft-patches/features/0101-Collect-then-startEachNonRunningBehavior-in-Brain.patch diff --git a/leaf-server/minecraft-patches/features/0103-Lithium-equipment-tracking.patch b/leaf-server/minecraft-patches/features/0102-Lithium-equipment-tracking.patch similarity index 99% rename from leaf-server/minecraft-patches/features/0103-Lithium-equipment-tracking.patch rename to leaf-server/minecraft-patches/features/0102-Lithium-equipment-tracking.patch index cc825b97..0762e577 100644 --- a/leaf-server/minecraft-patches/features/0103-Lithium-equipment-tracking.patch +++ b/leaf-server/minecraft-patches/features/0102-Lithium-equipment-tracking.patch @@ -76,7 +76,7 @@ index a8c6549f772208cd543607224fef2c2389b14f24..709631db548a16a969a373e26ebbcd69 public boolean equals(Object other) { return this == other diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java -index ead6a4823d7681109bc0888d0a1fc0d73dad3c98..9a3b27457ff62dfb2ead9c114c287f55504f19f6 100644 +index 4c9c41b3d0f8752e6dc60c513a951b79945a4549..7d88bcb727b53217f10472d73726a96f54ebc31d 100644 --- a/net/minecraft/world/entity/LivingEntity.java +++ b/net/minecraft/world/entity/LivingEntity.java @@ -159,7 +159,7 @@ import org.bukkit.event.entity.EntityTeleportEvent; diff --git a/leaf-server/minecraft-patches/features/0104-C2ME-Optimize-world-gen-math.patch b/leaf-server/minecraft-patches/features/0103-C2ME-Optimize-world-gen-math.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0104-C2ME-Optimize-world-gen-math.patch rename to leaf-server/minecraft-patches/features/0103-C2ME-Optimize-world-gen-math.patch diff --git a/leaf-server/minecraft-patches/features/0105-Cache-chunk-key.patch b/leaf-server/minecraft-patches/features/0104-Cache-chunk-key.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0105-Cache-chunk-key.patch rename to leaf-server/minecraft-patches/features/0104-Cache-chunk-key.patch diff --git a/leaf-server/minecraft-patches/features/0106-Cache-random-tick-block-status.patch b/leaf-server/minecraft-patches/features/0105-Cache-random-tick-block-status.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0106-Cache-random-tick-block-status.patch rename to leaf-server/minecraft-patches/features/0105-Cache-random-tick-block-status.patch diff --git a/leaf-server/minecraft-patches/features/0107-Cache-part-of-canHoldFluid-result.patch b/leaf-server/minecraft-patches/features/0106-Cache-part-of-canHoldFluid-result.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0107-Cache-part-of-canHoldFluid-result.patch rename to leaf-server/minecraft-patches/features/0106-Cache-part-of-canHoldFluid-result.patch diff --git a/leaf-server/minecraft-patches/features/0108-Configurable-tripwire-dupe.patch b/leaf-server/minecraft-patches/features/0107-Configurable-tripwire-dupe.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0108-Configurable-tripwire-dupe.patch rename to leaf-server/minecraft-patches/features/0107-Configurable-tripwire-dupe.patch diff --git a/leaf-server/src/main/java/org/dreeam/leaf/config/modules/gameplay/DisableMovedWronglyThreshold.java b/leaf-server/src/main/java/org/dreeam/leaf/config/modules/gameplay/DisableMovedWronglyThreshold.java deleted file mode 100644 index 31517234..00000000 --- a/leaf-server/src/main/java/org/dreeam/leaf/config/modules/gameplay/DisableMovedWronglyThreshold.java +++ /dev/null @@ -1,22 +0,0 @@ -package org.dreeam.leaf.config.modules.gameplay; - -import org.dreeam.leaf.config.ConfigModules; -import org.dreeam.leaf.config.EnumConfigCategory; - -public class DisableMovedWronglyThreshold extends ConfigModules { - - public String getBasePath() { - return EnumConfigCategory.GAMEPLAY.getBaseKeyName() + ".player"; - } - - public static boolean enabled = false; - - @Override - public void onLoaded() { - enabled = config.getBoolean(getBasePath() + ".disable-moved-wrongly-threshold", enabled, - config.pickStringRegionBased( - "Disable moved quickly/wrongly checks.", - "关闭 moved wrongly/too quickly! 警告." - )); - } -} diff --git a/leaf-server/src/main/java/org/leavesmc/leaves/bot/BotStatsCounter.java b/leaf-server/src/main/java/org/leavesmc/leaves/bot/BotStatsCounter.java index 5bd34353..10494446 100644 --- a/leaf-server/src/main/java/org/leavesmc/leaves/bot/BotStatsCounter.java +++ b/leaf-server/src/main/java/org/leavesmc/leaves/bot/BotStatsCounter.java @@ -5,6 +5,7 @@ import net.minecraft.server.MinecraftServer; import net.minecraft.stats.ServerStatsCounter; import net.minecraft.stats.Stat; import net.minecraft.world.entity.player.Player; +import org.jetbrains.annotations.NotNull; import java.io.File; @@ -18,21 +19,18 @@ public class BotStatsCounter extends ServerStatsCounter { @Override public void save() { - } @Override - public void setValue(Player player, Stat stat, int value) { - + public void setValue(@NotNull Player player, @NotNull Stat stat, int value) { } @Override - public void parseLocal(DataFixer dataFixer, String json) { - + public void parseLocal(@NotNull DataFixer dataFixer, @NotNull String json) { } @Override - public int getValue(Stat stat) { + public int getValue(@NotNull Stat stat) { return 0; } } diff --git a/leaf-server/src/main/java/org/leavesmc/leaves/protocol/AppleSkinProtocol.java b/leaf-server/src/main/java/org/leavesmc/leaves/protocol/AppleSkinProtocol.java index f753b83d..d9ae61b8 100644 --- a/leaf-server/src/main/java/org/leavesmc/leaves/protocol/AppleSkinProtocol.java +++ b/leaf-server/src/main/java/org/leavesmc/leaves/protocol/AppleSkinProtocol.java @@ -38,8 +38,8 @@ public class AppleSkinProtocol { } @Contract("_ -> new") - public static @NotNull ResourceLocation id(String path) { - return new ResourceLocation(PROTOCOL_ID, path); + public static ResourceLocation id(String path) { + return ResourceLocation.tryBuild(PROTOCOL_ID, path); } @ProtocolHandler.PlayerJoin diff --git a/leaf-server/src/main/java/org/leavesmc/leaves/protocol/XaeroMapProtocol.java b/leaf-server/src/main/java/org/leavesmc/leaves/protocol/XaeroMapProtocol.java index 5ef19098..0aef5633 100644 --- a/leaf-server/src/main/java/org/leavesmc/leaves/protocol/XaeroMapProtocol.java +++ b/leaf-server/src/main/java/org/leavesmc/leaves/protocol/XaeroMapProtocol.java @@ -21,13 +21,13 @@ public class XaeroMapProtocol { } @Contract("_ -> new") - public static @NotNull ResourceLocation idMini(String path) { - return new ResourceLocation(PROTOCOL_ID_MINI, path); + public static ResourceLocation idMini(String path) { + return ResourceLocation.tryBuild(PROTOCOL_ID_MINI, path); } @Contract("_ -> new") - public static @NotNull ResourceLocation idWorld(String path) { - return new ResourceLocation(PROTOCOL_ID_WORLD, path); + public static ResourceLocation idWorld(String path) { + return ResourceLocation.tryBuild(PROTOCOL_ID_WORLD, path); } public static void onSendWorldInfo(@NotNull ServerPlayer player) { diff --git a/leaf-server/src/main/java/org/leavesmc/leaves/protocol/core/LeavesProtocolManager.java b/leaf-server/src/main/java/org/leavesmc/leaves/protocol/core/LeavesProtocolManager.java index c72b096c..c3c86b0b 100644 --- a/leaf-server/src/main/java/org/leavesmc/leaves/protocol/core/LeavesProtocolManager.java +++ b/leaf-server/src/main/java/org/leavesmc/leaves/protocol/core/LeavesProtocolManager.java @@ -173,7 +173,7 @@ public class LeavesProtocolManager { if (receiver.sendFabricRegister() && !receiver.ignoreId()) { for (String payloadId : receiver.payloadId()) { for (String namespace : protocol.namespace()) { - ALL_KNOWN_ID.add(new ResourceLocation(namespace, payloadId)); + ALL_KNOWN_ID.add(ResourceLocation.tryBuild(namespace, payloadId)); } } } @@ -323,7 +323,6 @@ public class LeavesProtocolManager { } public record EmptyPayload(ResourceLocation id) implements LeavesCustomPayload { - @New public EmptyPayload(ResourceLocation location, FriendlyByteBuf buf) { this(location); @@ -336,7 +335,6 @@ public class LeavesProtocolManager { public record LeavesPayload(FriendlyByteBuf data, ResourceLocation id) implements LeavesCustomPayload { - @New public LeavesPayload(ResourceLocation location, FriendlyByteBuf buf) { this(new FriendlyByteBuf(buf.readBytes(buf.readableBytes())), location); diff --git a/leaf-server/src/main/java/org/leavesmc/leaves/protocol/jade/JadeProtocol.java b/leaf-server/src/main/java/org/leavesmc/leaves/protocol/jade/JadeProtocol.java index f7371f2b..4a52e20d 100644 --- a/leaf-server/src/main/java/org/leavesmc/leaves/protocol/jade/JadeProtocol.java +++ b/leaf-server/src/main/java/org/leavesmc/leaves/protocol/jade/JadeProtocol.java @@ -4,6 +4,7 @@ import net.minecraft.core.BlockPos; import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.core.registries.Registries; import net.minecraft.nbt.CompoundTag; +import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.server.MinecraftServer; import net.minecraft.server.level.ServerPlayer; @@ -11,6 +12,7 @@ import net.minecraft.util.Mth; import net.minecraft.world.entity.AgeableMob; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.entity.Mob; import net.minecraft.world.entity.animal.Animal; import net.minecraft.world.entity.animal.Chicken; import net.minecraft.world.entity.animal.allay.Allay; @@ -41,10 +43,11 @@ import org.leavesmc.leaves.protocol.core.ProtocolHandler; import org.leavesmc.leaves.protocol.core.ProtocolUtils; import org.leavesmc.leaves.protocol.jade.accessor.BlockAccessor; import org.leavesmc.leaves.protocol.jade.accessor.EntityAccessor; +import org.leavesmc.leaves.protocol.jade.payload.ClientHandshakePayload; import org.leavesmc.leaves.protocol.jade.payload.ReceiveDataPayload; import org.leavesmc.leaves.protocol.jade.payload.RequestBlockPayload; import org.leavesmc.leaves.protocol.jade.payload.RequestEntityPayload; -import org.leavesmc.leaves.protocol.jade.payload.ServerPingPayload; +import org.leavesmc.leaves.protocol.jade.payload.ServerHandshakePayload; import org.leavesmc.leaves.protocol.jade.provider.IJadeProvider; import org.leavesmc.leaves.protocol.jade.provider.IServerDataProvider; import org.leavesmc.leaves.protocol.jade.provider.IServerExtensionProvider; @@ -66,6 +69,7 @@ import org.leavesmc.leaves.protocol.jade.provider.entity.AnimalOwnerProvider; import org.leavesmc.leaves.protocol.jade.provider.entity.MobBreedingProvider; import org.leavesmc.leaves.protocol.jade.provider.entity.MobGrowthProvider; import org.leavesmc.leaves.protocol.jade.provider.entity.NextEntityDropProvider; +import org.leavesmc.leaves.protocol.jade.provider.entity.PetArmorProvider; import org.leavesmc.leaves.protocol.jade.provider.entity.StatusEffectsProvider; import org.leavesmc.leaves.protocol.jade.provider.entity.ZombieVillagerProvider; import org.leavesmc.leaves.protocol.jade.util.HierarchyLookup; @@ -75,7 +79,9 @@ import org.leavesmc.leaves.protocol.jade.util.PriorityStore; import org.leavesmc.leaves.protocol.jade.util.WrappedHierarchyLookup; import java.util.Collections; +import java.util.HashSet; import java.util.List; +import java.util.Set; @LeavesProtocol(namespace = "jade") public class JadeProtocol { @@ -84,18 +90,20 @@ public class JadeProtocol { private static List shearableBlocks = null; public static final String PROTOCOL_ID = "jade"; + public static final String PROTOCOL_VERSION = "7"; public static final HierarchyLookup> entityDataProviders = new HierarchyLookup<>(Entity.class); public static final PairHierarchyLookup> blockDataProviders = new PairHierarchyLookup<>(new HierarchyLookup<>(Block.class), new HierarchyLookup<>(BlockEntity.class)); public static final WrappedHierarchyLookup> itemStorageProviders = WrappedHierarchyLookup.forAccessor(); + private static final Set enabledPlayers = new HashSet<>(); public static boolean shouldEnable() { return org.dreeam.leaf.config.modules.network.ProtocolSupport.jadeProtocol; } @Contract("_ -> new") - public static @NotNull ResourceLocation id(String path) { - return new ResourceLocation(PROTOCOL_ID, path); + public static ResourceLocation id(String path) { + return ResourceLocation.tryBuild(PROTOCOL_ID, path); } @Contract("_ -> new") @@ -124,6 +132,7 @@ public class JadeProtocol { entityDataProviders.register(Tadpole.class, MobGrowthProvider.INSTANCE); entityDataProviders.register(Animal.class, MobBreedingProvider.INSTANCE); entityDataProviders.register(Allay.class, MobBreedingProvider.INSTANCE); + entityDataProviders.register(Mob.class, PetArmorProvider.INSTANCE); entityDataProviders.register(Chicken.class, NextEntityDropProvider.INSTANCE); entityDataProviders.register(Armadillo.class, NextEntityDropProvider.INSTANCE); @@ -152,20 +161,22 @@ public class JadeProtocol { entityDataProviders.loadComplete(priorities); itemStorageProviders.loadComplete(priorities); - try { - shearableBlocks = Collections.unmodifiableList(LootTableMineableCollector.execute( - MinecraftServer.getServer().reloadableRegistries().lookup().lookupOrThrow(Registries.LOOT_TABLE), - Items.SHEARS.getDefaultInstance() - )); - } catch (Throwable ignore) { - shearableBlocks = List.of(); - LeavesLogger.LOGGER.severe("Failed to collect shearable blocks"); - } + rebuildShearableBlocks(); } - @ProtocolHandler.PlayerJoin - public static void onPlayerJoin(ServerPlayer player) { - sendPingPacket(player); + @ProtocolHandler.PayloadReceiver(payload = ClientHandshakePayload.class, payloadId = "client_handshake") + public static void clientHandshake(ServerPlayer player, ClientHandshakePayload payload) { + if (!payload.protocolVersion().equals(PROTOCOL_VERSION)) { + player.sendSystemMessage(Component.literal("You are using a different version of Jade than the server. Please update Jade or report to the server operator").withColor(0xff0000)); + return; + } + ProtocolUtils.sendPayloadPacket(player, new ServerHandshakePayload(Collections.emptyMap(), shearableBlocks, blockDataProviders.mappedIds(), entityDataProviders.mappedIds())); + enabledPlayers.add(player); + } + + @ProtocolHandler.PlayerLeave + public static void onPlayerLeave(ServerPlayer player) { + enabledPlayers.remove(player); } @ProtocolHandler.PayloadReceiver(payload = RequestEntityPayload.class, payloadId = "request_entity") @@ -255,17 +266,22 @@ public class JadeProtocol { @ProtocolHandler.ReloadServer public static void onServerReload() { if (org.dreeam.leaf.config.modules.network.ProtocolSupport.jadeProtocol) { - enableAllPlayer(); + rebuildShearableBlocks(); + for (ServerPlayer player : enabledPlayers) { + ProtocolUtils.sendPayloadPacket(player, new ServerHandshakePayload(Collections.emptyMap(), shearableBlocks, blockDataProviders.mappedIds(), entityDataProviders.mappedIds())); + } } } - public static void enableAllPlayer() { - for (ServerPlayer player : MinecraftServer.getServer().getPlayerList().players) { - sendPingPacket(player); + private static void rebuildShearableBlocks() { + try { + shearableBlocks = Collections.unmodifiableList(LootTableMineableCollector.execute( + MinecraftServer.getServer().reloadableRegistries().lookup().lookupOrThrow(Registries.LOOT_TABLE), + Items.SHEARS.getDefaultInstance() + )); + } catch (Throwable ignore) { + shearableBlocks = List.of(); + LeavesLogger.LOGGER.severe("Failed to collect shearable blocks"); } } - - public static void sendPingPacket(ServerPlayer player) { - ProtocolUtils.sendPayloadPacket(player, new ServerPingPayload(Collections.emptyMap(), shearableBlocks, blockDataProviders.mappedIds(), entityDataProviders.mappedIds())); - } } diff --git a/leaf-server/src/main/java/org/leavesmc/leaves/protocol/jade/accessor/AccessorImpl.java b/leaf-server/src/main/java/org/leavesmc/leaves/protocol/jade/accessor/AccessorImpl.java index a04fbb45..7e57bd40 100644 --- a/leaf-server/src/main/java/org/leavesmc/leaves/protocol/jade/accessor/AccessorImpl.java +++ b/leaf-server/src/main/java/org/leavesmc/leaves/protocol/jade/accessor/AccessorImpl.java @@ -1,9 +1,5 @@ package org.leavesmc.leaves.protocol.jade.accessor; -import java.util.function.Supplier; - -import org.apache.commons.lang3.ArrayUtils; - import io.netty.buffer.Unpooled; import net.minecraft.nbt.ByteArrayTag; import net.minecraft.nbt.Tag; @@ -12,6 +8,9 @@ import net.minecraft.network.codec.StreamEncoder; import net.minecraft.world.entity.player.Player; import net.minecraft.world.level.Level; import net.minecraft.world.phys.HitResult; +import org.apache.commons.lang3.ArrayUtils; + +import java.util.function.Supplier; public abstract class AccessorImpl implements Accessor { diff --git a/leaf-server/src/main/java/org/leavesmc/leaves/protocol/jade/payload/ClientHandshakePayload.java b/leaf-server/src/main/java/org/leavesmc/leaves/protocol/jade/payload/ClientHandshakePayload.java new file mode 100644 index 00000000..3d40670d --- /dev/null +++ b/leaf-server/src/main/java/org/leavesmc/leaves/protocol/jade/payload/ClientHandshakePayload.java @@ -0,0 +1,35 @@ +package org.leavesmc.leaves.protocol.jade.payload; + +import net.minecraft.network.FriendlyByteBuf; +import net.minecraft.network.RegistryFriendlyByteBuf; +import net.minecraft.network.codec.ByteBufCodecs; +import net.minecraft.network.codec.StreamCodec; +import net.minecraft.resources.ResourceLocation; +import org.leavesmc.leaves.protocol.core.LeavesCustomPayload; +import org.leavesmc.leaves.protocol.core.ProtocolUtils; +import org.leavesmc.leaves.protocol.jade.JadeProtocol; + +public record ClientHandshakePayload(String protocolVersion) implements LeavesCustomPayload { + + private static final ResourceLocation PACKET_CLIENT_HANDSHAKE = JadeProtocol.id("client_handshake"); + + private static final StreamCodec CODEC = StreamCodec.composite( + ByteBufCodecs.STRING_UTF8, + ClientHandshakePayload::protocolVersion, + ClientHandshakePayload::new); + + @Override + public void write(FriendlyByteBuf buf) { + CODEC.encode(ProtocolUtils.decorate(buf), this); + } + + @Override + public ResourceLocation id() { + return PACKET_CLIENT_HANDSHAKE; + } + + @New + public static ClientHandshakePayload create(ResourceLocation location, FriendlyByteBuf buf) { + return CODEC.decode(ProtocolUtils.decorate(buf)); + } +} diff --git a/leaf-server/src/main/java/org/leavesmc/leaves/protocol/jade/payload/RequestBlockPayload.java b/leaf-server/src/main/java/org/leavesmc/leaves/protocol/jade/payload/RequestBlockPayload.java index 480ec35f..3cea446e 100644 --- a/leaf-server/src/main/java/org/leavesmc/leaves/protocol/jade/payload/RequestBlockPayload.java +++ b/leaf-server/src/main/java/org/leavesmc/leaves/protocol/jade/payload/RequestBlockPayload.java @@ -6,10 +6,10 @@ import net.minecraft.network.RegistryFriendlyByteBuf; import net.minecraft.network.codec.ByteBufCodecs; import net.minecraft.network.codec.StreamCodec; import net.minecraft.resources.ResourceLocation; -import net.minecraft.server.MinecraftServer; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.leavesmc.leaves.protocol.core.LeavesCustomPayload; +import org.leavesmc.leaves.protocol.core.ProtocolUtils; import org.leavesmc.leaves.protocol.jade.JadeProtocol; import org.leavesmc.leaves.protocol.jade.accessor.BlockAccessor; import org.leavesmc.leaves.protocol.jade.accessor.BlockAccessorImpl; @@ -35,12 +35,12 @@ public record RequestBlockPayload(BlockAccessorImpl.SyncData data, List<@Nullabl @Override public void write(FriendlyByteBuf buf) { - CODEC.encode(new RegistryFriendlyByteBuf(buf, MinecraftServer.getServer().registryAccess()), this); + CODEC.encode(ProtocolUtils.decorate(buf), this); } @New public static RequestBlockPayload create(ResourceLocation location, FriendlyByteBuf buf) { - return CODEC.decode(new RegistryFriendlyByteBuf(buf, MinecraftServer.getServer().registryAccess())); + return CODEC.decode(ProtocolUtils.decorate(buf)); } @Override diff --git a/leaf-server/src/main/java/org/leavesmc/leaves/protocol/jade/payload/RequestEntityPayload.java b/leaf-server/src/main/java/org/leavesmc/leaves/protocol/jade/payload/RequestEntityPayload.java index 3ac45267..fcd6df02 100644 --- a/leaf-server/src/main/java/org/leavesmc/leaves/protocol/jade/payload/RequestEntityPayload.java +++ b/leaf-server/src/main/java/org/leavesmc/leaves/protocol/jade/payload/RequestEntityPayload.java @@ -6,10 +6,10 @@ import net.minecraft.network.RegistryFriendlyByteBuf; import net.minecraft.network.codec.ByteBufCodecs; import net.minecraft.network.codec.StreamCodec; import net.minecraft.resources.ResourceLocation; -import net.minecraft.server.MinecraftServer; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.leavesmc.leaves.protocol.core.LeavesCustomPayload; +import org.leavesmc.leaves.protocol.core.ProtocolUtils; import org.leavesmc.leaves.protocol.jade.JadeProtocol; import org.leavesmc.leaves.protocol.jade.accessor.EntityAccessor; import org.leavesmc.leaves.protocol.jade.accessor.EntityAccessorImpl; @@ -38,12 +38,12 @@ public record RequestEntityPayload(EntityAccessorImpl.SyncData data, @Override public void write(FriendlyByteBuf buf) { - CODEC.encode(new RegistryFriendlyByteBuf(buf, MinecraftServer.getServer().registryAccess()), this); + CODEC.encode(ProtocolUtils.decorate(buf), this); } @New public static RequestEntityPayload create(ResourceLocation location, FriendlyByteBuf buf) { - return CODEC.decode(new RegistryFriendlyByteBuf(buf, MinecraftServer.getServer().registryAccess())); + return CODEC.decode(ProtocolUtils.decorate(buf)); } @Override diff --git a/leaf-server/src/main/java/org/leavesmc/leaves/protocol/jade/payload/ServerPingPayload.java b/leaf-server/src/main/java/org/leavesmc/leaves/protocol/jade/payload/ServerHandshakePayload.java similarity index 64% rename from leaf-server/src/main/java/org/leavesmc/leaves/protocol/jade/payload/ServerPingPayload.java rename to leaf-server/src/main/java/org/leavesmc/leaves/protocol/jade/payload/ServerHandshakePayload.java index fbb3e81c..049bd6c2 100644 --- a/leaf-server/src/main/java/org/leavesmc/leaves/protocol/jade/payload/ServerPingPayload.java +++ b/leaf-server/src/main/java/org/leavesmc/leaves/protocol/jade/payload/ServerHandshakePayload.java @@ -8,9 +8,9 @@ import net.minecraft.network.RegistryFriendlyByteBuf; import net.minecraft.network.codec.ByteBufCodecs; import net.minecraft.network.codec.StreamCodec; import net.minecraft.resources.ResourceLocation; -import net.minecraft.server.MinecraftServer; import net.minecraft.world.level.block.Block; import org.leavesmc.leaves.protocol.core.LeavesCustomPayload; +import org.leavesmc.leaves.protocol.core.ProtocolUtils; import org.leavesmc.leaves.protocol.jade.JadeProtocol; import java.util.List; @@ -18,28 +18,25 @@ import java.util.Map; import static org.leavesmc.leaves.protocol.jade.util.JadeCodec.PRIMITIVE_STREAM_CODEC; -public record ServerPingPayload( +public record ServerHandshakePayload(Map serverConfig, List shearableBlocks, + List blockProviderIds, + List entityProviderIds) implements LeavesCustomPayload { - Map serverConfig, - List shearableBlocks, - List blockProviderIds, - List entityProviderIds) implements LeavesCustomPayload { - - private static final ResourceLocation PACKET_SERVER_HANDSHAKE = JadeProtocol.id("server_ping_v1"); - private static final StreamCodec CODEC = StreamCodec.composite( + private static final ResourceLocation PACKET_SERVER_HANDSHAKE = JadeProtocol.id("server_handshake"); + private static final StreamCodec CODEC = StreamCodec.composite( ByteBufCodecs.map(Maps::newHashMapWithExpectedSize, ResourceLocation.STREAM_CODEC, PRIMITIVE_STREAM_CODEC), - ServerPingPayload::serverConfig, + ServerHandshakePayload::serverConfig, ByteBufCodecs.registry(Registries.BLOCK).apply(ByteBufCodecs.list()), - ServerPingPayload::shearableBlocks, + ServerHandshakePayload::shearableBlocks, ByteBufCodecs.list().apply(ResourceLocation.STREAM_CODEC), - ServerPingPayload::blockProviderIds, + ServerHandshakePayload::blockProviderIds, ByteBufCodecs.list().apply(ResourceLocation.STREAM_CODEC), - ServerPingPayload::entityProviderIds, - ServerPingPayload::new); + ServerHandshakePayload::entityProviderIds, + ServerHandshakePayload::new); @Override public void write(FriendlyByteBuf buf) { - CODEC.encode(new RegistryFriendlyByteBuf(buf, MinecraftServer.getServer().registryAccess()), this); + CODEC.encode(ProtocolUtils.decorate(buf), this); } @Override diff --git a/leaf-server/src/main/java/org/leavesmc/leaves/protocol/jade/provider/entity/PetArmorProvider.java b/leaf-server/src/main/java/org/leavesmc/leaves/protocol/jade/provider/entity/PetArmorProvider.java new file mode 100644 index 00000000..cb8d1736 --- /dev/null +++ b/leaf-server/src/main/java/org/leavesmc/leaves/protocol/jade/provider/entity/PetArmorProvider.java @@ -0,0 +1,35 @@ +package org.leavesmc.leaves.protocol.jade.provider.entity; + +import net.minecraft.network.RegistryFriendlyByteBuf; +import net.minecraft.network.codec.StreamCodec; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.entity.Mob; +import net.minecraft.world.item.ItemStack; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import org.leavesmc.leaves.protocol.jade.JadeProtocol; +import org.leavesmc.leaves.protocol.jade.accessor.EntityAccessor; +import org.leavesmc.leaves.protocol.jade.provider.StreamServerDataProvider; + +public enum PetArmorProvider implements StreamServerDataProvider { + INSTANCE; + + private static final ResourceLocation MC_PET_ARMOR = JadeProtocol.mc_id("pet_armor"); + + @Nullable + @Override + public ItemStack streamData(@NotNull EntityAccessor accessor) { + ItemStack armor = ((Mob) accessor.getEntity()).getBodyArmorItem(); + return armor.isEmpty() ? null : armor; + } + + @Override + public StreamCodec streamCodec() { + return ItemStack.OPTIONAL_STREAM_CODEC; + } + + @Override + public ResourceLocation getUid() { + return MC_PET_ARMOR; + } +} diff --git a/leaf-server/src/main/java/org/leavesmc/leaves/protocol/syncmatica/PacketType.java b/leaf-server/src/main/java/org/leavesmc/leaves/protocol/syncmatica/PacketType.java index 36c87c5c..d3643823 100644 --- a/leaf-server/src/main/java/org/leavesmc/leaves/protocol/syncmatica/PacketType.java +++ b/leaf-server/src/main/java/org/leavesmc/leaves/protocol/syncmatica/PacketType.java @@ -25,6 +25,6 @@ public enum PacketType { public final ResourceLocation identifier; PacketType(final String id) { - identifier = new ResourceLocation(SyncmaticaProtocol.PROTOCOL_ID, id); + identifier = ResourceLocation.tryBuild(SyncmaticaProtocol.PROTOCOL_ID, id); } } diff --git a/leaf-server/src/main/java/org/leavesmc/leaves/protocol/syncmatica/SyncmaticaPayload.java b/leaf-server/src/main/java/org/leavesmc/leaves/protocol/syncmatica/SyncmaticaPayload.java index cb5dffe8..8c6dd05c 100644 --- a/leaf-server/src/main/java/org/leavesmc/leaves/protocol/syncmatica/SyncmaticaPayload.java +++ b/leaf-server/src/main/java/org/leavesmc/leaves/protocol/syncmatica/SyncmaticaPayload.java @@ -7,7 +7,7 @@ import org.leavesmc.leaves.protocol.core.LeavesCustomPayload; public record SyncmaticaPayload(ResourceLocation packetType, FriendlyByteBuf data) implements LeavesCustomPayload { - private static final ResourceLocation NETWORK_ID = new ResourceLocation(SyncmaticaProtocol.PROTOCOL_ID, "main"); + private static final ResourceLocation NETWORK_ID = ResourceLocation.tryBuild(SyncmaticaProtocol.PROTOCOL_ID, "main"); @New public static SyncmaticaPayload decode(ResourceLocation location, FriendlyByteBuf buf) { diff --git a/leaf-server/src/main/java/org/leavesmc/leaves/replay/ServerPhotographer.java b/leaf-server/src/main/java/org/leavesmc/leaves/replay/ServerPhotographer.java index d8f8f071..d1eb8b9e 100644 --- a/leaf-server/src/main/java/org/leavesmc/leaves/replay/ServerPhotographer.java +++ b/leaf-server/src/main/java/org/leavesmc/leaves/replay/ServerPhotographer.java @@ -60,7 +60,7 @@ public class ServerPhotographer extends ServerPlayer { photographer.createState = state; photographer.recorder.start(); - MinecraftServer.getServer().getPlayerList().placeNewPhotographer(photographer.recorder, photographer, world, state.loc); + MinecraftServer.getServer().getPlayerList().placeNewPhotographer(photographer.recorder, photographer, world); photographer.serverLevel().chunkSource.move(photographer); photographer.setInvisible(true); photographers.add(photographer);