From 340edaf4d35b357161ad94f9f8bd2a3d78495d3c Mon Sep 17 00:00:00 2001 From: NONPLAYT Date: Tue, 21 Mar 2023 20:54:44 +0300 Subject: [PATCH] [ci-skip] finish patches --- README.md | 4 +- .../api/0003-EMC-Add-ChatColor.getById.patch | 33 +++ ...-PR-Add-Entity-hidden-by-default-API.patch | 64 ++++++ ...ptimise-player-list-ticksSpread-out-.patch | 69 ------ ...ick-function-tag-running-before-load.patch | 26 --- .../{ => server}/0002-Global-Eula-file.patch | 0 .../0004-Reduce-constants-allocations.patch | 0 .../0007-lithium-CompactSineLUT.patch | 0 .../0008-lithium-fast-retrieval.patch | 0 ...AI-goal-set-with-optimized-collectio.patch | 0 .../{ => server}/0060-lithium-gen.patch | 0 .../1.19.3}/0012-Remove-TickTask.patch | 0 .../0047-NoChatReports-Implementation.patch} | 8 +- .../api/0003-Update-Bungeecord-Chat-API.patch | 3 +- ...ver-showing-in-ping-before-server-fu.patch | 2 +- ...-Completely-remove-bootstrapExecutor.patch | 0 ...nc-chunk-writes-in-server.properties.patch | 0 patches/server/0001-Divine-Branding.patch | 16 +- patches/server/0005-lithium-fast-util.patch | 8 +- .../0006-lithium-HashedReferenceList.patch | 4 +- .../server/0007-Add-last-tick-time-API.patch | 8 +- ...op-wasting-resources-on-JsonList-get.patch | 4 +- ...11-Don-t-create-new-random-instance.patch} | 6 +- ...012-Fix-rotating-UP-DOWN-CW-and-CCW.patch} | 6 +- ...-vanilla-command-permission-handler.patch} | 0 ... => 0014-Remove-Spigot-tick-limiter.patch} | 6 +- ....patch => 0015-Don-t-save-Fireworks.patch} | 4 +- ...patch => 0016-Paper-PR-BoneMeal-API.patch} | 4 +- ...Do-not-drop-items-from-Give-command.patch} | 2 +- ...ow-rotation-when-shearing-mooshroom.patch} | 0 ...ould-check-if-entity-can-use-portal.patch} | 2 +- ...ws-should-not-reset-despawn-counter.patch} | 2 +- ...> 0021-Skip-cloning-loot-parameters.patch} | 2 +- ...nt-eat-blocks-in-non-ticking-chunks.patch} | 4 +- ...-carpetfixes-BiomeAccess-prediction.patch} | 0 ...-121706.patch => 0024-Fix-MC-121706.patch} | 0 ...er-saturation-depleting-on-peaceful.patch} | 4 +- ... 0026-Fix-mobs-attacking-themselves.patch} | 0 ...ch => 0027-PaperPR-Optimize-VarInts.patch} | 6 +- ...-238526.patch => 0028-Fix-MC-238526.patch} | 4 +- ...tch => 0029-lithium-cached-hashcode.patch} | 6 +- ...kip-entity-move-if-movement-is-zero.patch} | 6 +- ...n.patch => 0031-lithium-suffocation.patch} | 4 +- ...032-lithium-ai.sensor.secondary_poi.patch} | 0 ...store-gamerules-in-fastutil-hashmap.patch} | 4 +- ...034-lithium-precompute-shape-arrays.patch} | 4 +- ...35-lithium-entity.fast_elytra_check.patch} | 4 +- ...0036-lithium-entity.fast_hand_swing.patch} | 4 +- ...thium-entity.fast_powder_snow_check.patch} | 6 +- ...0038-lithium-collections.attributes.patch} | 0 ...-lithium-collections.entity_by_type.patch} | 0 ...ithium-collections.entity_filtering.patch} | 0 ...=> 0041-lithium-chunk.serialization.patch} | 6 +- ...0042-lithium-cache-iterate-outwards.patch} | 4 +- ...p-for-entity-trackers-for-faster-it.patch} | 6 +- ...4-lithium-block.moving_block_shapes.patch} | 0 ...MC-93826.patch => 0045-Fix-MC-93826.patch} | 0 ...Optimize-default-values-for-configs.patch} | 2 +- .../server/0047-Dynamic-minecart-speed.patch | 208 ++++++++++++++++++ .../0048-Increase-manual-minecart-speed.patch | 21 ++ ...Allow-placing-rails-on-more-surfaces.patch | 27 +++ ...PR-Add-Entity-hidden-by-default-flag.patch | 160 ++++++++++++++ 62 files changed, 597 insertions(+), 176 deletions(-) create mode 100644 patches/api/0003-EMC-Add-ChatColor.getById.patch create mode 100644 patches/api/0004-Paper-PR-Add-Entity-hidden-by-default-API.patch delete mode 100644 patches/removed/0022-Spread-out-and-optimise-player-list-ticksSpread-out-.patch delete mode 100644 patches/removed/0034-Fix-tick-function-tag-running-before-load.patch rename patches/removed/1.19.2/{ => server}/0002-Global-Eula-file.patch (100%) rename patches/removed/1.19.2/{ => server}/0004-Reduce-constants-allocations.patch (100%) rename patches/removed/1.19.2/{ => server}/0007-lithium-CompactSineLUT.patch (100%) rename patches/removed/1.19.2/{ => server}/0008-lithium-fast-retrieval.patch (100%) rename patches/removed/1.19.2/{ => server}/0042-lithium-replace-AI-goal-set-with-optimized-collectio.patch (100%) rename patches/removed/1.19.2/{ => server}/0060-lithium-gen.patch (100%) rename patches/{server => removed/1.19.3}/0012-Remove-TickTask.patch (100%) rename patches/{server/0051-NoChatReports-Implementation.patch => removed/1.19.3/0047-NoChatReports-Implementation.patch} (96%) rename patches/{ => removed/1.19.3}/api/0003-Update-Bungeecord-Chat-API.patch (90%) rename patches/{ => removed/1.19.3}/server/0011-Fix-outdated-server-showing-in-ping-before-server-fu.patch (95%) rename patches/{ => removed/1.19.3}/server/0014-Completely-remove-bootstrapExecutor.patch (100%) rename patches/{ => removed/1.19.3}/server/0017-Remove-sync-chunk-writes-in-server.properties.patch (100%) rename patches/server/{0013-Don-t-create-new-random-instance.patch => 0011-Don-t-create-new-random-instance.patch} (91%) rename patches/server/{0015-Fix-rotating-UP-DOWN-CW-and-CCW.patch => 0012-Fix-rotating-UP-DOWN-CW-and-CCW.patch} (84%) rename patches/server/{0016-Fix-vanilla-command-permission-handler.patch => 0013-Fix-vanilla-command-permission-handler.patch} (100%) rename patches/server/{0018-Remove-Spigot-tick-limiter.patch => 0014-Remove-Spigot-tick-limiter.patch} (94%) rename patches/server/{0019-Don-t-save-Fireworks.patch => 0015-Don-t-save-Fireworks.patch} (84%) rename patches/server/{0020-Paper-PR-BoneMeal-API.patch => 0016-Paper-PR-BoneMeal-API.patch} (96%) rename patches/server/{0021-Do-not-drop-items-from-Give-command.patch => 0017-Do-not-drop-items-from-Give-command.patch} (91%) rename patches/server/{0022-Fix-cow-rotation-when-shearing-mooshroom.patch => 0018-Fix-cow-rotation-when-shearing-mooshroom.patch} (100%) rename patches/server/{0023-End-gateway-should-check-if-entity-can-use-portal.patch => 0019-End-gateway-should-check-if-entity-can-use-portal.patch} (92%) rename patches/server/{0024-Arrows-should-not-reset-despawn-counter.patch => 0020-Arrows-should-not-reset-despawn-counter.patch} (92%) rename patches/server/{0025-Skip-cloning-loot-parameters.patch => 0021-Skip-cloning-loot-parameters.patch} (91%) rename patches/server/{0026-Dont-eat-blocks-in-non-ticking-chunks.patch => 0022-Dont-eat-blocks-in-non-ticking-chunks.patch} (94%) rename patches/server/{0027-carpetfixes-BiomeAccess-prediction.patch => 0023-carpetfixes-BiomeAccess-prediction.patch} (100%) rename patches/server/{0028-Fix-MC-121706.patch => 0024-Fix-MC-121706.patch} (100%) rename patches/server/{0029-Fix-hunger-saturation-depleting-on-peaceful.patch => 0025-Fix-hunger-saturation-depleting-on-peaceful.patch} (87%) rename patches/server/{0030-Fix-mobs-attacking-themselves.patch => 0026-Fix-mobs-attacking-themselves.patch} (100%) rename patches/server/{0031-PaperPR-Optimize-VarInts.patch => 0027-PaperPR-Optimize-VarInts.patch} (90%) rename patches/server/{0032-Fix-MC-238526.patch => 0028-Fix-MC-238526.patch} (87%) rename patches/server/{0033-lithium-cached-hashcode.patch => 0029-lithium-cached-hashcode.patch} (88%) rename patches/server/{0034-vmp-skip-entity-move-if-movement-is-zero.patch => 0030-vmp-skip-entity-move-if-movement-is-zero.patch} (89%) rename patches/server/{0035-lithium-suffocation.patch => 0031-lithium-suffocation.patch} (97%) rename patches/server/{0036-lithium-ai.sensor.secondary_poi.patch => 0032-lithium-ai.sensor.secondary_poi.patch} (100%) rename patches/server/{0037-lithium-store-gamerules-in-fastutil-hashmap.patch => 0033-lithium-store-gamerules-in-fastutil-hashmap.patch} (93%) rename patches/server/{0038-lithium-precompute-shape-arrays.patch => 0034-lithium-precompute-shape-arrays.patch} (95%) rename patches/server/{0039-lithium-entity.fast_elytra_check.patch => 0035-lithium-entity.fast_elytra_check.patch} (82%) rename patches/server/{0040-lithium-entity.fast_hand_swing.patch => 0036-lithium-entity.fast_hand_swing.patch} (81%) rename patches/server/{0041-lithium-entity.fast_powder_snow_check.patch => 0037-lithium-entity.fast_powder_snow_check.patch} (83%) rename patches/server/{0042-lithium-collections.attributes.patch => 0038-lithium-collections.attributes.patch} (100%) rename patches/server/{0043-lithium-collections.entity_by_type.patch => 0039-lithium-collections.entity_by_type.patch} (100%) rename patches/server/{0044-lithium-collections.entity_filtering.patch => 0040-lithium-collections.entity_filtering.patch} (100%) rename patches/server/{0045-lithium-chunk.serialization.patch => 0041-lithium-chunk.serialization.patch} (98%) rename patches/server/{0046-lithium-cache-iterate-outwards.patch => 0042-lithium-cache-iterate-outwards.patch} (98%) rename patches/server/{0047-vmp-use-linked-map-for-entity-trackers-for-faster-it.patch => 0043-vmp-use-linked-map-for-entity-trackers-for-faster-it.patch} (87%) rename patches/server/{0048-lithium-block.moving_block_shapes.patch => 0044-lithium-block.moving_block_shapes.patch} (100%) rename patches/server/{0049-Fix-MC-93826.patch => 0045-Fix-MC-93826.patch} (100%) rename patches/server/{0050-Optimize-default-values-for-configs.patch => 0046-Optimize-default-values-for-configs.patch} (99%) create mode 100644 patches/server/0047-Dynamic-minecart-speed.patch create mode 100644 patches/server/0048-Increase-manual-minecart-speed.patch create mode 100644 patches/server/0049-Allow-placing-rails-on-more-surfaces.patch create mode 100644 patches/server/0050-Paper-PR-Add-Entity-hidden-by-default-flag.patch diff --git a/README.md b/README.md index 8a7e9ac..5e7c4ac 100644 --- a/README.md +++ b/README.md @@ -21,12 +21,14 @@ - **Bug fixes** for several Minecraft issues. - **Contains** PaperMC pull requests patches. - **Faster process** for Vanilla methods. +- **Dynamic mine-carts speed** - **Plugin compatibility** with Spigot & Paper plugins. ## We use patches from the following projects * **[Paper](https://github.com/PaperMC/Paper)** * **[Purpur](https://github.com/PurpurMC/Purpur)** +* **[Kiterino](https://github.com/SoSeDiKs-Universe/Kiterino)** * **[Mirai](https://github.com/etil2jz/Mirai)** * **NOTE: We also borrow some patches from [Yatopia](https://github.com/YatopiaMC/Yatopia).** @@ -47,4 +49,4 @@ In order to distribute and use this server software, you need a paperclip file: Patches are licensed under GPL-3.0. All other files are licensed under MIT. -###### And we dont stealed logo from YatopiaMC!!! +###### And we don't steal logo from YatopiaMC!!! diff --git a/patches/api/0003-EMC-Add-ChatColor.getById.patch b/patches/api/0003-EMC-Add-ChatColor.getById.patch new file mode 100644 index 0000000..c0ee433 --- /dev/null +++ b/patches/api/0003-EMC-Add-ChatColor.getById.patch @@ -0,0 +1,33 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Aikar +Date: Mon, 24 Apr 2017 20:27:23 -0400 +Subject: [PATCH] EMC - Add ChatColor.getById + + +diff --git a/src/main/java/org/bukkit/ChatColor.java b/src/main/java/org/bukkit/ChatColor.java +index e3f185dc982d1c38195a4e01ddd485c13ffa58c0..8a3d05702ad0cfa8384d3a9c7a5695d82e13523e 100644 +--- a/src/main/java/org/bukkit/ChatColor.java ++++ b/src/main/java/org/bukkit/ChatColor.java +@@ -233,6 +233,10 @@ public enum ChatColor { + } + }; + ++ public int getId() { ++ return intCode; ++ } ++ + /** + * The special character which prefixes all chat colour codes. Use this if + * you need to dynamically convert colour codes from your custom format. +@@ -296,6 +300,11 @@ public enum ChatColor { + return !isFormat && this != RESET; + } + ++ @Nullable ++ public static ChatColor getById(int id) { ++ return BY_ID.get(id); ++ } ++ + /** + * Gets the color represented by the specified color code + * diff --git a/patches/api/0004-Paper-PR-Add-Entity-hidden-by-default-API.patch b/patches/api/0004-Paper-PR-Add-Entity-hidden-by-default-API.patch new file mode 100644 index 0000000..4dc015a --- /dev/null +++ b/patches/api/0004-Paper-PR-Add-Entity-hidden-by-default-API.patch @@ -0,0 +1,64 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Justin +Date: Wed, 24 Aug 2022 05:08:52 -0700 +Subject: [PATCH] Paper PR - Add Entity hidden by default API + +This patch adds API that allows entities to be hidden by default. Entities that are hidden by +default are not shown to players until Player#showEntity is invoked on said entity. The same is +true for players that join the server after an Entity is hidden by default. + +Hiding entities by default also respects precedent of keeping entities hidden when other plugins +explicitly hide them from a player. If an entity is hidden by default and by a plugin, the entity +must have the plugin that hid them from a player show them in order to be shown to a player again. +If no plugin had previously hidden the entity before the entity was hidden by default, then any +plugin that attempts to show the entity to a player will succeed in doing so. + +diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java +index 365350d38b2eee00d22bad09ab95c6054f11d536..565a3bcc49ccb4650188263632751e9f6326a5d1 100644 +--- a/src/main/java/org/bukkit/entity/Entity.java ++++ b/src/main/java/org/bukkit/entity/Entity.java +@@ -953,4 +953,25 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent + */ + boolean wouldCollideUsing(@NotNull BoundingBox boundingBox); + // Paper End - Collision API ++ ++ // Paper start - Entity hiddenByDefault ++ /** ++ * Sets whether the entity is hidden by default. When an entity is hidden by default, ++ * {@link Player#showEntity(org.bukkit.plugin.Plugin, Entity)} must be called in order to ++ * display the entity again. Players that join the server do not see entities that are ++ * hidden by default at first and must be shown the entity with the same method above. ++ * ++ * This method also respects plugins hiding entities - if another plugin still wishes for an entity ++ * to be hidden (via {@link Player#hideEntity(org.bukkit.plugin.Plugin, Entity)}), then the entity will ++ * remain hidden even if hiddenByDefault is set to false again or if another plugin tries to show the entity. ++ * ++ * @param hiddenByDefault ++ */ ++ void setHiddenByDefault(boolean hiddenByDefault); ++ ++ /** ++ * @return true if the Entity is hidden by default, false otherwise ++ */ ++ boolean isHiddenByDefault(); ++ // Paper end + } +diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java +index b5fd857896b3afcfa69cce55cbc2696dd625f805..7d44d455a550490e8e505c205dfe26e1d048719e 100644 +--- a/src/main/java/org/bukkit/entity/Player.java ++++ b/src/main/java/org/bukkit/entity/Player.java +@@ -1568,9 +1568,13 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM + + /** + * Allows this player to see an entity that was previously hidden. If +- * another another plugin had hidden the entity too, then the entity will ++ * another plugin had hidden the entity too, then the entity will + * remain hidden until the other plugin calls this method too. + * ++ * If no other plugin is hiding the entity after this method is called, ++ * then this method also allows the player to see entities hidden by default ++ * with {@link Entity#setHiddenByDefault(boolean)}. ++ * + * @param plugin Plugin that wants to show the entity + * @param entity Entity to show + */ diff --git a/patches/removed/0022-Spread-out-and-optimise-player-list-ticksSpread-out-.patch b/patches/removed/0022-Spread-out-and-optimise-player-list-ticksSpread-out-.patch deleted file mode 100644 index 8ce7b95..0000000 --- a/patches/removed/0022-Spread-out-and-optimise-player-list-ticksSpread-out-.patch +++ /dev/null @@ -1,69 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: James Lyne -Date: Mon, 7 Dec 2020 17:52:36 +0000 -Subject: [PATCH] Spread out and optimise player list ticksSpread out and - optimise player list ticks - -This patch was removed from PurpurMC! -Original code by PurpurMC, licensed under MIT -You can find the original code on https://github.com/PurpurMC/Purpur - -diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index faaf13f46bc7bf0ffc1fe61f45e9f11cb9c8b4d5..f4b554da231ed968c6fa7d71380da361d463d6c5 100644 ---- a/src/main/java/net/minecraft/server/players/PlayerList.java -+++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -1032,22 +1032,22 @@ public abstract class PlayerList { - } - - public void tick() { -- if (++this.sendAllPlayerInfoIn > 600) { -- // CraftBukkit start -- for (int i = 0; i < this.players.size(); ++i) { -- final ServerPlayer target = (ServerPlayer) this.players.get(i); -- -- target.connection.send(new ClientboundPlayerInfoPacket(ClientboundPlayerInfoPacket.Action.UPDATE_LATENCY, this.players.stream().filter(new Predicate() { -- @Override -- public boolean test(ServerPlayer input) { -- return target.getBukkitEntity().canSee(input.getBukkitEntity()); -- } -- }).collect(Collectors.toList()))); -+ // Purpur start -+ if (this.sendAllPlayerInfoIn < this.players.size()) { -+ final org.bukkit.craftbukkit.entity.CraftPlayer target = this.players.get(this.sendAllPlayerInfoIn).getBukkitEntity(); -+ final List list = new java.util.ArrayList<>(); -+ for (ServerPlayer player : this.players) { -+ if (target.canSee(player.getUUID())) { -+ list.add(player); -+ } - } -- // CraftBukkit end -- this.sendAllPlayerInfoIn = 0; -+ target.getHandle().connection.send(new ClientboundPlayerInfoPacket(ClientboundPlayerInfoPacket.Action.UPDATE_LATENCY, list)); - } - -+ if (++this.sendAllPlayerInfoIn > 600) { -+ this.sendAllPlayerInfoIn = 0; -+ } -+ // Purpur end - } - - public void broadcastAll(Packet packet) { -diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index b1136b9c39b16cbb9dfe460f88000f74ccd4f571..cfbabdcade291b2fcdbe83206b060b8762f50f41 100644 ---- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1883,7 +1883,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { - - @Override - public boolean canSee(org.bukkit.entity.Entity entity) { -- return !this.hiddenEntities.containsKey(entity.getUniqueId()); -+ // Purpur start -+ return this.canSee(entity.getUniqueId()); -+ } -+ -+ public boolean canSee(UUID uuid) { -+ return !this.hiddenEntities.containsKey(uuid); -+ // Purpur end - } - - @Override diff --git a/patches/removed/0034-Fix-tick-function-tag-running-before-load.patch b/patches/removed/0034-Fix-tick-function-tag-running-before-load.patch deleted file mode 100644 index 737ef16..0000000 --- a/patches/removed/0034-Fix-tick-function-tag-running-before-load.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: etil2jz <81570777+etil2jz@users.noreply.github.com> -Date: Fri, 8 Apr 2022 21:20:50 +0200 -Subject: [PATCH] Fix tick function tag running before load - - -diff --git a/src/main/java/net/minecraft/server/ServerFunctionManager.java b/src/main/java/net/minecraft/server/ServerFunctionManager.java -index 00a50196f6a4768d84acfbbeec79a0753308f091..3452ff5d378a2703fb0959c8163ee0274236e839 100644 ---- a/src/main/java/net/minecraft/server/ServerFunctionManager.java -+++ b/src/main/java/net/minecraft/server/ServerFunctionManager.java -@@ -46,13 +46,14 @@ public class ServerFunctionManager { - } - - public void tick() { -- this.executeTagFunctions(this.ticking, ServerFunctionManager.TICK_FUNCTION_TAG); -+ //this.executeTagFunctions(this.ticking, ServerFunctionManager.TICK_FUNCTION_TAG); // DivineMC - moved down - if (this.postReload) { - this.postReload = false; - Collection collection = this.library.getTag(ServerFunctionManager.LOAD_FUNCTION_TAG); - - this.executeTagFunctions(collection, ServerFunctionManager.LOAD_FUNCTION_TAG); - } -+ this.executeTagFunctions(this.ticking, ServerFunctionManager.TICK_FUNCTION_TAG); // DivineMC - fix tick function tag running before load - - } - diff --git a/patches/removed/1.19.2/0002-Global-Eula-file.patch b/patches/removed/1.19.2/server/0002-Global-Eula-file.patch similarity index 100% rename from patches/removed/1.19.2/0002-Global-Eula-file.patch rename to patches/removed/1.19.2/server/0002-Global-Eula-file.patch diff --git a/patches/removed/1.19.2/0004-Reduce-constants-allocations.patch b/patches/removed/1.19.2/server/0004-Reduce-constants-allocations.patch similarity index 100% rename from patches/removed/1.19.2/0004-Reduce-constants-allocations.patch rename to patches/removed/1.19.2/server/0004-Reduce-constants-allocations.patch diff --git a/patches/removed/1.19.2/0007-lithium-CompactSineLUT.patch b/patches/removed/1.19.2/server/0007-lithium-CompactSineLUT.patch similarity index 100% rename from patches/removed/1.19.2/0007-lithium-CompactSineLUT.patch rename to patches/removed/1.19.2/server/0007-lithium-CompactSineLUT.patch diff --git a/patches/removed/1.19.2/0008-lithium-fast-retrieval.patch b/patches/removed/1.19.2/server/0008-lithium-fast-retrieval.patch similarity index 100% rename from patches/removed/1.19.2/0008-lithium-fast-retrieval.patch rename to patches/removed/1.19.2/server/0008-lithium-fast-retrieval.patch diff --git a/patches/removed/1.19.2/0042-lithium-replace-AI-goal-set-with-optimized-collectio.patch b/patches/removed/1.19.2/server/0042-lithium-replace-AI-goal-set-with-optimized-collectio.patch similarity index 100% rename from patches/removed/1.19.2/0042-lithium-replace-AI-goal-set-with-optimized-collectio.patch rename to patches/removed/1.19.2/server/0042-lithium-replace-AI-goal-set-with-optimized-collectio.patch diff --git a/patches/removed/1.19.2/0060-lithium-gen.patch b/patches/removed/1.19.2/server/0060-lithium-gen.patch similarity index 100% rename from patches/removed/1.19.2/0060-lithium-gen.patch rename to patches/removed/1.19.2/server/0060-lithium-gen.patch diff --git a/patches/server/0012-Remove-TickTask.patch b/patches/removed/1.19.3/0012-Remove-TickTask.patch similarity index 100% rename from patches/server/0012-Remove-TickTask.patch rename to patches/removed/1.19.3/0012-Remove-TickTask.patch diff --git a/patches/server/0051-NoChatReports-Implementation.patch b/patches/removed/1.19.3/0047-NoChatReports-Implementation.patch similarity index 96% rename from patches/server/0051-NoChatReports-Implementation.patch rename to patches/removed/1.19.3/0047-NoChatReports-Implementation.patch index 800d1b4..d50326c 100644 --- a/patches/server/0051-NoChatReports-Implementation.patch +++ b/patches/removed/1.19.3/0047-NoChatReports-Implementation.patch @@ -3,12 +3,12 @@ From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com> Date: Sun, 19 Mar 2023 19:07:20 +0300 Subject: [PATCH] NoChatReports Implementation +idk why, but server status has been updated. waiting for ncr diff --git a/src/main/java/gq/bxteam/divinemc/DivineConfig.java b/src/main/java/gq/bxteam/divinemc/DivineConfig.java -index 541acfc832fe4caa13b5fb46bc455fc6a7294af8..8749af60221b53efa9f4bce43bbdad166a3f4506 100644 ---- a/src/main/java/gq/bxteam/divinemc/DivineConfig.java -+++ b/src/main/java/gq/bxteam/divinemc/DivineConfig.java -@@ -131,4 +131,14 @@ public class DivineConfig { +--- a/src/main/java/gq/bxteam/divinemc/DivineConfig.java (revision 5273f89dd19146a784cf4c584647befb8099b105) ++++ b/src/main/java/gq/bxteam/divinemc/DivineConfig.java (date 1679415878866) +@@ -131,4 +131,14 @@ return config.getStringList(key); } diff --git a/patches/api/0003-Update-Bungeecord-Chat-API.patch b/patches/removed/1.19.3/api/0003-Update-Bungeecord-Chat-API.patch similarity index 90% rename from patches/api/0003-Update-Bungeecord-Chat-API.patch rename to patches/removed/1.19.3/api/0003-Update-Bungeecord-Chat-API.patch index db46598..44824b0 100644 --- a/patches/api/0003-Update-Bungeecord-Chat-API.patch +++ b/patches/removed/1.19.3/api/0003-Update-Bungeecord-Chat-API.patch @@ -3,6 +3,7 @@ From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com> Date: Tue, 14 Mar 2023 21:03:19 +0300 Subject: [PATCH] Update Bungeecord Chat API +ok, it will be build 9 diff --git a/build.gradle.kts b/build.gradle.kts index 181e9cd8623995f40e696ccfe49754dc340405d8..ba11fc979aac6f9a4bc812bc83b42b5ff2916b6d 100644 @@ -12,7 +13,7 @@ index 181e9cd8623995f40e696ccfe49754dc340405d8..ba11fc979aac6f9a4bc812bc83b42b5f // api dependencies are listed transitively to API consumers api("com.google.guava:guava:31.1-jre") api("com.google.code.gson:gson:2.10") -- api("net.md-5:bungeecord-chat:1.16-R0.4-deprecated+build.6") // Paper +- api("net.md-5:bungeecord-chat:1.16-R0.4-deprecated+build.9") // Paper + api("net.md-5:bungeecord-chat:1.19-R0.1-SNAPSHOT") // Paper // DivineMC api("org.yaml:snakeyaml:1.33") // Paper start diff --git a/patches/server/0011-Fix-outdated-server-showing-in-ping-before-server-fu.patch b/patches/removed/1.19.3/server/0011-Fix-outdated-server-showing-in-ping-before-server-fu.patch similarity index 95% rename from patches/server/0011-Fix-outdated-server-showing-in-ping-before-server-fu.patch rename to patches/removed/1.19.3/server/0011-Fix-outdated-server-showing-in-ping-before-server-fu.patch index 584905f..604e96c 100644 --- a/patches/server/0011-Fix-outdated-server-showing-in-ping-before-server-fu.patch +++ b/patches/removed/1.19.3/server/0011-Fix-outdated-server-showing-in-ping-before-server-fu.patch @@ -4,7 +4,7 @@ Date: Tue, 4 Jun 2019 15:50:08 -0500 Subject: [PATCH] Fix 'outdated server' showing in ping before server fully boots -Original code by PurpurMC, licensed under MIT +Original code by PurpurMC, licensed under MIT (removed now) You can find the original code on https://github.com/PurpurMC/Purpur diff --git a/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java diff --git a/patches/server/0014-Completely-remove-bootstrapExecutor.patch b/patches/removed/1.19.3/server/0014-Completely-remove-bootstrapExecutor.patch similarity index 100% rename from patches/server/0014-Completely-remove-bootstrapExecutor.patch rename to patches/removed/1.19.3/server/0014-Completely-remove-bootstrapExecutor.patch diff --git a/patches/server/0017-Remove-sync-chunk-writes-in-server.properties.patch b/patches/removed/1.19.3/server/0017-Remove-sync-chunk-writes-in-server.properties.patch similarity index 100% rename from patches/server/0017-Remove-sync-chunk-writes-in-server.properties.patch rename to patches/removed/1.19.3/server/0017-Remove-sync-chunk-writes-in-server.properties.patch diff --git a/patches/server/0001-Divine-Branding.patch b/patches/server/0001-Divine-Branding.patch index 438077b..6acad42 100644 --- a/patches/server/0001-Divine-Branding.patch +++ b/patches/server/0001-Divine-Branding.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Divine Branding diff --git a/build.gradle.kts b/build.gradle.kts -index 530159ef6307e092279824488652bbc94d3ad387..df5c8abe5fe5428f99fab668583c0af986adbd27 100644 +index 3c8293f002f11b430083502362fdc801f44aa138..506456fd003dda0d544c9800301b1210a5d18457 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -7,7 +7,7 @@ plugins { @@ -196,10 +196,10 @@ index 0000000000000000000000000000000000000000..0dc13e363448d7a0f20993e0576af625 + } +} diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 33a5e900c2cab99c311fa5f5b71a609cf8f802cb..0b414bcb1799d895d8d1b7dce42d7d5bee265ec8 100644 +index 6d5e9400892b86562519a893349ca55e566bfb24..9945d6efac1e1ea0d22d6fdfe8aa5d2805c615b2 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1656,7 +1656,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 2147483647L ? Integer.MAX_VALUE : (int) l; int j1 = this.getCoprime(i1); @@ -19,7 +19,7 @@ index 7d6d3c8556033d289fdadc489e73fba478fce41a..180e189fb657453fd395ed0e845d3d90 for (int l1 = 0; l1 < i1; ++l1) { int i2 = (k1 + j1 * l1) % i1; -@@ -427,7 +427,7 @@ public class ServerPlayer extends Player { +@@ -433,7 +433,7 @@ public class ServerPlayer extends Player { long l = k * k; int i1 = l > 2147483647L ? Integer.MAX_VALUE : (int) l; int j1 = this.getCoprime(i1); diff --git a/patches/server/0015-Fix-rotating-UP-DOWN-CW-and-CCW.patch b/patches/server/0012-Fix-rotating-UP-DOWN-CW-and-CCW.patch similarity index 84% rename from patches/server/0015-Fix-rotating-UP-DOWN-CW-and-CCW.patch rename to patches/server/0012-Fix-rotating-UP-DOWN-CW-and-CCW.patch index 2c4abb8..c51db84 100644 --- a/patches/server/0015-Fix-rotating-UP-DOWN-CW-and-CCW.patch +++ b/patches/server/0012-Fix-rotating-UP-DOWN-CW-and-CCW.patch @@ -7,10 +7,10 @@ Original code by PurpurMC, licensed under MIT You can find the original code on https://github.com/PurpurMC/Purpur diff --git a/src/main/java/net/minecraft/core/Direction.java b/src/main/java/net/minecraft/core/Direction.java -index 4ebbd0bbbecb07eb1950231cf0b3a7f25e09f1c9..61eadbc9bf353319d98df1135ded05dfe9bcc3f4 100644 +index 28f3145193e8bc22f3bbd0442248ea09ccc91973..28ecd137dd37759e7890d71635289c3f6e994b87 100644 --- a/src/main/java/net/minecraft/core/Direction.java +++ b/src/main/java/net/minecraft/core/Direction.java -@@ -247,6 +247,12 @@ public enum Direction implements StringRepresentable { +@@ -248,6 +248,12 @@ public enum Direction implements StringRepresentable { case EAST: var10000 = SOUTH; break; @@ -23,7 +23,7 @@ index 4ebbd0bbbecb07eb1950231cf0b3a7f25e09f1c9..61eadbc9bf353319d98df1135ded05df default: throw new IllegalStateException("Unable to get Y-rotated facing of " + this); } -@@ -359,6 +365,12 @@ public enum Direction implements StringRepresentable { +@@ -360,6 +366,12 @@ public enum Direction implements StringRepresentable { case EAST: var10000 = NORTH; break; diff --git a/patches/server/0016-Fix-vanilla-command-permission-handler.patch b/patches/server/0013-Fix-vanilla-command-permission-handler.patch similarity index 100% rename from patches/server/0016-Fix-vanilla-command-permission-handler.patch rename to patches/server/0013-Fix-vanilla-command-permission-handler.patch diff --git a/patches/server/0018-Remove-Spigot-tick-limiter.patch b/patches/server/0014-Remove-Spigot-tick-limiter.patch similarity index 94% rename from patches/server/0018-Remove-Spigot-tick-limiter.patch rename to patches/server/0014-Remove-Spigot-tick-limiter.patch index ebc7df5..5a122ca 100644 --- a/patches/server/0018-Remove-Spigot-tick-limiter.patch +++ b/patches/server/0014-Remove-Spigot-tick-limiter.patch @@ -7,10 +7,10 @@ Original code by Titaniumtown, licensed under GNU General Public License v3.0 You can find the original code on https://gitlab.com/Titaniumtown/JettPack diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index f7da7be380062eb052ac0549f9d9dc810d6218a3..0cfcf1c1c4f2fe0658b212b076e2cf9f7f0e974b 100644 +index 78069d2dbd4ee5624e99a76547cbba354ef0b96e..234d7c309bd386862b6f9ddc8dc2d469ecf30030 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -175,8 +175,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -179,8 +179,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable { public final com.destroystokyo.paper.antixray.ChunkPacketBlockController chunkPacketBlockController; // Paper - Anti-Xray public final co.aikar.timings.WorldTimingsHandler timings; // Paper public static BlockPos lastPhysicsProblem; // Spigot @@ -21,7 +21,7 @@ index f7da7be380062eb052ac0549f9d9dc810d6218a3..0cfcf1c1c4f2fe0658b212b076e2cf9f private int tileTickPosition; public final Map explosionDensityCache = new HashMap<>(); // Paper - Optimize explosions public java.util.ArrayDeque redstoneUpdateInfos; // Paper - Move from Map in BlockRedstoneTorch to here -@@ -370,8 +370,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -376,8 +376,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable { // CraftBukkit end timings = new co.aikar.timings.WorldTimingsHandler(this); // Paper - code below can generate new world and access timings this.keepSpawnInMemory = this.paperConfig().spawn.keepSpawnLoaded; // Paper diff --git a/patches/server/0019-Don-t-save-Fireworks.patch b/patches/server/0015-Don-t-save-Fireworks.patch similarity index 84% rename from patches/server/0019-Don-t-save-Fireworks.patch rename to patches/server/0015-Don-t-save-Fireworks.patch index 9879263..d9e6644 100644 --- a/patches/server/0019-Don-t-save-Fireworks.patch +++ b/patches/server/0015-Don-t-save-Fireworks.patch @@ -7,10 +7,10 @@ Original code by Starlis, licensed under GNU General Public License v3.0 You can find the original code on https://github.com/starlis/empirecraft diff --git a/src/main/java/net/minecraft/world/entity/projectile/FireworkRocketEntity.java b/src/main/java/net/minecraft/world/entity/projectile/FireworkRocketEntity.java -index 5406925cd66f46ab8744123c670d72cea7bfc3a1..ba9b29db6d6b9e73e1b8d305ad1d7e855290e758 100644 +index fca27f98989bf106060ba08196255fe32f850df5..d154a5d84cbb56f62a028d32ff48e9eb0a5dd829 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/FireworkRocketEntity.java +++ b/src/main/java/net/minecraft/world/entity/projectile/FireworkRocketEntity.java -@@ -358,4 +358,11 @@ public class FireworkRocketEntity extends Projectile implements ItemSupplier { +@@ -357,4 +357,11 @@ public class FireworkRocketEntity extends Projectile implements ItemSupplier { public boolean isAttackable() { return false; } diff --git a/patches/server/0020-Paper-PR-BoneMeal-API.patch b/patches/server/0016-Paper-PR-BoneMeal-API.patch similarity index 96% rename from patches/server/0020-Paper-PR-BoneMeal-API.patch rename to patches/server/0016-Paper-PR-BoneMeal-API.patch index 883c7ad..10907db 100644 --- a/patches/server/0020-Paper-PR-BoneMeal-API.patch +++ b/patches/server/0016-Paper-PR-BoneMeal-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Paper PR - BoneMeal API diff --git a/src/main/java/net/minecraft/world/item/BoneMealItem.java b/src/main/java/net/minecraft/world/item/BoneMealItem.java -index 664c3a6b34035ebeff19926be311b1fd6f08dc19..dd67f7b3a4e7bf4d648a1b955b0beeec8cad9bd5 100644 +index c26665bc59c18c4da467fb6ae33e51a65ecf1de6..db31b8e00f63f3fa265dcc669816a5a250ee4910 100644 --- a/src/main/java/net/minecraft/world/item/BoneMealItem.java +++ b/src/main/java/net/minecraft/world/item/BoneMealItem.java @@ -36,15 +36,17 @@ public class BoneMealItem extends Item { @@ -39,7 +39,7 @@ index 664c3a6b34035ebeff19926be311b1fd6f08dc19..dd67f7b3a4e7bf4d648a1b955b0beeec } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 54932d92b13b890b07f827c5f09bd137383d4ab5..c56005e062f2b5ce38109e4666c07b941fe22149 100644 +index 5e9055fdf411029ea2fed91acd6b981f79156418..d3ceb6925c86640663439a9dc413df1d9126cc5f 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -2394,5 +2394,43 @@ public class CraftWorld extends CraftRegionAccessor implements World { diff --git a/patches/server/0021-Do-not-drop-items-from-Give-command.patch b/patches/server/0017-Do-not-drop-items-from-Give-command.patch similarity index 91% rename from patches/server/0021-Do-not-drop-items-from-Give-command.patch rename to patches/server/0017-Do-not-drop-items-from-Give-command.patch index 53a6cb7..374d6d9 100644 --- a/patches/server/0021-Do-not-drop-items-from-Give-command.patch +++ b/patches/server/0017-Do-not-drop-items-from-Give-command.patch @@ -7,7 +7,7 @@ Original code by Starlis, licensed under GNU General Public License v3.0 You can find the original code on https://github.com/starlis/empirecraft diff --git a/src/main/java/net/minecraft/server/commands/GiveCommand.java b/src/main/java/net/minecraft/server/commands/GiveCommand.java -index 06e3a868e922f1b7a586d0ca28f64a67ae463b68..00c481ebf012efa5424e32521e7aecf4b36f24c0 100644 +index ee7d29d85c8b024c9b23cba8ecd4192aa7e8aa7b..e50d8c5f6c4f2aa672732d1d42c4995c9b377530 100644 --- a/src/main/java/net/minecraft/server/commands/GiveCommand.java +++ b/src/main/java/net/minecraft/server/commands/GiveCommand.java @@ -58,6 +58,7 @@ public class GiveCommand { diff --git a/patches/server/0022-Fix-cow-rotation-when-shearing-mooshroom.patch b/patches/server/0018-Fix-cow-rotation-when-shearing-mooshroom.patch similarity index 100% rename from patches/server/0022-Fix-cow-rotation-when-shearing-mooshroom.patch rename to patches/server/0018-Fix-cow-rotation-when-shearing-mooshroom.patch diff --git a/patches/server/0023-End-gateway-should-check-if-entity-can-use-portal.patch b/patches/server/0019-End-gateway-should-check-if-entity-can-use-portal.patch similarity index 92% rename from patches/server/0023-End-gateway-should-check-if-entity-can-use-portal.patch rename to patches/server/0019-End-gateway-should-check-if-entity-can-use-portal.patch index 822cdfc..e5a6413 100644 --- a/patches/server/0023-End-gateway-should-check-if-entity-can-use-portal.patch +++ b/patches/server/0019-End-gateway-should-check-if-entity-can-use-portal.patch @@ -7,7 +7,7 @@ Original code by PurpurMC, licensed under MIT You can find the original code on https://github.com/PurpurMC/Purpur diff --git a/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java -index f80545f80948db27d1fbde77d0505c916eb504ed..95a6284026d17567deb7416abe2bc4d6975aaaf8 100644 +index c73024cc62490c336ffe26313580e88d25ca7078..690d498a97b943a62e8ea415450ca44a2349fee0 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java @@ -178,6 +178,7 @@ public class TheEndGatewayBlockEntity extends TheEndPortalBlockEntity { diff --git a/patches/server/0024-Arrows-should-not-reset-despawn-counter.patch b/patches/server/0020-Arrows-should-not-reset-despawn-counter.patch similarity index 92% rename from patches/server/0024-Arrows-should-not-reset-despawn-counter.patch rename to patches/server/0020-Arrows-should-not-reset-despawn-counter.patch index eed4fee..7d0f081 100644 --- a/patches/server/0024-Arrows-should-not-reset-despawn-counter.patch +++ b/patches/server/0020-Arrows-should-not-reset-despawn-counter.patch @@ -10,7 +10,7 @@ Original code by PurpurMC, licensed under MIT You can find the original code on https://github.com/PurpurMC/Purpur diff --git a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java -index 9788e477ff1446ad2ea3669922cc7dfc09900ce8..056ba60a855a2628e0b72ceaa3257da756ee61d9 100644 +index 5d6d26cfe8f0ab68a3145214b3fc126ca7a71a66..6d00e5d22147ae69de3723a46eabf0ecc577d421 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java +++ b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java @@ -312,7 +312,7 @@ public abstract class AbstractArrow extends Projectile { diff --git a/patches/server/0025-Skip-cloning-loot-parameters.patch b/patches/server/0021-Skip-cloning-loot-parameters.patch similarity index 91% rename from patches/server/0025-Skip-cloning-loot-parameters.patch rename to patches/server/0021-Skip-cloning-loot-parameters.patch index 48e81bc..2f8f599 100644 --- a/patches/server/0025-Skip-cloning-loot-parameters.patch +++ b/patches/server/0021-Skip-cloning-loot-parameters.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Skip cloning loot parameters diff --git a/src/main/java/net/minecraft/advancements/Advancement.java b/src/main/java/net/minecraft/advancements/Advancement.java -index dd4409790524293be07483f00df05d8a8743e3d9..49b40fd9adea5b6dc1d304c172acdc5da4f148fd 100644 +index 31ef13a708db2e4a664b30090a562eb6e4597bab..f18357d4dffbfe35d7c205fec0cc026020afdf25 100644 --- a/src/main/java/net/minecraft/advancements/Advancement.java +++ b/src/main/java/net/minecraft/advancements/Advancement.java @@ -45,7 +45,7 @@ public class Advancement { diff --git a/patches/server/0026-Dont-eat-blocks-in-non-ticking-chunks.patch b/patches/server/0022-Dont-eat-blocks-in-non-ticking-chunks.patch similarity index 94% rename from patches/server/0026-Dont-eat-blocks-in-non-ticking-chunks.patch rename to patches/server/0022-Dont-eat-blocks-in-non-ticking-chunks.patch index 2e5e74b..76ed8c8 100644 --- a/patches/server/0026-Dont-eat-blocks-in-non-ticking-chunks.patch +++ b/patches/server/0022-Dont-eat-blocks-in-non-ticking-chunks.patch @@ -7,10 +7,10 @@ Original code by PurpurMC, licensed under MIT You can find the original code on https://github.com/PurpurMC/Purpur diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index d939b1e3bc101e66bc1019cf49d8079665dadfcc..3d78c10a5442bfa5d4beae2546378b3822f0465d 100644 +index 3ce4dbf4eed442d89d6bbc8e4c6a000172041da5..364d899f4fba65f0ecae522c7dde4f1ef8ee632e 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -995,7 +995,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -998,7 +998,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider return this.anyPlayerCloseEnoughForSpawning(this.getUpdatingChunkIfPresent(chunkcoordintpair.toLong()), chunkcoordintpair, reducedRange); } diff --git a/patches/server/0027-carpetfixes-BiomeAccess-prediction.patch b/patches/server/0023-carpetfixes-BiomeAccess-prediction.patch similarity index 100% rename from patches/server/0027-carpetfixes-BiomeAccess-prediction.patch rename to patches/server/0023-carpetfixes-BiomeAccess-prediction.patch diff --git a/patches/server/0028-Fix-MC-121706.patch b/patches/server/0024-Fix-MC-121706.patch similarity index 100% rename from patches/server/0028-Fix-MC-121706.patch rename to patches/server/0024-Fix-MC-121706.patch diff --git a/patches/server/0029-Fix-hunger-saturation-depleting-on-peaceful.patch b/patches/server/0025-Fix-hunger-saturation-depleting-on-peaceful.patch similarity index 87% rename from patches/server/0029-Fix-hunger-saturation-depleting-on-peaceful.patch rename to patches/server/0025-Fix-hunger-saturation-depleting-on-peaceful.patch index c21c24c..79e2802 100644 --- a/patches/server/0029-Fix-hunger-saturation-depleting-on-peaceful.patch +++ b/patches/server/0025-Fix-hunger-saturation-depleting-on-peaceful.patch @@ -8,10 +8,10 @@ the displayed hunger bar never goes down. Hunger (or any related value, includin should not go down on peaceful. See https://bugs.mojang.com/browse/MC-31819. diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java -index 61597ebe2f9faff43994c475074b87d11905e582..6f6fdab36ed5a912ad655a466dd16644eb7139fc 100644 +index 2b02800666b358159c8ecb63208a14855f90657b..f68d53f085f4cb9ae94f5aa110ca0bd2a88aa5e1 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java -@@ -1901,6 +1901,7 @@ public abstract class Player extends LivingEntity { +@@ -1896,6 +1896,7 @@ public abstract class Player extends LivingEntity { } public void causeFoodExhaustion(float f, EntityExhaustionEvent.ExhaustionReason reason) { diff --git a/patches/server/0030-Fix-mobs-attacking-themselves.patch b/patches/server/0026-Fix-mobs-attacking-themselves.patch similarity index 100% rename from patches/server/0030-Fix-mobs-attacking-themselves.patch rename to patches/server/0026-Fix-mobs-attacking-themselves.patch diff --git a/patches/server/0031-PaperPR-Optimize-VarInts.patch b/patches/server/0027-PaperPR-Optimize-VarInts.patch similarity index 90% rename from patches/server/0031-PaperPR-Optimize-VarInts.patch rename to patches/server/0027-PaperPR-Optimize-VarInts.patch index 462299a..fff55c7 100644 --- a/patches/server/0031-PaperPR-Optimize-VarInts.patch +++ b/patches/server/0027-PaperPR-Optimize-VarInts.patch @@ -8,10 +8,10 @@ Original project: https://github.com/PaperMC/Velocity Paper pull request: https://github.com/PaperMC/Paper/pull/8418 diff --git a/src/main/java/net/minecraft/network/FriendlyByteBuf.java b/src/main/java/net/minecraft/network/FriendlyByteBuf.java -index 32ee4ed11aefd82dca2e3e78b3108f041fdc3695..888a9fd7b13630fec814d23f0a2035f88cffa6e8 100644 +index 9938bb90bef84cf784f9a1ceb02a1a45aa8b48a1..015685c97dc4a3485e009e0bf6c8f04302249578 100644 --- a/src/main/java/net/minecraft/network/FriendlyByteBuf.java +++ b/src/main/java/net/minecraft/network/FriendlyByteBuf.java -@@ -93,15 +93,18 @@ public class FriendlyByteBuf extends ByteBuf { +@@ -102,15 +102,18 @@ public class FriendlyByteBuf extends ByteBuf { this.source = parent; } @@ -37,7 +37,7 @@ index 32ee4ed11aefd82dca2e3e78b3108f041fdc3695..888a9fd7b13630fec814d23f0a2035f8 public static int getVarLongSize(long value) { for (int j = 1; j < 10; ++j) { -@@ -565,7 +568,22 @@ public class FriendlyByteBuf extends ByteBuf { +@@ -612,7 +615,22 @@ public class FriendlyByteBuf extends ByteBuf { return new UUID(this.readLong(), this.readLong()); } diff --git a/patches/server/0032-Fix-MC-238526.patch b/patches/server/0028-Fix-MC-238526.patch similarity index 87% rename from patches/server/0032-Fix-MC-238526.patch rename to patches/server/0028-Fix-MC-238526.patch index ebd211e..00920da 100644 --- a/patches/server/0032-Fix-MC-238526.patch +++ b/patches/server/0028-Fix-MC-238526.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix MC-238526 diff --git a/src/main/java/net/minecraft/world/entity/animal/WaterAnimal.java b/src/main/java/net/minecraft/world/entity/animal/WaterAnimal.java -index 18389f46902bb9879ac6d734723e9a720724dc48..a50dff923743c9f916747abbf5c7d8c729ac8efe 100644 +index 35cfa366baf6747105faa93f1220bb9cc31a5bd5..55d2a130d056da10b79d5291ab5e4ad7a809972f 100644 --- a/src/main/java/net/minecraft/world/entity/animal/WaterAnimal.java +++ b/src/main/java/net/minecraft/world/entity/animal/WaterAnimal.java -@@ -83,6 +83,6 @@ public abstract class WaterAnimal extends PathfinderMob { +@@ -82,6 +82,6 @@ public abstract class WaterAnimal extends PathfinderMob { i = world.getMinecraftWorld().paperConfig().entities.spawning.wateranimalSpawnHeight.maximum.or(i); j = world.getMinecraftWorld().paperConfig().entities.spawning.wateranimalSpawnHeight.minimum.or(j); // Paper end diff --git a/patches/server/0033-lithium-cached-hashcode.patch b/patches/server/0029-lithium-cached-hashcode.patch similarity index 88% rename from patches/server/0033-lithium-cached-hashcode.patch rename to patches/server/0029-lithium-cached-hashcode.patch index 55deab2..3a1fd10 100644 --- a/patches/server/0033-lithium-cached-hashcode.patch +++ b/patches/server/0029-lithium-cached-hashcode.patch @@ -7,10 +7,10 @@ Original code by CaffeineMC, licensed under GNU Lesser General Public License v3 You can find the original code on https://github.com/CaffeineMC/lithium-fabric (Yarn mappings) diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java -index 40f0e57bed6866bff69231b9135987ca53125ba3..1e358cdabca103d65410b340db96a1ad6e479c59 100644 +index a85e788ff5a55288df753a0e630b32270760f8de..ebb3808fbaaec82283db0839335b5efca28d4881 100644 --- a/src/main/java/net/minecraft/world/level/block/Block.java +++ b/src/main/java/net/minecraft/world/level/block/Block.java -@@ -608,11 +608,18 @@ public class Block extends BlockBehaviour implements ItemLike { +@@ -604,11 +604,18 @@ public class Block extends BlockBehaviour implements ItemLike { private final BlockState first; private final BlockState second; private final Direction direction; @@ -29,7 +29,7 @@ index 40f0e57bed6866bff69231b9135987ca53125ba3..1e358cdabca103d65410b340db96a1ad } public boolean equals(Object object) { -@@ -628,11 +635,7 @@ public class Block extends BlockBehaviour implements ItemLike { +@@ -624,11 +631,7 @@ public class Block extends BlockBehaviour implements ItemLike { } public int hashCode() { diff --git a/patches/server/0034-vmp-skip-entity-move-if-movement-is-zero.patch b/patches/server/0030-vmp-skip-entity-move-if-movement-is-zero.patch similarity index 89% rename from patches/server/0034-vmp-skip-entity-move-if-movement-is-zero.patch rename to patches/server/0030-vmp-skip-entity-move-if-movement-is-zero.patch index 000f073..10503c7 100644 --- a/patches/server/0034-vmp-skip-entity-move-if-movement-is-zero.patch +++ b/patches/server/0030-vmp-skip-entity-move-if-movement-is-zero.patch @@ -9,7 +9,7 @@ Original code by RelativityMC, licensed under MIT You can find the original code on https://github.com/RelativityMC/VMP-fabric (Yarn mappings) diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 3073b34a0e0281b6b0330721bb0440147de28511..f150d57ed1acc8423e86b1345ad3e1091c73ba95 100644 +index 8a2429f915da389360dcb16609fef7701b4a863a..bc8cdffb58369a5c1796d3323ed1facbedf9c823 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -299,6 +299,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -20,7 +20,7 @@ index 3073b34a0e0281b6b0330721bb0440147de28511..f150d57ed1acc8423e86b1345ad3e109 public boolean onGround; public boolean horizontalCollision; public boolean verticalCollision; -@@ -1034,6 +1035,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -1035,6 +1036,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { // Paper end - detailed watchdog information public void move(MoverType movementType, Vec3 movement) { @@ -33,7 +33,7 @@ index 3073b34a0e0281b6b0330721bb0440147de28511..f150d57ed1acc8423e86b1345ad3e109 // Paper start - detailed watchdog information io.papermc.paper.util.TickThread.ensureTickThread("Cannot move an entity off-main"); synchronized (this.posLock) { -@@ -3817,6 +3824,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -3862,6 +3869,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { } public final void setBoundingBox(AABB boundingBox) { diff --git a/patches/server/0035-lithium-suffocation.patch b/patches/server/0031-lithium-suffocation.patch similarity index 97% rename from patches/server/0035-lithium-suffocation.patch rename to patches/server/0031-lithium-suffocation.patch index c4571c6..1dc346b 100644 --- a/patches/server/0035-lithium-suffocation.patch +++ b/patches/server/0031-lithium-suffocation.patch @@ -9,10 +9,10 @@ Original license: GNU Lesser General Public License v3.0 Original project: https://github.com/CaffeineMC/lithium-fabric (Yarn mappings) diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index f150d57ed1acc8423e86b1345ad3e1091c73ba95..49537da22dfc5f99edd64fbe351987ecb5ff4826 100644 +index bc8cdffb58369a5c1796d3323ed1facbedf9c823..e273fed8e97c98bf5735d3a8c301968990d4cf32 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -2610,39 +2610,64 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -2623,39 +2623,64 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { return !this.isRemoved(); } diff --git a/patches/server/0036-lithium-ai.sensor.secondary_poi.patch b/patches/server/0032-lithium-ai.sensor.secondary_poi.patch similarity index 100% rename from patches/server/0036-lithium-ai.sensor.secondary_poi.patch rename to patches/server/0032-lithium-ai.sensor.secondary_poi.patch diff --git a/patches/server/0037-lithium-store-gamerules-in-fastutil-hashmap.patch b/patches/server/0033-lithium-store-gamerules-in-fastutil-hashmap.patch similarity index 93% rename from patches/server/0037-lithium-store-gamerules-in-fastutil-hashmap.patch rename to patches/server/0033-lithium-store-gamerules-in-fastutil-hashmap.patch index 6bbdd29..8950e5d 100644 --- a/patches/server/0037-lithium-store-gamerules-in-fastutil-hashmap.patch +++ b/patches/server/0033-lithium-store-gamerules-in-fastutil-hashmap.patch @@ -7,7 +7,7 @@ Original code by CaffeineMC, licensed under GNU Lesser General Public License v3 You can find the original code on https://github.com/CaffeineMC/lithium-fabric (Yarn mappings) diff --git a/src/main/java/net/minecraft/world/level/GameRules.java b/src/main/java/net/minecraft/world/level/GameRules.java -index c15e4d95baacd30f9614dc5526dc8fc12ae5bd06..8577f80ccf84705b94d2cd1007a1a28ec3432d41 100644 +index 29d1f78dbc8410f9292f409b17705acde55979df..81b9cbc717283021fc902337102fbb3af35db101 100644 --- a/src/main/java/net/minecraft/world/level/GameRules.java +++ b/src/main/java/net/minecraft/world/level/GameRules.java @@ -27,6 +27,7 @@ import net.minecraft.network.protocol.game.ClientboundGameEventPacket; @@ -18,7 +18,7 @@ index c15e4d95baacd30f9614dc5526dc8fc12ae5bd06..8577f80ccf84705b94d2cd1007a1a28e public class GameRules { -@@ -118,14 +119,16 @@ public class GameRules { +@@ -120,14 +121,16 @@ public class GameRules { public GameRules() { // Pufferfish start - use this to ensure gameruleArray is initialized diff --git a/patches/server/0038-lithium-precompute-shape-arrays.patch b/patches/server/0034-lithium-precompute-shape-arrays.patch similarity index 95% rename from patches/server/0038-lithium-precompute-shape-arrays.patch rename to patches/server/0034-lithium-precompute-shape-arrays.patch index 2bd630f..01fcf68 100644 --- a/patches/server/0038-lithium-precompute-shape-arrays.patch +++ b/patches/server/0034-lithium-precompute-shape-arrays.patch @@ -7,10 +7,10 @@ Original code by CaffeineMC, licensed under GNU Lesser General Public License v3 You can find the original code on https://github.com/CaffeineMC/lithium-fabric (Yarn mappings) diff --git a/src/main/java/net/minecraft/core/Direction.java b/src/main/java/net/minecraft/core/Direction.java -index 61eadbc9bf353319d98df1135ded05dfe9bcc3f4..90297e355d2009ca134ff786925dd3c2ac3a08cc 100644 +index 28ecd137dd37759e7890d71635289c3f6e994b87..c31da8e3709168d87ceb44826c9dee9fe7e117f0 100644 --- a/src/main/java/net/minecraft/core/Direction.java +++ b/src/main/java/net/minecraft/core/Direction.java -@@ -41,7 +41,7 @@ public enum Direction implements StringRepresentable { +@@ -42,7 +42,7 @@ public enum Direction implements StringRepresentable { private final Direction.Axis axis; private final Direction.AxisDirection axisDirection; private final Vec3i normal; diff --git a/patches/server/0039-lithium-entity.fast_elytra_check.patch b/patches/server/0035-lithium-entity.fast_elytra_check.patch similarity index 82% rename from patches/server/0039-lithium-entity.fast_elytra_check.patch rename to patches/server/0035-lithium-entity.fast_elytra_check.patch index d48931d..4bb32c3 100644 --- a/patches/server/0039-lithium-entity.fast_elytra_check.patch +++ b/patches/server/0035-lithium-entity.fast_elytra_check.patch @@ -7,10 +7,10 @@ Original code by CaffeineMC, licensed under GNU Lesser General Public License v3 You can find the original code on https://github.com/CaffeineMC/lithium-fabric (Yarn mappings) diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 120c0804010fd5b38a5f806ca580962ff8b47339..577e6744eab8e01a1fab414e53c2263f1997def5 100644 +index 791f672b30f2a4d3b329e2ce0f4fb9c2ca627b01..dcbeffd0b4ea7c245ac83fe7e097794fc24fe4e8 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -3478,6 +3478,8 @@ public abstract class LivingEntity extends Entity { +@@ -3440,6 +3440,8 @@ public abstract class LivingEntity extends Entity implements Attackable { } private void updateFallFlying() { diff --git a/patches/server/0040-lithium-entity.fast_hand_swing.patch b/patches/server/0036-lithium-entity.fast_hand_swing.patch similarity index 81% rename from patches/server/0040-lithium-entity.fast_hand_swing.patch rename to patches/server/0036-lithium-entity.fast_hand_swing.patch index 60b550c..6526f49 100644 --- a/patches/server/0040-lithium-entity.fast_hand_swing.patch +++ b/patches/server/0036-lithium-entity.fast_hand_swing.patch @@ -7,10 +7,10 @@ Original code by CaffeineMC, licensed under GNU Lesser General Public License v3 You can find the original code on https://github.com/CaffeineMC/lithium-fabric (Yarn mappings) diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 577e6744eab8e01a1fab414e53c2263f1997def5..f24b8baf01c4e25c0ddff6f7726d1ac6d5345930 100644 +index dcbeffd0b4ea7c245ac83fe7e097794fc24fe4e8..85f4b06cf4062fcc8199b66dd926dbe352584210 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -2519,6 +2519,8 @@ public abstract class LivingEntity extends Entity { +@@ -2459,6 +2459,8 @@ public abstract class LivingEntity extends Entity implements Attackable { } protected void updateSwingTime() { diff --git a/patches/server/0041-lithium-entity.fast_powder_snow_check.patch b/patches/server/0037-lithium-entity.fast_powder_snow_check.patch similarity index 83% rename from patches/server/0041-lithium-entity.fast_powder_snow_check.patch rename to patches/server/0037-lithium-entity.fast_powder_snow_check.patch index de84c63..eb48808 100644 --- a/patches/server/0041-lithium-entity.fast_powder_snow_check.patch +++ b/patches/server/0037-lithium-entity.fast_powder_snow_check.patch @@ -7,10 +7,10 @@ Original code by CaffeineMC, licensed under GNU Lesser General Public License v3 You can find the original code on https://github.com/CaffeineMC/lithium-fabric (Yarn mappings) diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index f24b8baf01c4e25c0ddff6f7726d1ac6d5345930..857fb16dfb9593ea1ef1da7c4f80f0f7f5a729f7 100644 +index 85f4b06cf4062fcc8199b66dd926dbe352584210..be8060a46399f5d9c09003c2144f4b46b659cef5 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -570,11 +570,11 @@ public abstract class LivingEntity extends Entity { +@@ -565,11 +565,11 @@ public abstract class LivingEntity extends Entity implements Attackable { } protected void tryAddFrost() { @@ -24,7 +24,7 @@ index f24b8baf01c4e25c0ddff6f7726d1ac6d5345930..857fb16dfb9593ea1ef1da7c4f80f0f7 if (attributemodifiable == null) { return; -@@ -584,7 +584,7 @@ public abstract class LivingEntity extends Entity { +@@ -579,7 +579,7 @@ public abstract class LivingEntity extends Entity implements Attackable { attributemodifiable.addTransientModifier(new AttributeModifier(LivingEntity.SPEED_MODIFIER_POWDER_SNOW_UUID, "Powder snow slow", (double) f, AttributeModifier.Operation.ADDITION)); } diff --git a/patches/server/0042-lithium-collections.attributes.patch b/patches/server/0038-lithium-collections.attributes.patch similarity index 100% rename from patches/server/0042-lithium-collections.attributes.patch rename to patches/server/0038-lithium-collections.attributes.patch diff --git a/patches/server/0043-lithium-collections.entity_by_type.patch b/patches/server/0039-lithium-collections.entity_by_type.patch similarity index 100% rename from patches/server/0043-lithium-collections.entity_by_type.patch rename to patches/server/0039-lithium-collections.entity_by_type.patch diff --git a/patches/server/0044-lithium-collections.entity_filtering.patch b/patches/server/0040-lithium-collections.entity_filtering.patch similarity index 100% rename from patches/server/0044-lithium-collections.entity_filtering.patch rename to patches/server/0040-lithium-collections.entity_filtering.patch diff --git a/patches/server/0045-lithium-chunk.serialization.patch b/patches/server/0041-lithium-chunk.serialization.patch similarity index 98% rename from patches/server/0045-lithium-chunk.serialization.patch rename to patches/server/0041-lithium-chunk.serialization.patch index 12d66eb..479d832 100644 --- a/patches/server/0045-lithium-chunk.serialization.patch +++ b/patches/server/0041-lithium-chunk.serialization.patch @@ -309,7 +309,7 @@ index acae3eb30e0689048937f479dc3070f0688abdad..9c2b79655f2c63a208c7087d5d897db0 int onResize(int newBits, T object); } diff --git a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java -index 3c7ef1e8e338a84eee34f39ce73e64876632ea87..ade64cbde3e9929557c3c7305af2568bc350938f 100644 +index 7c770d131d39da6900fdd22df36707d5f43e8cd0..34e98db58044d87c8264c977e16dd17a36182501 100644 --- a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java +++ b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java @@ -22,8 +22,23 @@ import net.minecraft.util.Mth; @@ -336,7 +336,7 @@ index 3c7ef1e8e338a84eee34f39ce73e64876632ea87..ade64cbde3e9929557c3c7305af2568b private static final int MIN_PALETTE_BITS = 0; private final PaletteResize dummyPaletteResize = (newSize, added) -> { return 0; -@@ -299,30 +314,54 @@ public class PalettedContainer implements PaletteResize, PalettedContainer +@@ -303,30 +318,54 @@ public class PalettedContainer implements PaletteResize, PalettedContainer public synchronized PalettedContainerRO.PackedData pack(IdMap idList, PalettedContainer.Strategy paletteProvider) { // Paper - synchronize this.acquire(); @@ -408,7 +408,7 @@ index 3c7ef1e8e338a84eee34f39ce73e64876632ea87..ade64cbde3e9929557c3c7305af2568b } private static void swapPalette(int[] is, IntUnaryOperator applier) { -@@ -362,17 +401,37 @@ public class PalettedContainer implements PaletteResize, PalettedContainer +@@ -366,17 +405,37 @@ public class PalettedContainer implements PaletteResize, PalettedContainer @Override public void count(PalettedContainer.CountConsumer counter) { diff --git a/patches/server/0046-lithium-cache-iterate-outwards.patch b/patches/server/0042-lithium-cache-iterate-outwards.patch similarity index 98% rename from patches/server/0046-lithium-cache-iterate-outwards.patch rename to patches/server/0042-lithium-cache-iterate-outwards.patch index e261314..4152e1d 100644 --- a/patches/server/0046-lithium-cache-iterate-outwards.patch +++ b/patches/server/0042-lithium-cache-iterate-outwards.patch @@ -138,7 +138,7 @@ index 0000000000000000000000000000000000000000..493661ff3ac7247b68b7b02784b09b0e +} \ No newline at end of file diff --git a/src/main/java/net/minecraft/core/BlockPos.java b/src/main/java/net/minecraft/core/BlockPos.java -index b1d12c78edf21cc29a9f9ca54e7957ddc8875ffb..b52dc7290d40ed68d6ce3cfa6dd071ab98242b19 100644 +index b37e0ff164a894d2033fb94bbbc2f630a0e66bcd..79eae7a38ecfdf438f13ec7573326585b3c5f466 100644 --- a/src/main/java/net/minecraft/core/BlockPos.java +++ b/src/main/java/net/minecraft/core/BlockPos.java @@ -18,6 +18,12 @@ import net.minecraft.world.phys.AABB; @@ -154,7 +154,7 @@ index b1d12c78edf21cc29a9f9ca54e7957ddc8875ffb..b52dc7290d40ed68d6ce3cfa6dd071ab @Immutable public class BlockPos extends Vec3i { -@@ -288,7 +294,18 @@ public class BlockPos extends Vec3i { +@@ -279,7 +285,18 @@ public class BlockPos extends Vec3i { }; } diff --git a/patches/server/0047-vmp-use-linked-map-for-entity-trackers-for-faster-it.patch b/patches/server/0043-vmp-use-linked-map-for-entity-trackers-for-faster-it.patch similarity index 87% rename from patches/server/0047-vmp-use-linked-map-for-entity-trackers-for-faster-it.patch rename to patches/server/0043-vmp-use-linked-map-for-entity-trackers-for-faster-it.patch index 29229d4..9af3bd7 100644 --- a/patches/server/0047-vmp-use-linked-map-for-entity-trackers-for-faster-it.patch +++ b/patches/server/0043-vmp-use-linked-map-for-entity-trackers-for-faster-it.patch @@ -9,10 +9,10 @@ Original code by RelativityMC, licensed under MIT You can find the original code on https://github.com/RelativityMC/VMP-fabric (Yarn mappings) diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index 3d78c10a5442bfa5d4beae2546378b3822f0465d..d87f255670b9969040b26c9ba5571ceb2799756f 100644 +index 364d899f4fba65f0ecae522c7dde4f1ef8ee632e..6ae3f09f01e7ad72d46aeb950cca83b0d2a8d88b 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -114,6 +114,7 @@ import org.bukkit.entity.Player; +@@ -117,6 +117,7 @@ import org.bukkit.entity.Player; // CraftBukkit end import it.unimi.dsi.fastutil.objects.ReferenceOpenHashSet; // Paper @@ -20,7 +20,7 @@ index 3d78c10a5442bfa5d4beae2546378b3822f0465d..d87f255670b9969040b26c9ba5571ceb public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider { -@@ -295,7 +296,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -298,7 +299,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider // Paper - rewrite chunk system this.tickingGenerated = new AtomicInteger(); this.playerMap = new PlayerMap(); diff --git a/patches/server/0048-lithium-block.moving_block_shapes.patch b/patches/server/0044-lithium-block.moving_block_shapes.patch similarity index 100% rename from patches/server/0048-lithium-block.moving_block_shapes.patch rename to patches/server/0044-lithium-block.moving_block_shapes.patch diff --git a/patches/server/0049-Fix-MC-93826.patch b/patches/server/0045-Fix-MC-93826.patch similarity index 100% rename from patches/server/0049-Fix-MC-93826.patch rename to patches/server/0045-Fix-MC-93826.patch diff --git a/patches/server/0050-Optimize-default-values-for-configs.patch b/patches/server/0046-Optimize-default-values-for-configs.patch similarity index 99% rename from patches/server/0050-Optimize-default-values-for-configs.patch rename to patches/server/0046-Optimize-default-values-for-configs.patch index 1c71b92..f788df2 100644 --- a/patches/server/0050-Optimize-default-values-for-configs.patch +++ b/patches/server/0046-Optimize-default-values-for-configs.patch @@ -43,7 +43,7 @@ index 01bdf134fc21220ab7ecca51f2dcd51c0b466bba..83373befc7357094a13c74bf87ac1480 public boolean useDimensionTypeForCustomSpawners = false; public boolean strictAdvancementDimensionCheck = false; diff --git a/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java b/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java -index 4532f3a0d74feae0a1249b53e1bfbc18a8808b32..dc7a555c8e2ccdf1b0451759efc33e915a416abe 100644 +index 51cf0014c4229fc8671804d885b6381996810130..b4a3207ddb31d44e95732f2f01fbaceadfbf01b2 100644 --- a/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java +++ b/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java @@ -115,9 +115,9 @@ public class WorldConfiguration extends ConfigurationPart { diff --git a/patches/server/0047-Dynamic-minecart-speed.patch b/patches/server/0047-Dynamic-minecart-speed.patch new file mode 100644 index 0000000..1fb83f8 --- /dev/null +++ b/patches/server/0047-Dynamic-minecart-speed.patch @@ -0,0 +1,208 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: SoSeDiK +Date: Fri, 2 Dec 2022 21:44:23 +0200 +Subject: [PATCH] Dynamic minecart speed + + +diff --git a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java +index 9a80cf593bbdd7681bc9395daf4545a98e07636f..012d4ad1651d7a9118b24e0589d8bdf28ed0b708 100644 +--- a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java ++++ b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java +@@ -573,7 +573,108 @@ public abstract class AbstractMinecart extends Entity { + d5 = -d5; + } + +- double d8 = Math.min(2.0D, vec3d1.horizontalDistance()); ++ // Kiterino start - dynamic minecart speed ++ double vanillaMaxHorizontalMovementPerTick = 0.4D; ++ double horizontalMomentumPerTick = vec3d1.horizontalDistance(); ++ ++ java.util.function.DoubleSupplier calculateMaxHorizontalMovementPerTick = () -> { ++ final double fallbackSpeedFactor = 1.15D; ++ double fallback = this.getMaxSpeed(); ++ ++ if (this.getPassengers().isEmpty()) ++ return fallback; ++ ++ if (horizontalMomentumPerTick < vanillaMaxHorizontalMovementPerTick) ++ return fallback; ++ ++ fallback *= fallbackSpeedFactor; ++ ++ boolean hasEligibleShape = blockpropertytrackposition == RailShape.NORTH_SOUTH || blockpropertytrackposition == RailShape.EAST_WEST; ++ if (!hasEligibleShape) ++ return fallback; ++ ++ boolean hasEligibleType = state.is(Blocks.RAIL) || (state.is(Blocks.POWERED_RAIL) && state.getValue(PoweredRailBlock.POWERED)); ++ if (!hasEligibleType) ++ return fallback; ++ ++ var eligibleNeighbors = new java.util.concurrent.atomic.AtomicInteger(); ++ ++ java.util.HashSet checkedPositions = new java.util.HashSet<>(); ++ checkedPositions.add(pos); ++ ++ java.util.function.BiFunction>> checkNeighbors = (cPos, cRailShape) -> { ++ Pair cAdjPosDiff = AbstractMinecart.exits(cRailShape); ++ java.util.ArrayList> newNeighbors = new java.util.ArrayList<>(); ++ ++ BlockPos n1Pos = cPos.offset(cAdjPosDiff.getFirst()); ++ ++ if (!checkedPositions.contains(n1Pos)) { ++ BlockState n1State = this.level.getBlockState(n1Pos); ++ boolean n1HasEligibleType = n1State.is(Blocks.RAIL) || (n1State.is(Blocks.POWERED_RAIL) && n1State.getValue(PoweredRailBlock.POWERED)); ++ if (!n1HasEligibleType) ++ return new java.util.ArrayList<>(); ++ ++ RailShape n1RailShape = n1State.getValue(((BaseRailBlock) n1State.getBlock()).getShapeProperty()); ++ if (n1RailShape != blockpropertytrackposition) ++ return new java.util.ArrayList<>(); ++ ++ checkedPositions.add(n1Pos); ++ eligibleNeighbors.incrementAndGet(); ++ newNeighbors.add(Pair.of(n1Pos, n1RailShape)); ++ } ++ ++ BlockPos n2Pos = cPos.offset(cAdjPosDiff.getSecond()); ++ if (!checkedPositions.contains(n2Pos)) { ++ BlockState n2State = this.level.getBlockState(n2Pos); ++ boolean n2HasEligibleType = n2State.is(Blocks.RAIL) || (n2State.is(Blocks.POWERED_RAIL) && n2State.getValue(PoweredRailBlock.POWERED)); ++ if (!n2HasEligibleType) ++ return new java.util.ArrayList<>(); ++ ++ RailShape n2RailShape = n2State.getValue(((BaseRailBlock) n2State.getBlock()).getShapeProperty()); ++ ++ if (n2RailShape != blockpropertytrackposition) ++ return new java.util.ArrayList<>(); ++ ++ checkedPositions.add(n2Pos); ++ eligibleNeighbors.incrementAndGet(); ++ newNeighbors.add(Pair.of(n2Pos, n2RailShape)); ++ } ++ ++ return newNeighbors; ++ }; ++ ++ ++ java.util.ArrayList> newNeighbors = checkNeighbors.apply(pos, blockpropertytrackposition); ++ ++ while (!newNeighbors.isEmpty() && eligibleNeighbors.get() < 16) { ++ java.util.ArrayList> tempNewNeighbors = new java.util.ArrayList<>(newNeighbors); ++ newNeighbors.clear(); ++ ++ for (Pair newNeighbor : tempNewNeighbors) { ++ java.util.ArrayList> result = checkNeighbors.apply(newNeighbor.getFirst(), newNeighbor.getSecond()); ++ ++ if (result.isEmpty()) { ++ newNeighbors.clear(); ++ break; ++ } ++ ++ newNeighbors.addAll(result); ++ } ++ } ++ ++ int eligibleForwardRailTrackCount = eligibleNeighbors.get() / 2; ++ ++ if (eligibleForwardRailTrackCount <= 1) ++ return fallback; ++ ++ return (2.01D + eligibleForwardRailTrackCount * 4D) / 20D; ++ }; ++ ++ double maxHorizontalMovementPerTick = calculateMaxHorizontalMovementPerTick.getAsDouble(); ++ double maxHorizontalMomentumPerTick = Math.max(maxHorizontalMovementPerTick * 5D, 4.2D); ++ // Kiterino end ++ ++ double d8 = Math.min(maxHorizontalMomentumPerTick, vec3d1.horizontalDistance()); // Kiterino - dynamic minecart speed, unhardcode 2.0D + + vec3d1 = new Vec3(d8 * d4 / d6, vec3d1.y, d8 * d5 / d6); + this.setDeltaMovement(vec3d1); +@@ -596,8 +697,15 @@ public abstract class AbstractMinecart extends Entity { + d11 = this.getDeltaMovement().horizontalDistance(); + if (d11 < 0.03D) { + this.setDeltaMovement(Vec3.ZERO); +- } else { +- this.setDeltaMovement(this.getDeltaMovement().multiply(0.5D, 0.0D, 0.5D)); ++ } ++ else { ++ // Kiterino start - dynamic minecart speed ++ double brakeFactor = 0.5D; ++ if (horizontalMomentumPerTick > 4D * vanillaMaxHorizontalMovementPerTick) { ++ brakeFactor = Math.pow(brakeFactor, 1D + ((horizontalMomentumPerTick - 3.99D * vanillaMaxHorizontalMovementPerTick) / 1.2D)); ++ } ++ // Kiterino end ++ this.setDeltaMovement(this.getDeltaMovement().multiply(brakeFactor, 0.0D, brakeFactor)); // Kiterino - dynamic minecart speed, unhardcode 0.5D + } + } + +@@ -626,9 +734,10 @@ public abstract class AbstractMinecart extends Entity { + d2 = d12 + d5 * d15; + this.setPos(d0, d1, d2); + d16 = this.isVehicle() ? 0.75D : 1.0D; +- d17 = this.getMaxSpeed(); ++ d17 = maxHorizontalMomentumPerTick; + vec3d1 = this.getDeltaMovement(); +- this.move(MoverType.SELF, new Vec3(Mth.clamp(d16 * vec3d1.x, -d17, d17), 0.0D, Mth.clamp(d16 * vec3d1.z, -d17, d17))); ++ var movement = new Vec3(Mth.clamp(d16 * vec3d1.x, -d17, d17), 0D, Mth.clamp(d16 * vec3d1.z, -d17, d17)); ++ this.move(MoverType.SELF, movement); // Kiterino - dynamic minecart speed, expose into the variable + if (baseblockposition.getY() != 0 && Mth.floor(this.getX()) - pos.getX() == baseblockposition.getX() && Mth.floor(this.getZ()) - pos.getZ() == baseblockposition.getZ()) { + this.setPos(this.getX(), this.getY() + (double) baseblockposition.getY(), this.getZ()); + } else if (baseblockposition1.getY() != 0 && Mth.floor(this.getX()) - pos.getX() == baseblockposition1.getX() && Mth.floor(this.getZ()) - pos.getZ() == baseblockposition1.getZ()) { +@@ -658,26 +767,52 @@ public abstract class AbstractMinecart extends Entity { + if (i != pos.getX() || j != pos.getZ()) { + vec3d4 = this.getDeltaMovement(); + d18 = vec3d4.horizontalDistance(); +- this.setDeltaMovement(d18 * (double) (i - pos.getX()), vec3d4.y, d18 * (double) (j - pos.getZ())); ++ this.setDeltaMovement(d18 * Mth.clamp((double) i - pos.getX(), -1D, 1D), vec3d4.y, d18 * Mth.clamp((double) j - pos.getZ(), -1D, 1D)); // Kiterino - dynamic minecart speed, clamp values + } + + if (flag) { + vec3d4 = this.getDeltaMovement(); + d18 = vec3d4.horizontalDistance(); ++ final double basisAccelerationPerTick = 0.021D; // Kiterino - dynamic minecart speed + if (d18 > 0.01D) { ++ // Kiterino start - dynamic minecart speed ++ if (!getPassengers().isEmpty()) { ++ // Based on 10 ticks per second basis spent per powered block we calculate a fair acceleration per tick ++ // due to spending less ticks per powered block on higher speeds (and even skipping blocks) ++ final double basisTicksPerSecond = 10D; ++ // Tps = Ticks per second ++ final double tickMovementForBasisTps = 1D / basisTicksPerSecond; ++ final double maxSkippedBlocksToConsider = 3D; ++ ++ double acceleration = basisAccelerationPerTick; ++ final double distanceMovedHorizontally = movement.horizontalDistance(); ++ ++ if (distanceMovedHorizontally > tickMovementForBasisTps) { ++ acceleration *= Math.min((1D + maxSkippedBlocksToConsider) * basisTicksPerSecond, distanceMovedHorizontally / tickMovementForBasisTps); ++ ++ // Add progressively slower (or faster) acceleration for higher speeds; ++ double highspeedFactor = 1D + Mth.clamp(-0.45D * (distanceMovedHorizontally / tickMovementForBasisTps / basisTicksPerSecond), -0.7D, 2D); ++ acceleration *= highspeedFactor; ++ } ++ this.setDeltaMovement(vec3d4.add(acceleration * (vec3d4.x / d18), 0D, acceleration * (vec3d4.z / d18))); ++ } else { ++ this.setDeltaMovement(vec3d4.add(vec3d4.x / d18 * 0.06D, 0D, vec3d4.z / d18 * 0.06D)); ++ } ++ // Kiterino end + double d20 = 0.06D; + +- this.setDeltaMovement(vec3d4.add(vec3d4.x / d18 * 0.06D, 0.0D, vec3d4.z / d18 * 0.06D)); ++ // this.setDeltaMovement(vec3d4.add(vec3d4.x / d18 * 0.06D, 0.0D, vec3d4.z / d18 * 0.06D)); // Kiterino - dynamic minecart speed + } else { + Vec3 vec3d5 = this.getDeltaMovement(); + double d21 = vec3d5.x; + double d22 = vec3d5.z; ++ final double railStopperAcceleration = basisAccelerationPerTick * 16D; // Kiterino + + if (blockpropertytrackposition == RailShape.EAST_WEST) { + if (this.isRedstoneConductor(pos.west())) { +- d21 = 0.02D; ++ d21 = railStopperAcceleration; // Kiterino - dynamic minecart speed, unhardcode 0.02D + } else if (this.isRedstoneConductor(pos.east())) { +- d21 = -0.02D; ++ d21 = -railStopperAcceleration; // Kiterino - dynamic minecart speed, unhardcode -0.02D + } + } else { + if (blockpropertytrackposition != RailShape.NORTH_SOUTH) { diff --git a/patches/server/0048-Increase-manual-minecart-speed.patch b/patches/server/0048-Increase-manual-minecart-speed.patch new file mode 100644 index 0000000..72bebda --- /dev/null +++ b/patches/server/0048-Increase-manual-minecart-speed.patch @@ -0,0 +1,21 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: SoSeDiK +Date: Fri, 2 Dec 2022 23:05:04 +0200 +Subject: [PATCH] Increase manual minecart speed + + +diff --git a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java +index 012d4ad1651d7a9118b24e0589d8bdf28ed0b708..522a04150da9473812f1ae3406664c2ea392d2ba 100644 +--- a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java ++++ b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java +@@ -685,8 +685,8 @@ public abstract class AbstractMinecart extends Entity { + double d9 = vec3d2.horizontalDistanceSqr(); + double d10 = this.getDeltaMovement().horizontalDistanceSqr(); + +- if (d9 > 1.0E-4D && d10 < 0.01D) { +- this.setDeltaMovement(this.getDeltaMovement().add(vec3d2.x * 0.1D, 0.0D, vec3d2.z * 0.1D)); ++ if (d9 > 1.0E-4D && d10 < 0.04D) { // Kiterino - increase max manual speed ++ this.setDeltaMovement(this.getDeltaMovement().add(vec3d2.x * 0.12D, 0.0D, vec3d2.z * 0.12D)); // Kiterino - slightly increase speed buildup + flag1 = false; + } + } diff --git a/patches/server/0049-Allow-placing-rails-on-more-surfaces.patch b/patches/server/0049-Allow-placing-rails-on-more-surfaces.patch new file mode 100644 index 0000000..887f73e --- /dev/null +++ b/patches/server/0049-Allow-placing-rails-on-more-surfaces.patch @@ -0,0 +1,27 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: SoSeDiK +Date: Sun, 4 Dec 2022 21:57:07 +0200 +Subject: [PATCH] Allow placing rails on more surfaces + + +diff --git a/src/main/java/net/minecraft/world/level/block/BaseRailBlock.java b/src/main/java/net/minecraft/world/level/block/BaseRailBlock.java +index a3f877bf03f75cbfbd128c856322bcd427b95d21..96860dc68c7e7c59c27465a74b833e189db9d85b 100644 +--- a/src/main/java/net/minecraft/world/level/block/BaseRailBlock.java ++++ b/src/main/java/net/minecraft/world/level/block/BaseRailBlock.java +@@ -51,7 +51,7 @@ public abstract class BaseRailBlock extends Block implements SimpleWaterloggedBl + + @Override + public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) { +- return canSupportRigidBlock(world, pos.below()); ++ return canSupportCenter(world, pos.below(), Direction.UP); // Kiterino + } + + @Override +@@ -86,6 +86,7 @@ public abstract class BaseRailBlock extends Block implements SimpleWaterloggedBl + } + + private static boolean shouldBeRemoved(BlockPos pos, Level world, RailShape shape) { ++ if (canSupportCenter(world, pos.below(), Direction.UP)) return false; // Kiterino + if (!canSupportRigidBlock(world, pos.below())) { + return true; + } else { diff --git a/patches/server/0050-Paper-PR-Add-Entity-hidden-by-default-flag.patch b/patches/server/0050-Paper-PR-Add-Entity-hidden-by-default-flag.patch new file mode 100644 index 0000000..a9bd64b --- /dev/null +++ b/patches/server/0050-Paper-PR-Add-Entity-hidden-by-default-flag.patch @@ -0,0 +1,160 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Justin +Date: Wed, 24 Aug 2022 05:17:20 -0700 +Subject: [PATCH] Paper PR - Add Entity hidden by default flag + +Adds a boolean to the server Entity controlling if the entity should be hidden by default. +The TrackedEntity maintains a set of all players that will be able to see the entity even +when it is hidden by default. This set is modified when Player#showEntity and Player#hideEntity +are invoked. Changes are made to the way that TrackedEntity updates players when the entity is +hidden by default - if a player is not present in the above set, the update is abandoned. + +This functionality is expanded when a Player is hidden by default. The player will send out +PlayerInfo packets to hide themselves from other Players when hiddenByDefault. There remains a +discrepancy when trying to getHiddenPlayers - players that are hidden by default are currently +not returned from this method, only those hidden with hideEntity or hidePlayer. + +Hiding entities by default also respects precedent of keeping entities hidden when other plugins +explicitly hide them from a player. If an entity is hidden by default and by a plugin, the entity +must have the plugin that hid them from a player show them in order to be shown to a player again. +If no plugin had previously hidden the entity before the entity was hidden by default, then any +plugin that attempts to show the entity to a player will succeed in doing so. + +diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java +index 6ae3f09f01e7ad72d46aeb950cca83b0d2a8d88b..07985de694f76e55f8eef2ac7dca6e404980519d 100644 +--- a/src/main/java/net/minecraft/server/level/ChunkMap.java ++++ b/src/main/java/net/minecraft/server/level/ChunkMap.java +@@ -1515,6 +1515,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider + private final int range; + SectionPos lastSectionPos; + public final Set seenBy = new ReferenceOpenHashSet<>(); // Paper - optimise map impl ++ public final Set showToEvenWhenHiddenByDefault = new ReferenceOpenHashSet<>(); // Paper - Entity hiddenByDefault + + public TrackedEntity(Entity entity, int i, int j, boolean flag) { + this.serverEntity = new ServerEntity(ChunkMap.this.level, entity, j, flag, this::broadcast, this.seenBy); // CraftBukkit +diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java +index e273fed8e97c98bf5735d3a8c301968990d4cf32..21d980628bcaf80ed8809122766b626713974ed4 100644 +--- a/src/main/java/net/minecraft/world/entity/Entity.java ++++ b/src/main/java/net/minecraft/world/entity/Entity.java +@@ -400,6 +400,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { + private UUID originWorld; + public boolean freezeLocked = false; // Paper - Freeze Tick Lock API + public boolean collidingWithWorldBorder; // Paper ++ public boolean hiddenByDefault; // Paper + + public void setOrigin(@javax.annotation.Nonnull Location location) { + this.origin = location.toVector(); +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +index 57a0dbb23a32123d30c3b3572f4d129be9d97847..6286431870438767e779f37aef1e6d9dd9fbec65 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +@@ -1442,4 +1442,30 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { + return !this.getHandle().level.noCollision(this.getHandle(), aabb); + } + // Paper End - Collision API ++ ++ // Paper start - Entity hiddenByDefault ++ @Override ++ public void setHiddenByDefault(boolean hiddenByDefault) { ++ this.getHandle().hiddenByDefault = hiddenByDefault; ++ ++ // We need to update the players again ++ ChunkMap.TrackedEntity entityTracker = this.getHandle().tracker; ++ ++ // Tracker was not initialized yet ++ if (entityTracker == null) { ++ return; ++ } ++ ++ // If the entity is already hiddenByDefault, we reset our "show to" set to again hide the entity from all players that may be seeing the entity ++ // We also clear the "show to" set when we stop hiding by default ++ entityTracker.showToEvenWhenHiddenByDefault.clear(); ++ ++ entityTracker.updatePlayers(this.server.getHandle().getPlayers()); ++ } ++ ++ @Override ++ public boolean isHiddenByDefault() { ++ return this.getHandle().hiddenByDefault; ++ } ++ // Paper end + } +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +index 1bada55af5d16437da4d16f9ded55f88a6121eb4..0fbc2971cdf15799c1f0beb1b3670894c41db9c8 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +@@ -1814,6 +1814,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { + ChunkMap tracker = ((ServerLevel) this.getHandle().level).getChunkSource().chunkMap; + ChunkMap.TrackedEntity entry = tracker.entityMap.get(other.getId()); + if (entry != null) { ++ entry.showToEvenWhenHiddenByDefault.remove(this.getHandle().connection); // Paper - Entity hiddenByDefault + entry.removePlayer(this.getHandle()); + } + +@@ -1892,9 +1893,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { + } + + ChunkMap.TrackedEntity entry = tracker.entityMap.get(other.getId()); +- if (entry != null && !entry.seenBy.contains(this.getHandle().connection)) { +- entry.updatePlayer(this.getHandle()); ++ // Paper start - Entity hiddenByDefault ++ if (entry != null) { ++ entry.showToEvenWhenHiddenByDefault.add(this.getHandle().connection); ++ ++ if (!entry.seenBy.contains(this.getHandle().connection)) { ++ entry.updatePlayer(this.getHandle()); ++ } + } ++ // Paper end + server.getPluginManager().callEvent(new PlayerShowEntityEvent(this, entity)); // Paper + } + // Paper start +@@ -1970,7 +1977,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player { + + @Override + public boolean canSee(org.bukkit.entity.Entity entity) { +- return entity.isVisibleByDefault() ^ this.invertedVisibilityEntities.containsKey(entity.getUniqueId()); ++ // Paper start - Entity hiddenByDefault ++ boolean shownWhenHiddenByDefault = true; ++ ++ if (entity.isHiddenByDefault()) { ++ ChunkMap.TrackedEntity tracker = ((CraftEntity) entity).getHandle().tracker; ++ shownWhenHiddenByDefault = tracker == null || tracker.showToEvenWhenHiddenByDefault.contains(this.getHandle().connection); ++ } ++ ++ return shownWhenHiddenByDefault && (entity.isVisibleByDefault() ^ this.invertedVisibilityEntities.containsKey(entity.getUniqueId())); ++ // Paper end + } + + public boolean canSee(UUID uuid) { +@@ -3143,6 +3159,30 @@ public class CraftPlayer extends CraftHumanEntity implements Player { + } + // Paper end + ++ // Paper start - Entity hiddenByDefault ++ @Override ++ public void setHiddenByDefault(boolean hiddenByDefault) { ++ // Update server lists ++ if (hiddenByDefault) { ++ for (CraftPlayer player : this.server.getOnlinePlayers()) { ++ if (player == this || !player.canSee(this)) continue; ++ ++ player.getHandle().connection.send(new ClientboundPlayerInfoRemovePacket(List.of(this.getHandle().getUUID()))); ++ } ++ } else { ++ for (CraftPlayer player : this.server.getOnlinePlayers()) { ++ if (player == this || player.canSee(this)) continue; ++ ++ player.getHandle().connection.send(new ClientboundPlayerInfoUpdatePacket(ClientboundPlayerInfoUpdatePacket.Action.ADD_PLAYER, this.getHandle())); ++ } ++ } ++ ++ // Now, process trackers ++ super.setHiddenByDefault(hiddenByDefault); ++ } ++ // Paper end ++ ++ + public Player.Spigot spigot() + { + return this.spigot;