From bc0dd0df3dfb03e10ce30951ad2ae177ff0ed5b3 Mon Sep 17 00:00:00 2001 From: Josh Roy Date: Fri, 26 Nov 2021 17:58:39 -0500 Subject: [PATCH] Updated Upstream (Bukkit/CraftBukkit/Spigot) Upstream has released updates that appear to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Bukkit Changes: 716b4fce Revert SnakeYAML upgrade ca6f8942 Update to Minecraft 1.18-rc3 57e7e952 #683: Add Player#showDemoScreen CraftBukkit Changes: c98abfb0 Update to Minecraft 1.18-rc3 9b258501 #960: Add Player#showDemoScreen d9542247 Produce remapped jars after bootstrap jar 99f3ddde SPIGOT-6808: Fix RegionAccessor#getBiome Spigot Changes: b7a4222e Update to Minecraft 1.18-rc3 --- build.gradle.kts | 2 +- gradle.properties | 4 +- .../api/0001-Convert-project-to-Gradle.patch | 4 +- patches/api/0006-Timings-v2.patch | 4 +- patches/api/0008-Adventure.patch | 14 +++--- .../api/0025-Complete-resource-pack-API.patch | 4 +- ...0045-Add-String-based-Action-Bar-API.patch | 6 +-- .../0091-Player.setPlayerProfile-API.patch | 4 +- ...e-attack-cooldown-methods-for-Player.patch | 4 +- .../0196-Add-Player-Client-Options-API.patch | 4 +- patches/api/0220-Brand-support.patch | 4 +- .../api/0229-Player-elytra-boost-API.patch | 4 +- patches/api/0257-Add-sendOpLevel-API.patch | 4 +- .../server/0001-Setup-Gradle-project.patch | 8 ++-- patches/server/0005-MC-Dev-fixes.patch | 8 ++-- patches/server/0006-MC-Utils.patch | 44 +++++++++--------- patches/server/0010-Timings-v2.patch | 20 ++++---- patches/server/0012-Adventure.patch | 22 ++++----- .../0023-Player-affects-spawning-API.patch | 6 +-- ...026-Only-refresh-abilities-if-needed.patch | 4 +- ...39-Implement-PlayerLocaleChangeEvent.patch | 4 +- ...layer-View-Distance-API-placeholders.patch | 4 +- .../0052-Player-Tab-List-and-Title-APIs.patch | 4 +- ...ble-inter-world-teleportation-safety.patch | 4 +- .../0056-Add-exception-reporting-event.patch | 4 +- .../0061-Complete-resource-pack-API.patch | 8 ++-- ...th-absorb-values-and-repair-bad-data.patch | 6 +-- ...nd-for-setting-passengers-on-players.patch | 4 +- .../0122-String-based-Action-Bar-API.patch | 4 +- ...nt-protocol-version-and-virtual-host.patch | 4 +- ...0-Ability-to-apply-mending-to-XP-API.patch | 4 +- ...1-PlayerNaturallySpawnCreaturesEvent.patch | 6 +-- .../0183-Player.setPlayerProfile-API.patch | 10 ++-- ...89-Flag-to-disable-the-channel-limit.patch | 6 +-- .../0218-InventoryCloseEvent-Reason-API.patch | 4 +- ...ies-option-to-debug-dupe-uuid-issues.patch | 6 +-- ...57-Asynchronous-chunk-IO-and-loading.patch | 30 ++++++------ ...e-attack-cooldown-methods-for-Player.patch | 4 +- .../server/0260-Improve-death-events.patch | 6 +-- ...-replace-OfflinePlayer-getLastPlayed.patch | 10 ++-- ...-remove-from-being-called-on-Players.patch | 4 +- ...334-Fix-World-isChunkGenerated-calls.patch | 6 +-- .../0346-Duplicate-UUID-Resolve-Option.patch | 10 ++-- patches/server/0360-Fix-Light-Command.patch | 6 +-- .../0362-Tracking-Range-Improvements.patch | 4 +- ...ement-optional-per-player-mob-spawns.patch | 8 ++-- ...-PlayerChunkMap-adds-crashing-server.patch | 4 +- .../0393-Improved-Watchdog-Support.patch | 8 ++-- ...-Implement-Player-Client-Options-API.patch | 4 +- ...-Chunk-Post-Processing-deadlock-risk.patch | 6 +-- ...g-Broken-behavior-of-PlayerJoinEvent.patch | 4 +- ...llocation-of-Vec3D-by-entity-tracker.patch | 4 +- ...erCloseEnoughForSpawning-to-use-dist.patch | 12 ++--- ...tance-map-to-optimise-entity-tracker.patch | 22 ++++----- .../0456-incremental-chunk-saving.patch | 20 ++++---- ...-Remove-some-streams-from-structures.patch | 8 ++-- ...k-Priority-Urgency-System-for-Chunks.patch | 46 +++++++++---------- patches/server/0485-Brand-support.patch | 4 +- ...mprove-Chunk-Status-Transition-Speed.patch | 8 ++-- .../server/0522-Player-elytra-boost-API.patch | 4 +- ...r-spawnParticle-x-y-z-precision-loss.patch | 4 +- patches/server/0578-Add-sendOpLevel-API.patch | 6 +-- ...ditions-to-PlayerGameModeChangeEvent.patch | 4 +- .../0668-Add-PlayerKickEvent-causes.patch | 4 +- ...ttedContainer-instead-of-ReentrantLo.patch | 16 +++---- .../server/0705-Add-PlayerSetSpawnEvent.patch | 6 +-- ...6-Make-CallbackExecutor-strict-again.patch | 4 +- ...le-recursion-for-chunkholder-updates.patch | 6 +-- ...chunks-refusing-to-unload-at-low-TPS.patch | 4 +- ...ket-level-changes-while-unloading-pl.patch | 10 ++-- ...ket-level-changes-when-updating-chun.patch | 6 +-- .../0752-Do-not-copy-visible-chunks.patch | 26 +++++------ ...primise-map-impl-for-tracked-players.patch | 6 +-- .../0772-Optimise-random-block-ticking.patch | 6 +-- .../0774-Optimise-nearby-player-lookups.patch | 14 +++--- .../0775-Optimise-WorldServer-notify.patch | 6 +-- ...I-O-threads-with-chunk-data-while-fl.patch | 6 +-- work/BuildData | 2 +- work/Bukkit | 2 +- work/CraftBukkit | 2 +- work/Spigot | 2 +- 81 files changed, 320 insertions(+), 320 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 4885c0be6..2e36928c9 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -46,7 +46,7 @@ repositories { } dependencies { - paramMappings("net.fabricmc:yarn:1.18-pre8+build.4:mergedv2") + paramMappings("net.fabricmc:yarn:1.18-rc3+build.1:mergedv2") remapper("net.fabricmc:tiny-remapper:0.7.0:fat") decompiler("net.minecraftforge:forgeflower:1.5.498.22") paperclip("io.papermc:paperclip:3.0.0-SNAPSHOT") diff --git a/gradle.properties b/gradle.properties index 07543018c..756f59c21 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,7 @@ group=io.papermc.paper -version=1.18-pre8-R0.1-SNAPSHOT +version=1.18-rc3-R0.1-SNAPSHOT -mcVersion=1.18-pre8 +mcVersion=1.18-rc3 org.gradle.caching=true org.gradle.parallel=true diff --git a/patches/api/0001-Convert-project-to-Gradle.patch b/patches/api/0001-Convert-project-to-Gradle.patch index 58e9cb85f..6c9fd3f40 100644 --- a/patches/api/0001-Convert-project-to-Gradle.patch +++ b/patches/api/0001-Convert-project-to-Gradle.patch @@ -98,7 +98,7 @@ index 0000000000000000000000000000000000000000..3ccff060bcb816520a27ec2f34adc977 +} diff --git a/pom.xml b/pom.xml deleted file mode 100644 -index c8947e43bcd83c51d79ebe5a110445bf1e5388b2..0000000000000000000000000000000000000000 +index 8a8fa2c76ecbd78b5bc57fe0be9abca5dc20ad86..0000000000000000000000000000000000000000 --- a/pom.xml +++ /dev/null @@ -1,262 +0,0 @@ @@ -109,7 +109,7 @@ index c8947e43bcd83c51d79ebe5a110445bf1e5388b2..00000000000000000000000000000000 - - org.spigotmc - spigot-api -- 1.18-pre8-R0.1-SNAPSHOT +- 1.18-rc3-R0.1-SNAPSHOT - jar - - Spigot-API diff --git a/patches/api/0006-Timings-v2.patch b/patches/api/0006-Timings-v2.patch index 633794390..5e8b707b9 100644 --- a/patches/api/0006-Timings-v2.patch +++ b/patches/api/0006-Timings-v2.patch @@ -3377,10 +3377,10 @@ index 2a145d851ce30360aa39549745bd87590c034584..00000000000000000000000000000000 - // Spigot end -} diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index 2be4482640e15ea0b621b3655a5cb3ed01d15c3e..ad1a3148b05f4fef26c9d587da94e01cdbfa3c3c 100644 +index 7fb4a190e24064a3bcf7d3c9f80bdae557995532..dcc40efd20b07cd2bc423c7fdb4f9d0adb91adcb 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java -@@ -1418,7 +1418,14 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -1426,7 +1426,14 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM */ public void sendMessage(@NotNull net.md_5.bungee.api.ChatMessageType position, @Nullable UUID sender, @NotNull net.md_5.bungee.api.chat.BaseComponent... components) { throw new UnsupportedOperationException("Not supported yet."); diff --git a/patches/api/0008-Adventure.patch b/patches/api/0008-Adventure.patch index c55dee4ea..51aa9edaa 100644 --- a/patches/api/0008-Adventure.patch +++ b/patches/api/0008-Adventure.patch @@ -1549,7 +1549,7 @@ index 25a6f9313a1953def7470e411b53016f2ca14bef..10cb6088c4618f228c757f4e592b44ed + // Paper end } diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index ad1a3148b05f4fef26c9d587da94e01cdbfa3c3c..1140c29cffaac3c25f7d2591e5d635d070206041 100644 +index dcc40efd20b07cd2bc423c7fdb4f9d0adb91adcb..87e06fb630e3aabe62e21323fde7625897d3781d 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java @@ -34,7 +34,28 @@ import org.jetbrains.annotations.Nullable; @@ -1890,7 +1890,7 @@ index ad1a3148b05f4fef26c9d587da94e01cdbfa3c3c..1140c29cffaac3c25f7d2591e5d635d0 public String getLocale(); /** -@@ -1314,6 +1497,14 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -1322,6 +1505,14 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM */ public boolean isAllowingServerListings(); @@ -1905,7 +1905,7 @@ index ad1a3148b05f4fef26c9d587da94e01cdbfa3c3c..1140c29cffaac3c25f7d2591e5d635d0 // Spigot start public class Spigot extends Entity.Spigot { -@@ -1368,11 +1559,13 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -1376,11 +1567,13 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM throw new UnsupportedOperationException("Not supported yet."); } @@ -1919,7 +1919,7 @@ index ad1a3148b05f4fef26c9d587da94e01cdbfa3c3c..1140c29cffaac3c25f7d2591e5d635d0 @Override public void sendMessage(@NotNull net.md_5.bungee.api.chat.BaseComponent... components) { throw new UnsupportedOperationException("Not supported yet."); -@@ -1383,7 +1576,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -1391,7 +1584,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM * * @param position the screen position * @param component the components to send @@ -1929,7 +1929,7 @@ index ad1a3148b05f4fef26c9d587da94e01cdbfa3c3c..1140c29cffaac3c25f7d2591e5d635d0 public void sendMessage(@NotNull net.md_5.bungee.api.ChatMessageType position, @NotNull net.md_5.bungee.api.chat.BaseComponent component) { throw new UnsupportedOperationException("Not supported yet."); } -@@ -1393,7 +1588,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -1401,7 +1596,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM * * @param position the screen position * @param components the components to send @@ -1939,7 +1939,7 @@ index ad1a3148b05f4fef26c9d587da94e01cdbfa3c3c..1140c29cffaac3c25f7d2591e5d635d0 public void sendMessage(@NotNull net.md_5.bungee.api.ChatMessageType position, @NotNull net.md_5.bungee.api.chat.BaseComponent... components) { throw new UnsupportedOperationException("Not supported yet."); } -@@ -1404,7 +1601,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -1412,7 +1609,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM * @param position the screen position * @param sender the sender of the message * @param component the components to send @@ -1949,7 +1949,7 @@ index ad1a3148b05f4fef26c9d587da94e01cdbfa3c3c..1140c29cffaac3c25f7d2591e5d635d0 public void sendMessage(@NotNull net.md_5.bungee.api.ChatMessageType position, @Nullable UUID sender, @NotNull net.md_5.bungee.api.chat.BaseComponent component) { throw new UnsupportedOperationException("Not supported yet."); } -@@ -1415,7 +1614,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -1423,7 +1622,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM * @param position the screen position * @param sender the sender of the message * @param components the components to send diff --git a/patches/api/0025-Complete-resource-pack-API.patch b/patches/api/0025-Complete-resource-pack-API.patch index 3545105bb..f3b67e721 100644 --- a/patches/api/0025-Complete-resource-pack-API.patch +++ b/patches/api/0025-Complete-resource-pack-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Complete resource pack API diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index 12acaa06a00a2a2d0c03e52920bb041af29bc01e..ab25e699ea936e2dae7cce41f850b55a381a6dcb 100644 +index e9883273d547c15ffde9a7feafd7abb00b0eb6dd..7816aa9fa7f64a9e24acfaba0c9b5e721559f97f 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java @@ -1217,7 +1217,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM @@ -18,7 +18,7 @@ index 12acaa06a00a2a2d0c03e52920bb041af29bc01e..ab25e699ea936e2dae7cce41f850b55a public void setResourcePack(@NotNull String url); /** -@@ -1737,6 +1739,124 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -1745,6 +1747,124 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM default net.kyori.adventure.text.event.HoverEvent asHoverEvent(final @NotNull java.util.function.UnaryOperator op) { return net.kyori.adventure.text.event.HoverEvent.showEntity(op.apply(net.kyori.adventure.text.event.HoverEvent.ShowEntity.of(this.getType().getKey(), this.getUniqueId(), this.displayName()))); } diff --git a/patches/api/0045-Add-String-based-Action-Bar-API.patch b/patches/api/0045-Add-String-based-Action-Bar-API.patch index a72960eac..a3d4dc027 100644 --- a/patches/api/0045-Add-String-based-Action-Bar-API.patch +++ b/patches/api/0045-Add-String-based-Action-Bar-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add String based Action Bar API diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index ab25e699ea936e2dae7cce41f850b55a381a6dcb..82e4b89bf280ad3f99d94c9aaa6075449737932a 100644 +index 7816aa9fa7f64a9e24acfaba0c9b5e721559f97f..1022fa402b8235ba130cf2122b8a64f9aeacbfdf 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java @@ -3,6 +3,7 @@ package org.bukkit.entity; @@ -68,7 +68,7 @@ index ab25e699ea936e2dae7cce41f850b55a381a6dcb..82e4b89bf280ad3f99d94c9aaa607544 public default void sendMessage(net.md_5.bungee.api.ChatMessageType position, net.md_5.bungee.api.chat.BaseComponent... components) { spigot().sendMessage(position, components); } -@@ -1928,6 +1964,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -1936,6 +1972,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM /** * Sends the component to the specified screen position of this player * @@ -76,7 +76,7 @@ index ab25e699ea936e2dae7cce41f850b55a381a6dcb..82e4b89bf280ad3f99d94c9aaa607544 * @param position the screen position * @param component the components to send * @deprecated use {@code sendMessage} methods that accept {@link net.kyori.adventure.text.Component} -@@ -1940,6 +1977,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -1948,6 +1985,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM /** * Sends an array of components as a single message to the specified screen position of this player * diff --git a/patches/api/0091-Player.setPlayerProfile-API.patch b/patches/api/0091-Player.setPlayerProfile-API.patch index 8ef563631..f2be4afdf 100644 --- a/patches/api/0091-Player.setPlayerProfile-API.patch +++ b/patches/api/0091-Player.setPlayerProfile-API.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Player.setPlayerProfile API This can be useful for changing name or skins after a player has logged in. diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index 8d5ddb1451ea1d7a7a5c9eefb843a4adb885d20e..0dabd6f69e85b21f7ec6e6a2ac46d7fc58af24f6 100644 +index b6e0014013906b12644d172d4e534ead5fb55a69..6c5ef41b4ba2754918efe98ef1fa41c8797b3399 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java @@ -4,6 +4,7 @@ import java.net.InetSocketAddress; @@ -17,7 +17,7 @@ index 8d5ddb1451ea1d7a7a5c9eefb843a4adb885d20e..0dabd6f69e85b21f7ec6e6a2ac46d7fc import org.bukkit.DyeColor; import org.bukkit.Effect; import org.bukkit.GameMode; -@@ -1914,6 +1915,20 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -1922,6 +1923,20 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM * was {@link org.bukkit.event.player.PlayerResourcePackStatusEvent.Status#SUCCESSFULLY_LOADED} */ boolean hasResourcePack(); diff --git a/patches/api/0149-Expose-attack-cooldown-methods-for-Player.patch b/patches/api/0149-Expose-attack-cooldown-methods-for-Player.patch index ee5d41291..355d9c82c 100644 --- a/patches/api/0149-Expose-attack-cooldown-methods-for-Player.patch +++ b/patches/api/0149-Expose-attack-cooldown-methods-for-Player.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Expose attack cooldown methods for Player diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index ac529faeb4e4be2e62228cc931a793f2ff0a28af..1bace560fc0632c702ff820a15defa730272ba75 100644 +index 11db3d8cc6e3410d7c6a950afed5eb8257dd86ee..37e315587de286b848ef9b70580335db0e1c72a1 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java -@@ -2089,6 +2089,26 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -2097,6 +2097,26 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM * @param profile The new profile to use */ void setPlayerProfile(@NotNull PlayerProfile profile); diff --git a/patches/api/0196-Add-Player-Client-Options-API.patch b/patches/api/0196-Add-Player-Client-Options-API.patch index 474e3dde2..8338b245d 100644 --- a/patches/api/0196-Add-Player-Client-Options-API.patch +++ b/patches/api/0196-Add-Player-Client-Options-API.patch @@ -193,7 +193,7 @@ index 0000000000000000000000000000000000000000..f7f171c4ee0b8339b2f8fbe82442d65f + } +} diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index 1bace560fc0632c702ff820a15defa730272ba75..7d4959a96e0cbf9b9e8a980ae4711d02ecd1a430 100644 +index 37e315587de286b848ef9b70580335db0e1c72a1..cac22060c3c439b63320d01fc09e3d5ab845c9f7 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java @@ -2,6 +2,7 @@ package org.bukkit.entity; @@ -204,7 +204,7 @@ index 1bace560fc0632c702ff820a15defa730272ba75..7d4959a96e0cbf9b9e8a980ae4711d02 import com.destroystokyo.paper.Title; // Paper import net.kyori.adventure.text.Component; import com.destroystokyo.paper.profile.PlayerProfile; // Paper -@@ -2109,6 +2110,12 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -2117,6 +2118,12 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM * Reset the cooldown counter to 0, effectively starting the cooldown period. */ void resetCooldown(); diff --git a/patches/api/0220-Brand-support.patch b/patches/api/0220-Brand-support.patch index 1f460de4b..5c4c98712 100644 --- a/patches/api/0220-Brand-support.patch +++ b/patches/api/0220-Brand-support.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Brand support diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index 7d4959a96e0cbf9b9e8a980ae4711d02ecd1a430..d0d44acb364bafca80e6efa04532b66663ca336a 100644 +index cac22060c3c439b63320d01fc09e3d5ab845c9f7..8c26d06de2c9c3016fd066f072e8d1a128c0e126 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java -@@ -2244,6 +2244,16 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -2252,6 +2252,16 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM // Paper end } diff --git a/patches/api/0229-Player-elytra-boost-API.patch b/patches/api/0229-Player-elytra-boost-API.patch index 15882b1b5..f3ceeb552 100644 --- a/patches/api/0229-Player-elytra-boost-API.patch +++ b/patches/api/0229-Player-elytra-boost-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Player elytra boost API diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index d0d44acb364bafca80e6efa04532b66663ca336a..e3d56cc4122de5237b89ed670493eecd3413b2b6 100644 +index 8c26d06de2c9c3016fd066f072e8d1a128c0e126..3436728d46e3189452772ac794bbb0e2d2d8a8d1 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java -@@ -2116,6 +2116,19 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -2124,6 +2124,19 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM */ @NotNull T getClientOption(@NotNull ClientOption option); diff --git a/patches/api/0257-Add-sendOpLevel-API.patch b/patches/api/0257-Add-sendOpLevel-API.patch index 64b20c1a2..5ce2fed4f 100644 --- a/patches/api/0257-Add-sendOpLevel-API.patch +++ b/patches/api/0257-Add-sendOpLevel-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add sendOpLevel API diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index e3d56cc4122de5237b89ed670493eecd3413b2b6..a6031b6ad451facd8ca6318bd06aa9850feb834c 100644 +index 3436728d46e3189452772ac794bbb0e2d2d8a8d1..dce258e323e79ce61c42be5d4eae3116f25f22b3 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java -@@ -2129,6 +2129,17 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -2137,6 +2137,17 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM */ @Nullable Firework boostElytra(@NotNull ItemStack firework); diff --git a/patches/server/0001-Setup-Gradle-project.patch b/patches/server/0001-Setup-Gradle-project.patch index 4753149a9..ab2ef7de4 100644 --- a/patches/server/0001-Setup-Gradle-project.patch +++ b/patches/server/0001-Setup-Gradle-project.patch @@ -182,7 +182,7 @@ index 0000000000000000000000000000000000000000..e2d2a87d68e611276f743064c6aaf822 +} diff --git a/pom.xml b/pom.xml deleted file mode 100644 -index ceaffe39fddbcc5f646f7fc5ddd471ba0ebb3bf3..0000000000000000000000000000000000000000 +index 64c25fbe8293fd0a963d48c5816ba80dfbb6d412..0000000000000000000000000000000000000000 --- a/pom.xml +++ /dev/null @@ -1,540 +0,0 @@ @@ -192,7 +192,7 @@ index ceaffe39fddbcc5f646f7fc5ddd471ba0ebb3bf3..00000000000000000000000000000000 - org.spigotmc - spigot - jar -- 1.18-pre8-R0.1-SNAPSHOT +- 1.18-rc3-R0.1-SNAPSHOT - Spigot - https://www.spigotmc.org/ - @@ -694,7 +694,7 @@ index ceaffe39fddbcc5f646f7fc5ddd471ba0ebb3bf3..00000000000000000000000000000000 - specialsource-maven-plugin - - -- package +- verify - - remap - @@ -707,7 +707,7 @@ index ceaffe39fddbcc5f646f7fc5ddd471ba0ebb3bf3..00000000000000000000000000000000 - - - -- package +- verify - - remap - diff --git a/patches/server/0005-MC-Dev-fixes.patch b/patches/server/0005-MC-Dev-fixes.patch index dd3c83506..7b8ae45ba 100644 --- a/patches/server/0005-MC-Dev-fixes.patch +++ b/patches/server/0005-MC-Dev-fixes.patch @@ -306,10 +306,10 @@ index 0f7950458dc2dfac51ed0d56f1790395f0b03bc2..fa4544541b9c5f163b633596e73a5197 @Nullable private Biome.Precipitation precipitation; 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 3f9929ac29f23068d233f164fbe6a562aba5a1b5..d030baca9dd3c34d14653094c139d853c67ac332 100644 +index e76a49b11e4617fee249d884f5ec2cbca0141def..71fbb476ad081424cc8807c01818f332887ae366 100644 --- a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java +++ b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java -@@ -275,10 +275,6 @@ public class PalettedContainer implements PaletteResize { +@@ -278,10 +278,6 @@ public class PalettedContainer implements PaletteResize { } static record Configuration(Palette.Factory factory, int bits) { @@ -320,7 +320,7 @@ index 3f9929ac29f23068d233f164fbe6a562aba5a1b5..d030baca9dd3c34d14653094c139d853 public PalettedContainer.Data createData(IdMap idList, PaletteResize listener, int size) { BitStorage bitStorage = (BitStorage)(this.bits == 0 ? new ZeroBitStorage(size) : new SimpleBitStorage(this.bits, size)); -@@ -293,9 +289,6 @@ public class PalettedContainer implements PaletteResize { +@@ -296,9 +292,6 @@ public class PalettedContainer implements PaletteResize { } static record Data(PalettedContainer.Configuration configuration, BitStorage storage, Palette palette) { @@ -330,7 +330,7 @@ index 3f9929ac29f23068d233f164fbe6a562aba5a1b5..d030baca9dd3c34d14653094c139d853 public void copyFrom(Palette palette, BitStorage storage) { for(int i = 0; i < storage.getSize(); ++i) { T object = palette.valueFor(storage.get(i)); -@@ -316,10 +309,6 @@ public class PalettedContainer implements PaletteResize { +@@ -319,10 +312,6 @@ public class PalettedContainer implements PaletteResize { } static record DiscData(List paletteEntries, Optional storage) { diff --git a/patches/server/0006-MC-Utils.patch b/patches/server/0006-MC-Utils.patch index 5929fe8d6..9861cb3a0 100644 --- a/patches/server/0006-MC-Utils.patch +++ b/patches/server/0006-MC-Utils.patch @@ -5067,7 +5067,7 @@ index 18f1bfed979e756a62ff8f5ee434d8270ab987d4..2361a92630d2639d602bc1434b061ad9 } catch (Throwable throwable) { // Spigot Start diff --git a/src/main/java/net/minecraft/server/level/ChunkHolder.java b/src/main/java/net/minecraft/server/level/ChunkHolder.java -index d2fbb6e28db27b3207879be3027bb74410a53900..faa0f1c72693977b65b3deb0f689756fbc83f568 100644 +index eebebd52353cd6b6fcb297151d7dcc03d2805505..b3ac5e2932f4b3de812b0c34655028d6adc36195 100644 --- a/src/main/java/net/minecraft/server/level/ChunkHolder.java +++ b/src/main/java/net/minecraft/server/level/ChunkHolder.java @@ -49,9 +49,9 @@ public class ChunkHolder { @@ -5183,7 +5183,7 @@ index d2fbb6e28db27b3207879be3027bb74410a53900..faa0f1c72693977b65b3deb0f689756f return this.chunkToSave; } -@@ -325,11 +358,11 @@ public class ChunkHolder { +@@ -335,11 +368,11 @@ public class ChunkHolder { return ChunkHolder.getFullChunkStatus(this.ticketLevel); } @@ -5197,7 +5197,7 @@ index d2fbb6e28db27b3207879be3027bb74410a53900..faa0f1c72693977b65b3deb0f689756f return this.ticketLevel; } -@@ -418,14 +451,27 @@ public class ChunkHolder { +@@ -428,14 +461,27 @@ public class ChunkHolder { this.wasAccessibleSinceLastSave |= flag3; if (!flag2 && flag3) { @@ -5225,7 +5225,7 @@ index d2fbb6e28db27b3207879be3027bb74410a53900..faa0f1c72693977b65b3deb0f689756f } boolean flag4 = playerchunk_state.isOrAfter(ChunkHolder.FullChunkStatus.TICKING); -@@ -434,12 +480,29 @@ public class ChunkHolder { +@@ -444,12 +490,29 @@ public class ChunkHolder { if (!flag4 && flag5) { this.tickingChunkFuture = chunkStorage.prepareTickingChunk(this); this.scheduleFullChunkPromotion(chunkStorage, this.tickingChunkFuture, executor, ChunkHolder.FullChunkStatus.TICKING); @@ -5256,7 +5256,7 @@ index d2fbb6e28db27b3207879be3027bb74410a53900..faa0f1c72693977b65b3deb0f689756f } boolean flag6 = playerchunk_state.isOrAfter(ChunkHolder.FullChunkStatus.ENTITY_TICKING); -@@ -452,12 +515,28 @@ public class ChunkHolder { +@@ -462,12 +525,28 @@ public class ChunkHolder { this.entityTickingChunkFuture = chunkStorage.prepareEntityTickingChunk(this.pos); this.scheduleFullChunkPromotion(chunkStorage, this.entityTickingChunkFuture, executor, ChunkHolder.FullChunkStatus.ENTITY_TICKING); @@ -5286,7 +5286,7 @@ index d2fbb6e28db27b3207879be3027bb74410a53900..faa0f1c72693977b65b3deb0f689756f } if (!playerchunk_state1.isOrAfter(playerchunk_state)) { -@@ -563,4 +642,18 @@ public class ChunkHolder { +@@ -573,4 +652,18 @@ public class ChunkHolder { } }; } @@ -5306,10 +5306,10 @@ index d2fbb6e28db27b3207879be3027bb74410a53900..faa0f1c72693977b65b3deb0f689756f + // Paper end } diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index f41f0e6aa12c89b7a8dd95a7c43510bae2d58525..3c43b9e510ec1df43a54cde475490c49e57ca1b8 100644 +index f0480cde59d81e6648b730092818dfa39d27202a..163c185f8ef72f5739b75f9768ebb4135dd3aaae 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -58,6 +58,7 @@ import net.minecraft.network.protocol.game.ClientboundSetChunkCacheCenterPacket; +@@ -59,6 +59,7 @@ import net.minecraft.network.protocol.game.ClientboundSetChunkCacheCenterPacket; import net.minecraft.network.protocol.game.ClientboundSetEntityLinkPacket; import net.minecraft.network.protocol.game.ClientboundSetPassengersPacket; import net.minecraft.network.protocol.game.DebugPackets; @@ -5317,7 +5317,7 @@ index f41f0e6aa12c89b7a8dd95a7c43510bae2d58525..3c43b9e510ec1df43a54cde475490c49 import net.minecraft.server.level.progress.ChunkProgressListener; import net.minecraft.server.network.ServerPlayerConnection; import net.minecraft.util.CsvOutput; -@@ -157,6 +158,56 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -158,6 +159,56 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider }; // CraftBukkit end @@ -5374,7 +5374,7 @@ index f41f0e6aa12c89b7a8dd95a7c43510bae2d58525..3c43b9e510ec1df43a54cde475490c49 public ChunkMap(ServerLevel world, LevelStorageSource.LevelStorageAccess session, DataFixer dataFixer, StructureManager structureManager, Executor executor, BlockableEventLoop mainThreadExecutor, LightChunkGetter chunkProvider, ChunkGenerator chunkGenerator, ChunkProgressListener worldGenerationProgressListener, ChunkStatusUpdateListener chunkStatusChangeListener, Supplier persistentStateManagerFactory, int viewDistance, boolean dsync) { super(session.getDimensionPath(world.dimension()).resolve("region"), dataFixer, dsync); this.visibleChunkMap = this.updatingChunkMap.clone(); -@@ -192,6 +243,10 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -193,6 +244,10 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider this.overworldDataStorage = persistentStateManagerFactory; this.poiManager = new PoiManager(path.resolve("poi"), dataFixer, dsync, world); this.setViewDistance(viewDistance); @@ -5385,7 +5385,7 @@ index f41f0e6aa12c89b7a8dd95a7c43510bae2d58525..3c43b9e510ec1df43a54cde475490c49 } protected ChunkGenerator generator() { -@@ -319,6 +374,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -320,6 +375,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } } @@ -5398,9 +5398,9 @@ index f41f0e6aa12c89b7a8dd95a7c43510bae2d58525..3c43b9e510ec1df43a54cde475490c49 + // Paper end + private CompletableFuture, ChunkHolder.ChunkLoadingFailure>> getChunkRangeFuture(ChunkPos centerChunk, int margin, IntFunction distanceToStatus) { - List>> list = Lists.newArrayList(); - int j = centerChunk.x; -@@ -409,6 +472,11 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider + List>> list = new ArrayList(); + List list1 = new ArrayList(); +@@ -420,6 +483,11 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider holder.setTicketLevel(level); } else { holder = new ChunkHolder(new ChunkPos(pos), level, this.level, this.lightEngine, this.queueSorter, this); @@ -5412,7 +5412,7 @@ index f41f0e6aa12c89b7a8dd95a7c43510bae2d58525..3c43b9e510ec1df43a54cde475490c49 } this.updatingChunkMap.put(pos, holder); -@@ -534,7 +602,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -545,7 +613,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider if (completablefuture1 != completablefuture) { this.scheduleUnload(pos, holder); } else { @@ -5427,7 +5427,7 @@ index f41f0e6aa12c89b7a8dd95a7c43510bae2d58525..3c43b9e510ec1df43a54cde475490c49 if (ichunkaccess instanceof LevelChunk) { ((LevelChunk) ichunkaccess).setLoaded(false); } -@@ -549,7 +623,11 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -560,7 +634,11 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider this.lightEngine.updateChunkStatus(ichunkaccess.getPos()); this.lightEngine.tryScheduleUpdate(); this.progressListener.onStatusChange(ichunkaccess.getPos(), (ChunkStatus) null); @@ -5440,7 +5440,7 @@ index f41f0e6aa12c89b7a8dd95a7c43510bae2d58525..3c43b9e510ec1df43a54cde475490c49 } }; -@@ -1089,6 +1167,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1094,6 +1172,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider if (!flag1) { this.distanceManager.addPlayer(SectionPos.of((Entity) player), player); } @@ -5448,7 +5448,7 @@ index f41f0e6aa12c89b7a8dd95a7c43510bae2d58525..3c43b9e510ec1df43a54cde475490c49 } else { SectionPos sectionposition = player.getLastSectionPos(); -@@ -1096,6 +1175,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1101,6 +1180,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider if (!flag2) { this.distanceManager.removePlayer(sectionposition, player); } @@ -5456,7 +5456,7 @@ index f41f0e6aa12c89b7a8dd95a7c43510bae2d58525..3c43b9e510ec1df43a54cde475490c49 } for (int k = i - this.viewDistance; k <= i + this.viewDistance; ++k) { -@@ -1212,6 +1292,8 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1217,6 +1297,8 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } } @@ -5465,7 +5465,7 @@ index f41f0e6aa12c89b7a8dd95a7c43510bae2d58525..3c43b9e510ec1df43a54cde475490c49 } @Override -@@ -1414,7 +1496,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1419,7 +1501,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider public class ChunkDistanceManager extends DistanceManager { protected ChunkDistanceManager(Executor workerExecutor, Executor mainThreadExecutor) { @@ -6104,7 +6104,7 @@ index cf596d49cf21f66245095753f38aebaaa680259b..0251908052d6221dc9fdab38ff8cfb3b private final AtomicInteger chatSpamTickCount = new AtomicInteger(); // CraftBukkit end diff --git a/src/main/java/net/minecraft/util/thread/BlockableEventLoop.java b/src/main/java/net/minecraft/util/thread/BlockableEventLoop.java -index 430919a5aa261951a6f79483655dbd6111b4824a..58692386e24723a1075ff4f4cc70f40ed957c52f 100644 +index a4c5edee297af6d68d518b77f706732b5ccbe4de..7bf4bf5cb2c1b54a7e2733091f48f3a824336d36 100644 --- a/src/main/java/net/minecraft/util/thread/BlockableEventLoop.java +++ b/src/main/java/net/minecraft/util/thread/BlockableEventLoop.java @@ -78,6 +78,13 @@ public abstract class BlockableEventLoop implements Profiler @@ -6985,7 +6985,7 @@ index 0000000000000000000000000000000000000000..909b2c98e7a9117d2f737245e4661792 + } +} diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index bd9cf03ae91e3cede79190c573ec32199637e5d5..11385b98a7197a3912b94ca12129e61aa0736571 100644 +index acd449c44170772b8ebed18b1c040c753ae78d91..7413580313063af81ca6ec5f1ac4ef252847cf33 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java @@ -88,8 +88,17 @@ public final class CraftMagicNumbers implements UnsafeValues { diff --git a/patches/server/0010-Timings-v2.patch b/patches/server/0010-Timings-v2.patch index 352b33945..0aec243d6 100644 --- a/patches/server/0010-Timings-v2.patch +++ b/patches/server/0010-Timings-v2.patch @@ -1041,7 +1041,7 @@ index 4dd57007af218ba1c0e666117a49939c5884f2c6..a6cb949b6f048455acc50c897fdd93d3 } diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index 85c177bdf9ab329b7ff30294fd8d45b6690d6b71..032bd9e952c0336f643dda514f265e78c491c8e2 100644 +index 163c185f8ef72f5739b75f9768ebb4135dd3aaae..76fbb1bf99f7374129c04a3f1517c2abf97ba232 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java @@ -1,8 +1,10 @@ @@ -1055,7 +1055,7 @@ index 85c177bdf9ab329b7ff30294fd8d45b6690d6b71..032bd9e952c0336f643dda514f265e78 import com.google.common.collect.Lists; import com.google.common.collect.Queues; import com.google.common.collect.Sets; -@@ -679,11 +681,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -690,11 +692,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider private CompletableFuture> scheduleChunkLoad(ChunkPos pos) { return CompletableFuture.supplyAsync(() -> { @@ -1073,7 +1073,7 @@ index 85c177bdf9ab329b7ff30294fd8d45b6690d6b71..032bd9e952c0336f643dda514f265e78 boolean flag = nbttagcompound.contains("Status", 8); if (flag) { -@@ -694,7 +699,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -705,7 +710,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } ChunkMap.LOGGER.error("Chunk file at {} is missing level data, skipping", pos); @@ -1082,7 +1082,7 @@ index 85c177bdf9ab329b7ff30294fd8d45b6690d6b71..032bd9e952c0336f643dda514f265e78 } catch (ReportedException reportedexception) { Throwable throwable = reportedexception.getCause(); -@@ -811,6 +816,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -822,6 +827,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider ChunkStatus chunkstatus = ChunkHolder.getStatus(chunkHolder.getTicketLevel()); return !chunkstatus.isOrAfter(ChunkStatus.FULL) ? ChunkHolder.UNLOADED_CHUNK : either.mapLeft((ichunkaccess) -> { @@ -1090,7 +1090,7 @@ index 85c177bdf9ab329b7ff30294fd8d45b6690d6b71..032bd9e952c0336f643dda514f265e78 ChunkPos chunkcoordintpair = chunkHolder.getPos(); ProtoChunk protochunk = (ProtoChunk) ichunkaccess; LevelChunk chunk; -@@ -835,6 +841,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -846,6 +852,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } return chunk; @@ -1098,7 +1098,7 @@ index 85c177bdf9ab329b7ff30294fd8d45b6690d6b71..032bd9e952c0336f643dda514f265e78 }); }, (runnable) -> { ProcessorHandle mailbox = this.mainThreadMailbox; -@@ -1377,6 +1384,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1382,6 +1389,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider List list = Lists.newArrayList(); List list1 = this.level.players(); ObjectIterator objectiterator = this.entityMap.values().iterator(); @@ -1106,7 +1106,7 @@ index 85c177bdf9ab329b7ff30294fd8d45b6690d6b71..032bd9e952c0336f643dda514f265e78 ChunkMap.TrackedEntity playerchunkmap_entitytracker; -@@ -1401,14 +1409,17 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1406,14 +1414,17 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider playerchunkmap_entitytracker.serverEntity.sendChanges(); } } @@ -1918,10 +1918,10 @@ index b0ffa23faf62629043dfd613315eaf9c5fcc2cfe..00000000000000000000000000000000 - } -} diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 8a0c4dccfc2be9e2213ffc094ed74d33e328241b..74617477ce710be19c5fd76e43c72e37f3750d33 100644 +index 9a2ddc3bbbe0d974945b76f11a73386362a621b3..2b4ed77d537dc31df20d45538aca4ef360e747ee 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1825,6 +1825,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1833,6 +1833,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player { packet.components = components; CraftPlayer.this.getHandle().connection.send(packet); } @@ -2114,7 +2114,7 @@ index e52ef47b783785dc214746b678e7b549aea9a274..3d90b3426873a3528af14f7f1ab0adae this.value = value; } diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 11385b98a7197a3912b94ca12129e61aa0736571..a527c2bc1314d05309be8f63f4696b373d3cee20 100644 +index 7413580313063af81ca6ec5f1ac4ef252847cf33..b44be4d7080f940d7416392885bb49253c91d2a8 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java @@ -173,6 +173,12 @@ public final class CraftMagicNumbers implements UnsafeValues { diff --git a/patches/server/0012-Adventure.patch b/patches/server/0012-Adventure.patch index 712b14e42..a53cbdd93 100644 --- a/patches/server/0012-Adventure.patch +++ b/patches/server/0012-Adventure.patch @@ -1005,7 +1005,7 @@ index 0000000000000000000000000000000000000000..2dc92d8d2764d3e9b621d5c7d5e30c30 + } +} diff --git a/src/main/java/net/minecraft/ChatFormatting.java b/src/main/java/net/minecraft/ChatFormatting.java -index b82b218be1bd849fa280ea1fe0336e279bebfc18..2fb444653118816f1250841cb4c6c486e67c642b 100644 +index 9143392884801e952a96cb5e7b761c7a827fa648..3a13544bc3b8f8dc6a38aacb6af99b25365dd6d1 100644 --- a/src/main/java/net/minecraft/ChatFormatting.java +++ b/src/main/java/net/minecraft/ChatFormatting.java @@ -110,6 +110,18 @@ public enum ChatFormatting { @@ -1113,7 +1113,7 @@ index 4d664338f3d5570fd0133ace6b297d70045b34a7..984105c226f16746b43bb2d2932e0b87 if (!ichatbasecomponent.getStyle().isEmpty()) { diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundChatPacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundChatPacket.java -index d63a712126973fd1bea547d30c7d116c622669ee..1f5050e6c1d932aa196ab9524f7f1f9bd1b45fce 100644 +index 743db7bfc58ff9e90a1b6d20d1bf64ecb6906327..f4f52e43852d2b0b56770c3f747a655a3a6dd683 100644 --- a/src/main/java/net/minecraft/network/protocol/game/ClientboundChatPacket.java +++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundChatPacket.java @@ -10,6 +10,7 @@ import net.minecraft.network.protocol.Packet; @@ -2363,10 +2363,10 @@ index 446fdca49a5a6999626a7ee3a1d5c168b15a09dd..f9863e138994f6c7a7975a852f106faa public boolean isOp() { return true; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 74617477ce710be19c5fd76e43c72e37f3750d33..b534eae34da93b2764ac577438c49559529560ca 100644 +index 2b4ed77d537dc31df20d45538aca4ef360e747ee..68a071ccfc16e3b840658b3bab01a0182d8cb271 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -250,14 +250,39 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -251,14 +251,39 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public String getDisplayName() { @@ -2406,7 +2406,7 @@ index 74617477ce710be19c5fd76e43c72e37f3750d33..b534eae34da93b2764ac577438c49559 @Override public String getPlayerListName() { return this.getHandle().listName == null ? getName() : CraftChatMessage.fromComponent(this.getHandle().listName); -@@ -276,42 +301,42 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -277,42 +302,42 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } } @@ -2458,7 +2458,7 @@ index 74617477ce710be19c5fd76e43c72e37f3750d33..b534eae34da93b2764ac577438c49559 this.getHandle().connection.send(packet); } -@@ -343,6 +368,17 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -344,6 +369,17 @@ public class CraftPlayer extends CraftHumanEntity implements Player { this.getHandle().connection.disconnect(message == null ? "" : message); } @@ -2476,7 +2476,7 @@ index 74617477ce710be19c5fd76e43c72e37f3750d33..b534eae34da93b2764ac577438c49559 @Override public void setCompassTarget(Location loc) { if (this.getHandle().connection == null) return; -@@ -585,6 +621,33 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -586,6 +622,33 @@ public class CraftPlayer extends CraftHumanEntity implements Player { this.getHandle().connection.send(packet); } @@ -2510,7 +2510,7 @@ index 74617477ce710be19c5fd76e43c72e37f3750d33..b534eae34da93b2764ac577438c49559 @Override public void sendSignChange(Location loc, String[] lines) { this.sendSignChange(loc, lines, DyeColor.BLACK); -@@ -612,14 +675,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -613,14 +676,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } Component[] components = CraftSign.sanitizeLines(lines); @@ -2528,7 +2528,7 @@ index 74617477ce710be19c5fd76e43c72e37f3750d33..b534eae34da93b2764ac577438c49559 } @Override -@@ -1700,6 +1764,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1701,6 +1765,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player { return (this.getHandle().clientViewDistance == null) ? Bukkit.getViewDistance() : this.getHandle().clientViewDistance; } @@ -2541,7 +2541,7 @@ index 74617477ce710be19c5fd76e43c72e37f3750d33..b534eae34da93b2764ac577438c49559 @Override public int getPing() { return this.getHandle().latency; -@@ -1733,6 +1803,194 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1741,6 +1811,194 @@ public class CraftPlayer extends CraftHumanEntity implements Player { return this.getHandle().allowsListing(); } @@ -3500,7 +3500,7 @@ index f9b7b8f7ccc95b73967a51420fd6ce88d80d75fe..0de5a46423ae0403dcbfca630dfd7c5a boolean hadFormat = false; diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 7024e0750a10ce4325b7217c76e03603ef53faa8..bbb29440264094ecb82ec1282bdf7aa9f1f2106a 100644 +index b44be4d7080f940d7416392885bb49253c91d2a8..62a02985080fb27cd8cfdc68fcf89f7df12fdc12 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java @@ -57,6 +57,33 @@ public final class CraftMagicNumbers implements UnsafeValues { diff --git a/patches/server/0023-Player-affects-spawning-API.patch b/patches/server/0023-Player-affects-spawning-API.patch index 31f32b3c8..87d21e39a 100644 --- a/patches/server/0023-Player-affects-spawning-API.patch +++ b/patches/server/0023-Player-affects-spawning-API.patch @@ -61,7 +61,7 @@ index d149ecefb0ee379f3fa7e64e4d70bdd23adbd49b..5d37c82bd5cd20aa2d452f0214f33037 // CraftBukkit start public boolean fauxSleeping; diff --git a/src/main/java/net/minecraft/world/level/BaseSpawner.java b/src/main/java/net/minecraft/world/level/BaseSpawner.java -index 62dc233b6d53c28b8c64a372f60f87e258a7c2a6..08d9980a5b9b26f7dbdfcb6cda7a3995d58bea81 100644 +index a30780611b6842e35579f0ca11d75161bf365c70..4be2833b03d24e5d87c23f04c248fbe4b0ca9e59 100644 --- a/src/main/java/net/minecraft/world/level/BaseSpawner.java +++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java @@ -51,7 +51,7 @@ public abstract class BaseSpawner { @@ -117,10 +117,10 @@ index c65d1dc6eb0c1fc7c4a91faf0f1c6f26b3c2a76e..0dc46471f7247e5d36c3896a0c874730 for(Player player : this.players()) { if (EntitySelector.NO_SPECTATORS.test(player) && EntitySelector.LIVING_ENTITY_STILL_ALIVE.test(player)) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index b534eae34da93b2764ac577438c49559529560ca..6b945d22a84b77f835500ea8215748de24d5a00d 100644 +index 68a071ccfc16e3b840658b3bab01a0182d8cb271..4aa8ec18b0eeae23f9913878111af538e29d4f5b 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1778,8 +1778,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1779,8 +1779,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public String getLocale() { return this.getHandle().locale; diff --git a/patches/server/0026-Only-refresh-abilities-if-needed.patch b/patches/server/0026-Only-refresh-abilities-if-needed.patch index 6a79a5e0e..ee1200e9a 100644 --- a/patches/server/0026-Only-refresh-abilities-if-needed.patch +++ b/patches/server/0026-Only-refresh-abilities-if-needed.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Only refresh abilities if needed diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 6b945d22a84b77f835500ea8215748de24d5a00d..22c317d3762b9e2d8f70bd413555507c68b0cae4 100644 +index 4aa8ec18b0eeae23f9913878111af538e29d4f5b..a41590739e22feb4aebfd7192ebd1f77868dc07c 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1447,12 +1447,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1448,12 +1448,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public void setFlying(boolean value) { diff --git a/patches/server/0039-Implement-PlayerLocaleChangeEvent.patch b/patches/server/0039-Implement-PlayerLocaleChangeEvent.patch index 87815a6d3..2028cad1b 100644 --- a/patches/server/0039-Implement-PlayerLocaleChangeEvent.patch +++ b/patches/server/0039-Implement-PlayerLocaleChangeEvent.patch @@ -30,10 +30,10 @@ index 88b6be62678fc09b5a39db28c6d71cc31b16dbcd..352bfe795aea26307de9c998d67a43af this.locale = packet.language; // Paper start diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 22c317d3762b9e2d8f70bd413555507c68b0cae4..60807ed83e4240cdf1e05654d24c55313aba813f 100644 +index a41590739e22feb4aebfd7192ebd1f77868dc07c..2766b773ed255e3172ed52a3fb37d18f6f46999b 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1778,8 +1778,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1779,8 +1779,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public String getLocale() { diff --git a/patches/server/0040-Per-Player-View-Distance-API-placeholders.patch b/patches/server/0040-Per-Player-View-Distance-API-placeholders.patch index 56fdb7774..e348d47ef 100644 --- a/patches/server/0040-Per-Player-View-Distance-API-placeholders.patch +++ b/patches/server/0040-Per-Player-View-Distance-API-placeholders.patch @@ -56,10 +56,10 @@ index 277b946bec2cfd8cfb4054504133f6ab9059ba8c..a465ef627169e62132287cded07efb5b // Spigot start diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 60807ed83e4240cdf1e05654d24c55313aba813f..4fc2310287c2f0d366ac9ad23607125541a3c8bb 100644 +index 2766b773ed255e3172ed52a3fb37d18f6f46999b..5168f3a99c669a2c86894eb244801845aa6da077 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -377,6 +377,36 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -378,6 +378,36 @@ public class CraftPlayer extends CraftHumanEntity implements Player { connection.disconnect(message == null ? net.kyori.adventure.text.Component.empty() : message); } } diff --git a/patches/server/0052-Player-Tab-List-and-Title-APIs.patch b/patches/server/0052-Player-Tab-List-and-Title-APIs.patch index d1f1c2112..8842c5aa0 100644 --- a/patches/server/0052-Player-Tab-List-and-Title-APIs.patch +++ b/patches/server/0052-Player-Tab-List-and-Title-APIs.patch @@ -63,7 +63,7 @@ index bd808eb312ade7122973a47f4b96505829511da5..bf0f9cab7c66c089f35b851e799ba4a4 // Paper end buf.writeComponent(this.text); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 4fc2310287c2f0d366ac9ad23607125541a3c8bb..b7dae85766f3077f92ab014562cf0143bff7c9d3 100644 +index 5168f3a99c669a2c86894eb244801845aa6da077..ece96166731da291536a2859273b1fa55944e0e5 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -1,5 +1,6 @@ @@ -73,7 +73,7 @@ index 4fc2310287c2f0d366ac9ad23607125541a3c8bb..b7dae85766f3077f92ab014562cf0143 import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableSet; import com.google.common.io.BaseEncoding; -@@ -248,6 +249,100 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -249,6 +250,100 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } } diff --git a/patches/server/0055-Configurable-inter-world-teleportation-safety.patch b/patches/server/0055-Configurable-inter-world-teleportation-safety.patch index e3d352e23..1ab9cf00b 100644 --- a/patches/server/0055-Configurable-inter-world-teleportation-safety.patch +++ b/patches/server/0055-Configurable-inter-world-teleportation-safety.patch @@ -30,10 +30,10 @@ index c248b66486044150c64eaddbef85fa6644494212..ada624b5f58381122e59568c2087cf38 + } } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index b7dae85766f3077f92ab014562cf0143bff7c9d3..3c7ae0966f2e8d0ab0924047653792ac7ac75f10 100644 +index ece96166731da291536a2859273b1fa55944e0e5..fe6ce60db2afee9a078e45ebb76c15ddeca8b9b4 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -905,7 +905,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -906,7 +906,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { if (fromWorld == toWorld) { entity.connection.teleport(to); } else { diff --git a/patches/server/0056-Add-exception-reporting-event.patch b/patches/server/0056-Add-exception-reporting-event.patch index f37d1d7fb..ac130b204 100644 --- a/patches/server/0056-Add-exception-reporting-event.patch +++ b/patches/server/0056-Add-exception-reporting-event.patch @@ -49,10 +49,10 @@ index 0000000000000000000000000000000000000000..f699ce18ca044f813e194ef2786b7ea8 + } +} diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index 032bd9e952c0336f643dda514f265e78c491c8e2..713be7a4bee692d346a1f94cd891030be53260a5 100644 +index 76fbb1bf99f7374129c04a3f1517c2abf97ba232..e302204e49bbab7a90090d99890b3072dbd4e7d1 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -952,6 +952,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -957,6 +957,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider return true; } catch (Exception exception) { ChunkMap.LOGGER.error("Failed to save chunk {},{}", chunkcoordintpair.x, chunkcoordintpair.z, exception); diff --git a/patches/server/0061-Complete-resource-pack-API.patch b/patches/server/0061-Complete-resource-pack-API.patch index a9272509c..45ceb4c3b 100644 --- a/patches/server/0061-Complete-resource-pack-API.patch +++ b/patches/server/0061-Complete-resource-pack-API.patch @@ -23,10 +23,10 @@ index 38909ef14fcfd4b93d83512f4cacbe2c3fe431a1..76e34fb4bb6b3d194e155bec30d36887 @Override diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 3c7ae0966f2e8d0ab0924047653792ac7ac75f10..97a21ecae2b2b17c9041cd7e5148c68472929d6a 100644 +index fe6ce60db2afee9a078e45ebb76c15ddeca8b9b4..7fa9227d2336eb0987d3b5a19edf35345decbcf9 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -132,6 +132,7 @@ import org.bukkit.metadata.MetadataValue; +@@ -133,6 +133,7 @@ import org.bukkit.metadata.MetadataValue; import org.bukkit.plugin.Plugin; import org.bukkit.plugin.messaging.StandardMessenger; import org.bukkit.scoreboard.Scoreboard; @@ -34,7 +34,7 @@ index 3c7ae0966f2e8d0ab0924047653792ac7ac75f10..97a21ecae2b2b17c9041cd7e5148c684 import net.md_5.bungee.api.chat.BaseComponent; // Spigot -@@ -148,6 +149,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -149,6 +150,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player { private double health = 20; private boolean scaledHealth = false; private double healthScale = 20; @@ -45,7 +45,7 @@ index 3c7ae0966f2e8d0ab0924047653792ac7ac75f10..97a21ecae2b2b17c9041cd7e5148c684 public CraftPlayer(CraftServer server, ServerPlayer entity) { super(server, entity); -@@ -1918,6 +1923,45 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1919,6 +1924,45 @@ public class CraftPlayer extends CraftHumanEntity implements Player { public boolean getAffectsSpawning() { return this.getHandle().affectsSpawning; } diff --git a/patches/server/0069-handle-NaN-health-absorb-values-and-repair-bad-data.patch b/patches/server/0069-handle-NaN-health-absorb-values-and-repair-bad-data.patch index 59ac6ec42..77773d7b3 100644 --- a/patches/server/0069-handle-NaN-health-absorb-values-and-repair-bad-data.patch +++ b/patches/server/0069-handle-NaN-health-absorb-values-and-repair-bad-data.patch @@ -5,7 +5,7 @@ Subject: [PATCH] handle NaN health/absorb values and repair bad data diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index c8e60153986e9be21a1e372d5c1cb25c762ab81b..e5a0f6edbb1d43f8c918b9cee9a291db630663b4 100644 +index 76da306041b61f6c93e6f58f580054af7dfc234e..2277b06e3e13a1abb469064d5b23495a464fd7c0 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java @@ -759,7 +759,13 @@ public abstract class LivingEntity extends Entity { @@ -44,10 +44,10 @@ index c8e60153986e9be21a1e372d5c1cb25c762ab81b..e5a0f6edbb1d43f8c918b9cee9a291db } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 97a21ecae2b2b17c9041cd7e5148c68472929d6a..e41df687f7d681574bc16f5d3b1572a3ea9902f0 100644 +index 7fa9227d2336eb0987d3b5a19edf35345decbcf9..a7047fa93b0fe08fb62f9b0984bcd3af9217c95f 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1723,6 +1723,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1724,6 +1724,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } public void setRealHealth(double health) { diff --git a/patches/server/0084-Workaround-for-setting-passengers-on-players.patch b/patches/server/0084-Workaround-for-setting-passengers-on-players.patch index a0d1c7fd5..995bc1964 100644 --- a/patches/server/0084-Workaround-for-setting-passengers-on-players.patch +++ b/patches/server/0084-Workaround-for-setting-passengers-on-players.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Workaround for setting passengers on players SPIGOT-1915 & GH-114 diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index e41df687f7d681574bc16f5d3b1572a3ea9902f0..a880c6434f6dbbc8ce9f82315ba906090c7240a1 100644 +index a7047fa93b0fe08fb62f9b0984bcd3af9217c95f..5338f255f4f664b4c1b1530ba5fd55e0e24fd5b8 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -915,6 +915,17 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -916,6 +916,17 @@ public class CraftPlayer extends CraftHumanEntity implements Player { return true; } diff --git a/patches/server/0122-String-based-Action-Bar-API.patch b/patches/server/0122-String-based-Action-Bar-API.patch index 48f4b589c..df5e0e06b 100644 --- a/patches/server/0122-String-based-Action-Bar-API.patch +++ b/patches/server/0122-String-based-Action-Bar-API.patch @@ -26,10 +26,10 @@ index 32ef3edebe94a2014168b7e438752a80b2687e5f..ab6c58eed6707ab7b0aa3e7549a871ad // Paper end buf.writeComponent(this.text); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index a880c6434f6dbbc8ce9f82315ba906090c7240a1..d475f9a3eb3b4e3c0ed78bef1d233dde26c391b9 100644 +index 5338f255f4f664b4c1b1530ba5fd55e0e24fd5b8..bb6ddb9cd958835ef59b8d6681fa3b9f7089b3e3 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -255,6 +255,26 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -256,6 +256,26 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } // Paper start diff --git a/patches/server/0160-Expose-client-protocol-version-and-virtual-host.patch b/patches/server/0160-Expose-client-protocol-version-and-virtual-host.patch index f096cd920..3b5d6be9f 100644 --- a/patches/server/0160-Expose-client-protocol-version-and-virtual-host.patch +++ b/patches/server/0160-Expose-client-protocol-version-and-virtual-host.patch @@ -90,10 +90,10 @@ index c4ba069f5124ec151e05813beddf293fddc3b804..484221e5a9c246aa91e0eacef3911b0e @Override diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index d475f9a3eb3b4e3c0ed78bef1d233dde26c391b9..5afc4c55c9ec8ed70b36a805b553613e18747c1f 100644 +index bb6ddb9cd958835ef59b8d6681fa3b9f7089b3e3..bd17c008f307e27e493f6a1adda3e9ad89b2e73d 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -199,6 +199,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -200,6 +200,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } } diff --git a/patches/server/0170-Ability-to-apply-mending-to-XP-API.patch b/patches/server/0170-Ability-to-apply-mending-to-XP-API.patch index b222cff38..80ff2837a 100644 --- a/patches/server/0170-Ability-to-apply-mending-to-XP-API.patch +++ b/patches/server/0170-Ability-to-apply-mending-to-XP-API.patch @@ -28,10 +28,10 @@ index 3a09ce6d0ea51436adcae4719d3f28d1868c283c..7bc5aa35b52de0027cf58a6127a99034 return true; }); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 5afc4c55c9ec8ed70b36a805b553613e18747c1f..d6f9fe4ebc034263169f3333922ad90fe4fcee69 100644 +index bd17c008f307e27e493f6a1adda3e9ad89b2e73d..f9964ef85a7162a5aed81041accf3ae1528c5144 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1223,8 +1223,37 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1224,8 +1224,37 @@ public class CraftPlayer extends CraftHumanEntity implements Player { return GameMode.getByValue(this.getHandle().gameMode.getGameModeForPlayer().getId()); } diff --git a/patches/server/0171-PlayerNaturallySpawnCreaturesEvent.patch b/patches/server/0171-PlayerNaturallySpawnCreaturesEvent.patch index 31244178e..36d2e6d9f 100644 --- a/patches/server/0171-PlayerNaturallySpawnCreaturesEvent.patch +++ b/patches/server/0171-PlayerNaturallySpawnCreaturesEvent.patch @@ -9,10 +9,10 @@ from triggering monster spawns on a server. Also a highly more effecient way to blanket block spawns in a world diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index 713be7a4bee692d346a1f94cd891030be53260a5..398f90cacfcf93f6abd395758f0188d785fd764d 100644 +index e302204e49bbab7a90090d99890b3072dbd4e7d1..bf953c59d26c09c901bf7158e4066e4ccb50fd4e 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -1105,7 +1105,9 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1110,7 +1110,9 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider chunkRange = (chunkRange > level.spigotConfig.viewDistance) ? (byte) level.spigotConfig.viewDistance : chunkRange; chunkRange = (chunkRange > 8) ? 8 : chunkRange; @@ -23,7 +23,7 @@ index 713be7a4bee692d346a1f94cd891030be53260a5..398f90cacfcf93f6abd395758f0188d7 // Spigot end long i = chunkcoordintpair.toLong(); -@@ -1122,6 +1124,15 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1127,6 +1129,15 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } entityplayer = (ServerPlayer) iterator.next(); diff --git a/patches/server/0183-Player.setPlayerProfile-API.patch b/patches/server/0183-Player.setPlayerProfile-API.patch index 488eb50b2..54aa815cd 100644 --- a/patches/server/0183-Player.setPlayerProfile-API.patch +++ b/patches/server/0183-Player.setPlayerProfile-API.patch @@ -39,10 +39,10 @@ index a182c78c3718a6b8f56578c5e6b35ce5742046fe..85b50297d92c45872942effb770d0e85 private ItemStack lastItemInMainHand; private final ItemCooldowns cooldowns; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index d6f9fe4ebc034263169f3333922ad90fe4fcee69..a9bd48e4670aa44a964891c25cd147c006081b60 100644 +index f9964ef85a7162a5aed81041accf3ae1528c5144..b91ac44543d8bf52551b822f57c4992e951b81bd 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -70,6 +70,7 @@ import net.minecraft.world.entity.ai.attributes.Attributes; +@@ -71,6 +71,7 @@ import net.minecraft.world.entity.ai.attributes.Attributes; import net.minecraft.world.inventory.AbstractContainerMenu; import net.minecraft.world.level.GameType; import net.minecraft.world.level.block.Blocks; @@ -50,7 +50,7 @@ index d6f9fe4ebc034263169f3333922ad90fe4fcee69..a9bd48e4670aa44a964891c25cd147c0 import net.minecraft.world.level.block.entity.SignBlockEntity; import net.minecraft.world.level.saveddata.maps.MapDecoration; import net.minecraft.world.level.saveddata.maps.MapItemSavedData; -@@ -1351,8 +1352,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1352,8 +1353,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { this.hiddenPlayers.put(player.getUniqueId(), hidingPlugins); // Remove this player from the hidden player's EntityTrackerEntry @@ -65,7 +65,7 @@ index d6f9fe4ebc034263169f3333922ad90fe4fcee69..a9bd48e4670aa44a964891c25cd147c0 ChunkMap.TrackedEntity entry = tracker.entityMap.get(other.getId()); if (entry != null) { entry.removePlayer(this.getHandle()); -@@ -1393,8 +1399,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1394,8 +1400,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } this.hiddenPlayers.remove(player.getUniqueId()); @@ -80,7 +80,7 @@ index d6f9fe4ebc034263169f3333922ad90fe4fcee69..a9bd48e4670aa44a964891c25cd147c0 this.getHandle().connection.send(new ClientboundPlayerInfoPacket(ClientboundPlayerInfoPacket.Action.ADD_PLAYER, other)); -@@ -1403,6 +1414,50 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1404,6 +1415,50 @@ public class CraftPlayer extends CraftHumanEntity implements Player { entry.updatePlayer(this.getHandle()); } } diff --git a/patches/server/0189-Flag-to-disable-the-channel-limit.patch b/patches/server/0189-Flag-to-disable-the-channel-limit.patch index 56256e9e2..513a1c6ca 100644 --- a/patches/server/0189-Flag-to-disable-the-channel-limit.patch +++ b/patches/server/0189-Flag-to-disable-the-channel-limit.patch @@ -9,10 +9,10 @@ e.g. servers which allow and support the usage of mod packs. provide an optional flag to disable this check, at your own risk. diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index a9bd48e4670aa44a964891c25cd147c006081b60..5d4499a79fe6bd6a2c9f6896a40491ecadfd4f6c 100644 +index b91ac44543d8bf52551b822f57c4992e951b81bd..89c689b253d082bfb45021739b2a8e3da8f461ea 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -153,6 +153,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -154,6 +154,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { // Paper start private org.bukkit.event.player.PlayerResourcePackStatusEvent.Status resourcePackStatus; private String resourcePackHash; @@ -20,7 +20,7 @@ index a9bd48e4670aa44a964891c25cd147c006081b60..5d4499a79fe6bd6a2c9f6896a40491ec // Paper end public CraftPlayer(CraftServer server, ServerPlayer entity) { -@@ -1620,7 +1621,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1621,7 +1622,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } public void addChannel(String channel) { diff --git a/patches/server/0218-InventoryCloseEvent-Reason-API.patch b/patches/server/0218-InventoryCloseEvent-Reason-API.patch index e5e51d8a0..7df116301 100644 --- a/patches/server/0218-InventoryCloseEvent-Reason-API.patch +++ b/patches/server/0218-InventoryCloseEvent-Reason-API.patch @@ -174,10 +174,10 @@ index 87bc05f2eef1555ad3346d1d1bda72d4feb0fa1b..76a08aaf5106a5e8d0a24e9d96681757 @Override public boolean isBlocking() { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 5d4499a79fe6bd6a2c9f6896a40491ecadfd4f6c..b415f0760bd1027dcc9cd987d06421cbc50fbfaa 100644 +index 89c689b253d082bfb45021739b2a8e3da8f461ea..ca123645456bdff52bbd02db333439472d9deaf5 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -939,7 +939,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -940,7 +940,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { // Close any foreign inventory if (this.getHandle().containerMenu != this.getHandle().inventoryMenu) { diff --git a/patches/server/0241-Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch b/patches/server/0241-Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch index ca34fcf32..c759f6e45 100644 --- a/patches/server/0241-Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch +++ b/patches/server/0241-Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch @@ -8,10 +8,10 @@ Add -Ddebug.entities=true to your JVM flags to gain more information 1.17: Needs to be reworked for new entity storage system diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index 398f90cacfcf93f6abd395758f0188d785fd764d..e24f441cd1465389f02192796ab0b6605157cf15 100644 +index bf953c59d26c09c901bf7158e4066e4ccb50fd4e..09980ee3daa2cdfbb98da3eb44d1eec670888144 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -1347,6 +1347,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1352,6 +1352,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } else { ChunkMap.TrackedEntity playerchunkmap_entitytracker = new ChunkMap.TrackedEntity(entity, i, j, entitytypes.trackDeltas()); @@ -19,7 +19,7 @@ index 398f90cacfcf93f6abd395758f0188d785fd764d..e24f441cd1465389f02192796ab0b660 this.entityMap.put(entity.getId(), playerchunkmap_entitytracker); playerchunkmap_entitytracker.updatePlayers(this.level.players()); if (entity instanceof ServerPlayer) { -@@ -1389,7 +1390,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1394,7 +1395,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider if (playerchunkmap_entitytracker1 != null) { playerchunkmap_entitytracker1.broadcastRemoved(); } diff --git a/patches/server/0257-Asynchronous-chunk-IO-and-loading.patch b/patches/server/0257-Asynchronous-chunk-IO-and-loading.patch index 7c982414b..73dee35e5 100644 --- a/patches/server/0257-Asynchronous-chunk-IO-and-loading.patch +++ b/patches/server/0257-Asynchronous-chunk-IO-and-loading.patch @@ -2304,10 +2304,10 @@ index 746d8eb657808bfaa92654c36093abd9b67a0288..3380aca80bdda5edf8809f6fe36eaf5b public String getLocalIp() { diff --git a/src/main/java/net/minecraft/server/level/ChunkHolder.java b/src/main/java/net/minecraft/server/level/ChunkHolder.java -index 303125c4d0f8f235703975eab5eccb9aa045ccf8..5b999da8c5ad430f9157276857165596d1208f64 100644 +index b3ac5e2932f4b3de812b0c34655028d6adc36195..e01804a46ea268c7cd7bb01ec55b473d65dcb59e 100644 --- a/src/main/java/net/minecraft/server/level/ChunkHolder.java +++ b/src/main/java/net/minecraft/server/level/ChunkHolder.java -@@ -402,7 +402,7 @@ public class ChunkHolder { +@@ -412,7 +412,7 @@ public class ChunkHolder { ChunkStatus chunkstatus = ChunkHolder.getStatus(this.oldTicketLevel); ChunkStatus chunkstatus1 = ChunkHolder.getStatus(this.ticketLevel); boolean flag = this.oldTicketLevel <= ChunkMap.MAX_CHUNK_DISTANCE; @@ -2317,10 +2317,10 @@ index 303125c4d0f8f235703975eab5eccb9aa045ccf8..5b999da8c5ad430f9157276857165596 ChunkHolder.FullChunkStatus playerchunk_state1 = ChunkHolder.getFullChunkStatus(this.ticketLevel); // CraftBukkit start diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index e24f441cd1465389f02192796ab0b6605157cf15..347cb9f7d403047b99c913a96292147ebbaaff2b 100644 +index 09980ee3daa2cdfbb98da3eb44d1eec670888144..415425364f739a8a1c7ec1f33df5bf2baba6558d 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -493,6 +493,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -504,6 +504,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider public void close() throws IOException { try { this.queueSorter.close(); @@ -2328,7 +2328,7 @@ index e24f441cd1465389f02192796ab0b6605157cf15..347cb9f7d403047b99c913a96292147e this.poiManager.close(); } finally { super.close(); -@@ -529,7 +530,8 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -540,7 +541,8 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider this.processUnloads(() -> { return true; }); @@ -2338,7 +2338,7 @@ index e24f441cd1465389f02192796ab0b6605157cf15..347cb9f7d403047b99c913a96292147e } else { this.visibleChunkMap.values().forEach(this::saveChunkIfNeeded); } -@@ -539,17 +541,21 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -550,17 +552,21 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider protected void tick(BooleanSupplier shouldKeepTicking) { ProfilerFiller gameprofilerfiller = this.level.getProfiler(); @@ -2361,7 +2361,7 @@ index e24f441cd1465389f02192796ab0b6605157cf15..347cb9f7d403047b99c913a96292147e private void processUnloads(BooleanSupplier shouldKeepTicking) { LongIterator longiterator = this.toDrop.iterator(); -@@ -566,12 +572,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -577,12 +583,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider if (playerchunk != null) { this.pendingUnloads.put(j, playerchunk); this.modified = true; @@ -2376,7 +2376,7 @@ index e24f441cd1465389f02192796ab0b6605157cf15..347cb9f7d403047b99c913a96292147e } } activityAccountant.endActivity(); // Spigot -@@ -615,7 +622,16 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -626,7 +633,16 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider ((LevelChunk) ichunkaccess).setLoaded(false); } @@ -2394,7 +2394,7 @@ index e24f441cd1465389f02192796ab0b6605157cf15..347cb9f7d403047b99c913a96292147e if (this.entitiesInLevel.remove(pos) && ichunkaccess instanceof LevelChunk) { LevelChunk chunk = (LevelChunk) ichunkaccess; -@@ -680,20 +696,21 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -691,20 +707,21 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } private CompletableFuture> scheduleChunkLoad(ChunkPos pos) { @@ -2427,7 +2427,7 @@ index e24f441cd1465389f02192796ab0b6605157cf15..347cb9f7d403047b99c913a96292147e this.markPosition(pos, protochunk.getStatus().getChunkType()); return Either.left(protochunk); } -@@ -715,7 +732,32 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -726,7 +743,32 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider this.markPositionReplaceable(pos); return Either.left(new ProtoChunk(pos, UpgradeData.EMPTY, this.level, this.level.registryAccess().registryOrThrow(Registry.BIOME_REGISTRY), (BlendingData) null)); @@ -2461,7 +2461,7 @@ index e24f441cd1465389f02192796ab0b6605157cf15..347cb9f7d403047b99c913a96292147e } private void markPositionReplaceable(ChunkPos pos) { -@@ -923,7 +965,48 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -928,7 +970,48 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } } @@ -2510,7 +2510,7 @@ index e24f441cd1465389f02192796ab0b6605157cf15..347cb9f7d403047b99c913a96292147e this.poiManager.flush(chunk.getPos()); if (!chunk.isUnsaved()) { return false; -@@ -935,7 +1018,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -940,7 +1023,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider ChunkStatus chunkstatus = chunk.getStatus(); if (chunkstatus.getChunkType() != ChunkStatus.ChunkType.LEVELCHUNK) { @@ -2519,7 +2519,7 @@ index e24f441cd1465389f02192796ab0b6605157cf15..347cb9f7d403047b99c913a96292147e return false; } -@@ -945,9 +1028,15 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -950,9 +1033,15 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } this.level.getProfiler().incrementCounter("chunkSave"); @@ -2537,7 +2537,7 @@ index e24f441cd1465389f02192796ab0b6605157cf15..347cb9f7d403047b99c913a96292147e this.markPosition(chunkcoordintpair, chunkstatus.getChunkType()); return true; } catch (Exception exception) { -@@ -956,6 +1045,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -961,6 +1050,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider return false; } } @@ -2545,7 +2545,7 @@ index e24f441cd1465389f02192796ab0b6605157cf15..347cb9f7d403047b99c913a96292147e } private boolean isExistingChunkFull(ChunkPos pos) { -@@ -1088,6 +1178,35 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1093,6 +1183,35 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } } diff --git a/patches/server/0259-Expose-attack-cooldown-methods-for-Player.patch b/patches/server/0259-Expose-attack-cooldown-methods-for-Player.patch index cc8ccf368..47aed1f9b 100644 --- a/patches/server/0259-Expose-attack-cooldown-methods-for-Player.patch +++ b/patches/server/0259-Expose-attack-cooldown-methods-for-Player.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Expose attack cooldown methods for Player diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index b415f0760bd1027dcc9cd987d06421cbc50fbfaa..91f43ce3ef083825b567079990ce6511d4ec1f4b 100644 +index ca123645456bdff52bbd02db333439472d9deaf5..c3847325dd0c0490496f7e0fb729972d42c1c754 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2305,6 +2305,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2313,6 +2313,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player { return this.adventure$pointers; } diff --git a/patches/server/0260-Improve-death-events.patch b/patches/server/0260-Improve-death-events.patch index 9eecfaf24..7f9412464 100644 --- a/patches/server/0260-Improve-death-events.patch +++ b/patches/server/0260-Improve-death-events.patch @@ -70,7 +70,7 @@ index fd1937f49312204d38510996a5be43b731f38bde..a2e2b6ea166bf64fe5b49672a6c6f86a } } diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index e19bfd60c9905b003ff541b6f2c3371116fe3e5b..d61375bdd0cff7dfd74dd5dc1e6803e6320aa82a 100644 +index cf4640f1e38f3e50b3a85692e032a78b4102d31e..4fbc60ef1e6769bd54b2976935b222f7224cb5c2 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java @@ -258,6 +258,7 @@ public abstract class LivingEntity extends Entity { @@ -269,10 +269,10 @@ index 91cf7728aee475cb36f2c02bbfb7e3d2e0d00576..a3a900d10440ed5ebe24370a77ccb6ca } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 91f43ce3ef083825b567079990ce6511d4ec1f4b..c5a29d7ca512eddfd01fe1f89f9c1b82bbfd6535 100644 +index c3847325dd0c0490496f7e0fb729972d42c1c754..931d41ac0e0b0ef93fa8f836964aff56bd06a593 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1880,7 +1880,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1881,7 +1881,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } public void sendHealthUpdate() { diff --git a/patches/server/0299-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch b/patches/server/0299-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch index f6a51e803..fdb568c3d 100644 --- a/patches/server/0299-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch +++ b/patches/server/0299-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch @@ -106,10 +106,10 @@ index c7e4c6d29378675b76ebb179022ddbb02831a1dc..88bc0807e8bf66a65422f85f11123363 public Location getBedSpawnLocation() { CompoundTag data = this.getData(); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index c5a29d7ca512eddfd01fe1f89f9c1b82bbfd6535..b1e6edae0de15e2b03c5e9a1344886e790f079e3 100644 +index 931d41ac0e0b0ef93fa8f836964aff56bd06a593..377bbfd611ff1ddd3c8c2a4fc3e2d6b3b24f93b8 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -154,6 +154,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -155,6 +155,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { private org.bukkit.event.player.PlayerResourcePackStatusEvent.Status resourcePackStatus; private String resourcePackHash; private static final boolean DISABLE_CHANNEL_LIMIT = System.getProperty("paper.disableChannelLimit") != null; // Paper - add a flag to disable the channel limit @@ -117,7 +117,7 @@ index c5a29d7ca512eddfd01fe1f89f9c1b82bbfd6535..b1e6edae0de15e2b03c5e9a1344886e7 // Paper end public CraftPlayer(CraftServer server, ServerPlayer entity) { -@@ -1524,6 +1525,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1525,6 +1526,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player { this.firstPlayed = firstPlayed; } @@ -136,7 +136,7 @@ index c5a29d7ca512eddfd01fe1f89f9c1b82bbfd6535..b1e6edae0de15e2b03c5e9a1344886e7 public void readExtraData(CompoundTag nbttagcompound) { this.hasPlayedBefore = true; if (nbttagcompound.contains("bukkit")) { -@@ -1546,6 +1559,8 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1547,6 +1560,8 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } public void setExtraData(CompoundTag nbttagcompound) { @@ -145,7 +145,7 @@ index c5a29d7ca512eddfd01fe1f89f9c1b82bbfd6535..b1e6edae0de15e2b03c5e9a1344886e7 if (!nbttagcompound.contains("bukkit")) { nbttagcompound.put("bukkit", new CompoundTag()); } -@@ -1560,6 +1575,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1561,6 +1576,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player { data.putLong("firstPlayed", this.getFirstPlayed()); data.putLong("lastPlayed", System.currentTimeMillis()); data.putString("lastKnownName", handle.getScoreboardName()); diff --git a/patches/server/0302-Block-Entity-remove-from-being-called-on-Players.patch b/patches/server/0302-Block-Entity-remove-from-being-called-on-Players.patch index c74d25e79..4d4559db3 100644 --- a/patches/server/0302-Block-Entity-remove-from-being-called-on-Players.patch +++ b/patches/server/0302-Block-Entity-remove-from-being-called-on-Players.patch @@ -12,10 +12,10 @@ Player we will look at limiting the scope of this change. It appears to be unintentional in the few cases we've seen so far. diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index b1e6edae0de15e2b03c5e9a1344886e790f079e3..131a8fcf8b0e9ddb5e9f456c494ddea27d4cb88e 100644 +index 377bbfd611ff1ddd3c8c2a4fc3e2d6b3b24f93b8..74f1bee84823bf6dac9fdecd47ec492071c07169 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2352,6 +2352,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2360,6 +2360,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { public void resetCooldown() { getHandle().resetAttackStrengthTicker(); } diff --git a/patches/server/0334-Fix-World-isChunkGenerated-calls.patch b/patches/server/0334-Fix-World-isChunkGenerated-calls.patch index b3ddf0a8f..7a613ff01 100644 --- a/patches/server/0334-Fix-World-isChunkGenerated-calls.patch +++ b/patches/server/0334-Fix-World-isChunkGenerated-calls.patch @@ -8,10 +8,10 @@ This patch also adds a chunk status cache on region files (note that its only purpose is to cache the status on DISK) diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index 347cb9f7d403047b99c913a96292147ebbaaff2b..d302c074d8808145e425380eb0f8e5ccf8f256c3 100644 +index 415425364f739a8a1c7ec1f33df5bf2baba6558d..a89af36c461432045fb4d00c0517db5c197245ce 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -86,6 +86,7 @@ import net.minecraft.world.level.chunk.ProtoChunk; +@@ -87,6 +87,7 @@ import net.minecraft.world.level.chunk.ProtoChunk; import net.minecraft.world.level.chunk.UpgradeData; import net.minecraft.world.level.chunk.storage.ChunkSerializer; import net.minecraft.world.level.chunk.storage.ChunkStorage; @@ -19,7 +19,7 @@ index 347cb9f7d403047b99c913a96292147ebbaaff2b..d302c074d8808145e425380eb0f8e5cc import net.minecraft.world.level.entity.ChunkStatusUpdateListener; import net.minecraft.world.level.levelgen.blending.BlendingData; import net.minecraft.world.level.levelgen.structure.StructureStart; -@@ -1210,10 +1211,59 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1215,10 +1216,59 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @Nullable public CompoundTag readChunk(ChunkPos pos) throws IOException { CompoundTag nbttagcompound = this.read(pos); diff --git a/patches/server/0346-Duplicate-UUID-Resolve-Option.patch b/patches/server/0346-Duplicate-UUID-Resolve-Option.patch index 842c9ac06..491e45373 100644 --- a/patches/server/0346-Duplicate-UUID-Resolve-Option.patch +++ b/patches/server/0346-Duplicate-UUID-Resolve-Option.patch @@ -83,7 +83,7 @@ index 5628ddebd2a24dc8461c1bd4b0571aa5efd3b418..a0b04a04f90ef79edae77e6ab4cddd2a private void countAllMobsForSpawning() { countAllMobsForSpawning = getBoolean("count-all-mobs-for-spawning", false); diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index d302c074d8808145e425380eb0f8e5ccf8f256c3..97ca952fd3d7262b72606be4fb4c3320b142d4c3 100644 +index a89af36c461432045fb4d00c0517db5c197245ce..f7b65c62002a8907c1b38b6c4ea67455eb3d807c 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java @@ -1,6 +1,7 @@ @@ -94,9 +94,9 @@ index d302c074d8808145e425380eb0f8e5ccf8f256c3..97ca952fd3d7262b72606be4fb4c3320 import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList.Builder; import com.google.common.collect.Iterables; -@@ -28,13 +29,17 @@ import java.io.IOException; - import java.io.Writer; +@@ -29,13 +30,17 @@ import java.io.Writer; import java.nio.file.Path; + import java.util.ArrayList; import java.util.BitSet; +import java.util.HashMap; // Paper +import java.util.Collection; @@ -112,7 +112,7 @@ index d302c074d8808145e425380eb0f8e5ccf8f256c3..97ca952fd3d7262b72606be4fb4c3320 import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletionException; import java.util.concurrent.CompletionStage; -@@ -845,6 +850,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -856,6 +861,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider entity.discard(); needsRemoval = true; } @@ -120,7 +120,7 @@ index d302c074d8808145e425380eb0f8e5ccf8f256c3..97ca952fd3d7262b72606be4fb4c3320 return !needsRemoval; })); // CraftBukkit end -@@ -895,6 +901,43 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -906,6 +912,43 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider }); } diff --git a/patches/server/0360-Fix-Light-Command.patch b/patches/server/0360-Fix-Light-Command.patch index e7a67d9ff..9a4177d9a 100644 --- a/patches/server/0360-Fix-Light-Command.patch +++ b/patches/server/0360-Fix-Light-Command.patch @@ -134,10 +134,10 @@ index 005361c38b02713fb823d0be40954400d59f0c4d..3091c100eaf5a86ba270ef0d96de1852 + } } diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index 97ca952fd3d7262b72606be4fb4c3320b142d4c3..90a2153d8037d51f701b80d7ac7d46d9e282fa6e 100644 +index f7b65c62002a8907c1b38b6c4ea67455eb3d807c..fd1b17ae9f2d51183eebc2b23209f6c80d81b1f6 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -133,6 +133,12 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -134,6 +134,12 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider private final ChunkTaskPriorityQueueSorter queueSorter; private final ProcessorHandle> worldgenMailbox; public final ProcessorHandle> mainThreadMailbox; @@ -150,7 +150,7 @@ index 97ca952fd3d7262b72606be4fb4c3320b142d4c3..90a2153d8037d51f701b80d7ac7d46d9 public final ChunkProgressListener progressListener; private final ChunkStatusUpdateListener chunkStatusListener; public final ChunkMap.ChunkDistanceManager distanceManager; -@@ -241,11 +247,12 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -242,11 +248,12 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider this.progressListener = worldGenerationProgressListener; this.chunkStatusListener = chunkStatusChangeListener; diff --git a/patches/server/0362-Tracking-Range-Improvements.patch b/patches/server/0362-Tracking-Range-Improvements.patch index 0e7afcf55..1ff59ebf3 100644 --- a/patches/server/0362-Tracking-Range-Improvements.patch +++ b/patches/server/0362-Tracking-Range-Improvements.patch @@ -8,10 +8,10 @@ Sets tracking range of watermobs to animals instead of misc and simplifies code Also ignores Enderdragon, defaulting it to Mojang's setting diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index 90a2153d8037d51f701b80d7ac7d46d9e282fa6e..3e3de423696a85d0dbdf9171a82a39635f00cd59 100644 +index fd1b17ae9f2d51183eebc2b23209f6c80d81b1f6..cb46732f78748864117cafa94f6d3af14205d71f 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -1860,6 +1860,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1865,6 +1865,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider while (iterator.hasNext()) { Entity entity = (Entity) iterator.next(); int j = entity.getType().clientTrackingRange() * 16; diff --git a/patches/server/0364-implement-optional-per-player-mob-spawns.patch b/patches/server/0364-implement-optional-per-player-mob-spawns.patch index 22e32c157..784578d94 100644 --- a/patches/server/0364-implement-optional-per-player-mob-spawns.patch +++ b/patches/server/0364-implement-optional-per-player-mob-spawns.patch @@ -547,10 +547,10 @@ index 0000000000000000000000000000000000000000..11de56afaf059b00fa5bec293516bcdc + } +} diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index 3e3de423696a85d0dbdf9171a82a39635f00cd59..ae1e347072bd898cebd00e66c8593f928a95a84c 100644 +index cb46732f78748864117cafa94f6d3af14205d71f..f1fa28fb90f07a4e2de541b2f7ca2f2d7c1d6a31 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -150,6 +150,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -151,6 +151,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider private final Long2ByteMap chunkTypeCache; private final Queue unloadQueue; int viewDistance; @@ -558,7 +558,7 @@ index 3e3de423696a85d0dbdf9171a82a39635f00cd59..ae1e347072bd898cebd00e66c8593f92 // CraftBukkit start - recursion-safe executor for Chunk loadCallback() and unloadCallback() public final CallbackExecutor callbackExecutor = new CallbackExecutor(); -@@ -262,6 +263,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -263,6 +264,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider this.dataRegionManager = new io.papermc.paper.chunk.SingleThreadChunkRegionManager(this.level, 2, (1.0 / 3.0), 1, 6, "Data", DataRegionData::new, DataRegionSectionData::new); this.regionManagers.add(this.dataRegionManager); // Paper end @@ -566,7 +566,7 @@ index 3e3de423696a85d0dbdf9171a82a39635f00cd59..ae1e347072bd898cebd00e66c8593f92 } protected ChunkGenerator generator() { -@@ -279,6 +281,25 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -280,6 +282,25 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider }); } diff --git a/patches/server/0387-Prevent-Double-PlayerChunkMap-adds-crashing-server.patch b/patches/server/0387-Prevent-Double-PlayerChunkMap-adds-crashing-server.patch index 550ee197c..d956e5242 100644 --- a/patches/server/0387-Prevent-Double-PlayerChunkMap-adds-crashing-server.patch +++ b/patches/server/0387-Prevent-Double-PlayerChunkMap-adds-crashing-server.patch @@ -7,10 +7,10 @@ Suspected case would be around the technique used in .stopRiding Stack will identify any causer of this and warn instead of crashing. diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index ae1e347072bd898cebd00e66c8593f928a95a84c..ba365e64dd29e3d6863ea51e7b00872e242072e5 100644 +index f1fa28fb90f07a4e2de541b2f7ca2f2d7c1d6a31..01f87e67d6760b295d7333973f39f8ff6ef3cee5 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -1574,6 +1574,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1579,6 +1579,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider public void addEntity(Entity entity) { org.spigotmc.AsyncCatcher.catchOp("entity track"); // Spigot diff --git a/patches/server/0393-Improved-Watchdog-Support.patch b/patches/server/0393-Improved-Watchdog-Support.patch index 7054f4beb..7db73e78c 100644 --- a/patches/server/0393-Improved-Watchdog-Support.patch +++ b/patches/server/0393-Improved-Watchdog-Support.patch @@ -262,10 +262,10 @@ index 049eb5693dc98e1d0ec3bd88c73a41fdb2f59bff..0716aaf29f9d76240a0de4ca02daba44 } diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index ba365e64dd29e3d6863ea51e7b00872e242072e5..91d1b7ee3f47d06cdd15234a799f95ae6882af03 100644 +index 01f87e67d6760b295d7333973f39f8ff6ef3cee5..368dc3a7bd04b106db5b83d73dcab2e09c8d8af9 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -541,6 +541,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -552,6 +552,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider MutableBoolean mutableboolean = new MutableBoolean(); do { @@ -287,7 +287,7 @@ index 8901bb31524613bf3fbec3cc5d3c228f8b3f43a4..4e26475bf0f541d6b2f8b6eccfeaeb9e // Paper start - Remove from collideRule team if needed diff --git a/src/main/java/net/minecraft/util/thread/BlockableEventLoop.java b/src/main/java/net/minecraft/util/thread/BlockableEventLoop.java -index 58692386e24723a1075ff4f4cc70f40ed957c52f..af5097592835ea46336052fed5bf98760fe18ac8 100644 +index 7bf4bf5cb2c1b54a7e2733091f48f3a824336d36..dcce05d2f4ab16424db4ab103a12188e207a457b 100644 --- a/src/main/java/net/minecraft/util/thread/BlockableEventLoop.java +++ b/src/main/java/net/minecraft/util/thread/BlockableEventLoop.java @@ -148,6 +148,7 @@ public abstract class BlockableEventLoop implements Profiler @@ -296,8 +296,8 @@ index 58692386e24723a1075ff4f4cc70f40ed957c52f..af5097592835ea46336052fed5bf9876 } catch (Exception var3) { + if (var3.getCause() instanceof ThreadDeath) throw var3; // Paper LOGGER.fatal("Error executing task on {}", this.name(), var3); - throw var3; } + diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java index 9842e4d39130f45481b643df38ee4b25076c5c08..4a77494ddb94d5fd2d82665c6bd4e513b66f1d9f 100644 --- a/src/main/java/net/minecraft/world/level/Level.java diff --git a/patches/server/0400-Implement-Player-Client-Options-API.patch b/patches/server/0400-Implement-Player-Client-Options-API.patch index dcf1849a6..389c9747a 100644 --- a/patches/server/0400-Implement-Player-Client-Options-API.patch +++ b/patches/server/0400-Implement-Player-Client-Options-API.patch @@ -97,10 +97,10 @@ index 9cbca14b0a111e57a1d01bcbcf2164ab8b53b1a5..cdb0eb8e21299ca70ed7ed5c1195d07f if (getMainArm() != packet.mainHand()) { PlayerChangedMainHandEvent event = new PlayerChangedMainHandEvent(this.getBukkitEntity(), getMainArm() == HumanoidArm.LEFT ? MainHand.LEFT : MainHand.RIGHT); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 131a8fcf8b0e9ddb5e9f456c494ddea27d4cb88e..ac535aef823ebe286847dafb8b0678de5d3128a1 100644 +index 74f1bee84823bf6dac9fdecd47ec492071c07169..c9d2777748f2df4260fa2a7df4ddb090524fa9f8 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -544,6 +544,24 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -545,6 +545,24 @@ public class CraftPlayer extends CraftHumanEntity implements Player { public void setSendViewDistance(int viewDistance) { throw new NotImplementedException("Per-Player View Distance APIs need further understanding to properly implement (There are per world view distances though!)"); // TODO } diff --git a/patches/server/0403-Fix-Chunk-Post-Processing-deadlock-risk.patch b/patches/server/0403-Fix-Chunk-Post-Processing-deadlock-risk.patch index c450ef531..18656d981 100644 --- a/patches/server/0403-Fix-Chunk-Post-Processing-deadlock-risk.patch +++ b/patches/server/0403-Fix-Chunk-Post-Processing-deadlock-risk.patch @@ -25,10 +25,10 @@ This successfully fixed a reoccurring and highly reproduceable crash for heightmaps. diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index 91d1b7ee3f47d06cdd15234a799f95ae6882af03..aeaaf975221a6495040ecf477cfb04f536fef213 100644 +index 368dc3a7bd04b106db5b83d73dcab2e09c8d8af9..dd73ab00d74b918548ae5ef810c07a8c1f349475 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -173,6 +173,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -174,6 +174,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider }; // CraftBukkit end @@ -36,7 +36,7 @@ index 91d1b7ee3f47d06cdd15234a799f95ae6882af03..aeaaf975221a6495040ecf477cfb04f5 // Paper start - distance maps private final com.destroystokyo.paper.util.misc.PooledLinkedHashSets pooledLinkedPlayerHashSets = new com.destroystokyo.paper.util.misc.PooledLinkedHashSets<>(); -@@ -981,7 +982,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -992,7 +993,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider return Either.left(chunk); }); }, (runnable) -> { diff --git a/patches/server/0404-Fix-Longstanding-Broken-behavior-of-PlayerJoinEvent.patch b/patches/server/0404-Fix-Longstanding-Broken-behavior-of-PlayerJoinEvent.patch index 02bd9527a..fb0ffb485 100644 --- a/patches/server/0404-Fix-Longstanding-Broken-behavior-of-PlayerJoinEvent.patch +++ b/patches/server/0404-Fix-Longstanding-Broken-behavior-of-PlayerJoinEvent.patch @@ -28,10 +28,10 @@ receives a deterministic result, and should no longer require 1 tick delays anymore. diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index aeaaf975221a6495040ecf477cfb04f536fef213..ab0e3059e5d1e012f5c94d18aaebf218470d3be3 100644 +index dd73ab00d74b918548ae5ef810c07a8c1f349475..0d4d400b6f0b0d939dac7887da793c21ac6bfb1b 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -1583,6 +1583,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1588,6 +1588,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider .printStackTrace(); return; } diff --git a/patches/server/0429-Reduce-allocation-of-Vec3D-by-entity-tracker.patch b/patches/server/0429-Reduce-allocation-of-Vec3D-by-entity-tracker.patch index 39e16edf1..00406b82b 100644 --- a/patches/server/0429-Reduce-allocation-of-Vec3D-by-entity-tracker.patch +++ b/patches/server/0429-Reduce-allocation-of-Vec3D-by-entity-tracker.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Reduce allocation of Vec3D by entity tracker diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index ab0e3059e5d1e012f5c94d18aaebf218470d3be3..e8b68702d7f720ba9d2985984547d0dda9541d41 100644 +index 0d4d400b6f0b0d939dac7887da793c21ac6bfb1b..f4fddfcb33ae463c6a86e7282d069279258bc4ff 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -1856,9 +1856,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1861,9 +1861,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider public void updatePlayer(ServerPlayer player) { org.spigotmc.AsyncCatcher.catchOp("player tracker update"); // Spigot if (player != this.entity) { diff --git a/patches/server/0432-Optimize-anyPlayerCloseEnoughForSpawning-to-use-dist.patch b/patches/server/0432-Optimize-anyPlayerCloseEnoughForSpawning-to-use-dist.patch index 344e0dff3..bdd12d1e9 100644 --- a/patches/server/0432-Optimize-anyPlayerCloseEnoughForSpawning-to-use-dist.patch +++ b/patches/server/0432-Optimize-anyPlayerCloseEnoughForSpawning-to-use-dist.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Optimize anyPlayerCloseEnoughForSpawning to use distance maps Use a distance map to find the players in range quickly diff --git a/src/main/java/net/minecraft/server/level/ChunkHolder.java b/src/main/java/net/minecraft/server/level/ChunkHolder.java -index 51175994b37e966af8983df1f15a0fc5a638a0b5..347cf5d00d986ae8ad60af7f6eabde9fbfd78561 100644 +index b3dc875fde93095d20ae88159afe82c6b452ed8e..7c3eaa72263708f5b2cea455b3eea230bc633c5d 100644 --- a/src/main/java/net/minecraft/server/level/ChunkHolder.java +++ b/src/main/java/net/minecraft/server/level/ChunkHolder.java @@ -73,6 +73,18 @@ public class ChunkHolder { @@ -37,10 +37,10 @@ index 51175994b37e966af8983df1f15a0fc5a638a0b5..347cf5d00d986ae8ad60af7f6eabde9f // CraftBukkit start diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index 7f4b68199b0cd8adb09ef09539b43e62885e19c5..344d18b91a9a5d1c0d55d3a0a12073246de24046 100644 +index f4fddfcb33ae463c6a86e7282d069279258bc4ff..e64d1493c5e77daad2e410647412a2e1e9813109 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -176,21 +176,40 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -177,21 +177,40 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider final CallbackExecutor chunkLoadConversionCallbackExecutor = new CallbackExecutor(); // Paper // Paper start - distance maps private final com.destroystokyo.paper.util.misc.PooledLinkedHashSets pooledLinkedPlayerHashSets = new com.destroystokyo.paper.util.misc.PooledLinkedHashSets<>(); @@ -82,7 +82,7 @@ index 7f4b68199b0cd8adb09ef09539b43e62885e19c5..344d18b91a9a5d1c0d55d3a0a1207324 } // Paper end // Paper start -@@ -265,6 +284,38 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -266,6 +285,38 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider this.regionManagers.add(this.dataRegionManager); // Paper end this.playerMobDistanceMap = this.level.paperConfig.perPlayerMobSpawns ? new com.destroystokyo.paper.util.PlayerMobDistanceMap() : null; // Paper @@ -121,7 +121,7 @@ index 7f4b68199b0cd8adb09ef09539b43e62885e19c5..344d18b91a9a5d1c0d55d3a0a1207324 } protected ChunkGenerator generator() { -@@ -493,6 +544,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -504,6 +555,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } else { if (holder != null) { holder.setTicketLevel(level); @@ -129,7 +129,7 @@ index 7f4b68199b0cd8adb09ef09539b43e62885e19c5..344d18b91a9a5d1c0d55d3a0a1207324 } if (holder != null) { -@@ -1342,43 +1394,48 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1347,43 +1399,48 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider return this.anyPlayerCloseEnoughForSpawning(pos, false); } diff --git a/patches/server/0433-Use-distance-map-to-optimise-entity-tracker.patch b/patches/server/0433-Use-distance-map-to-optimise-entity-tracker.patch index 521d1c338..be3179492 100644 --- a/patches/server/0433-Use-distance-map-to-optimise-entity-tracker.patch +++ b/patches/server/0433-Use-distance-map-to-optimise-entity-tracker.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Use distance map to optimise entity tracker Use the distance map to find candidate players for tracking. diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index 4aad2cee76f4368f607475425c5bf516f51f830d..0bd55c5a43bfed7d5c80f6859b2827b7da3d0804 100644 +index e64d1493c5e77daad2e410647412a2e1e9813109..c9a10f327f971e68bf5bb4ed0793a046233e3d74 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -66,6 +66,7 @@ import net.minecraft.network.protocol.game.ClientboundSetEntityLinkPacket; +@@ -67,6 +67,7 @@ import net.minecraft.network.protocol.game.ClientboundSetEntityLinkPacket; import net.minecraft.network.protocol.game.ClientboundSetPassengersPacket; import net.minecraft.network.protocol.game.DebugPackets; import net.minecraft.server.MCUtil; @@ -17,7 +17,7 @@ index 4aad2cee76f4368f607475425c5bf516f51f830d..0bd55c5a43bfed7d5c80f6859b2827b7 import net.minecraft.server.level.progress.ChunkProgressListener; import net.minecraft.server.network.ServerPlayerConnection; import net.minecraft.util.CsvOutput; -@@ -187,10 +188,35 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -188,10 +189,35 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider public final com.destroystokyo.paper.util.misc.PlayerAreaMap playerMobSpawnMap; // this map is absent from updateMaps since it's controlled at the start of the chunkproviderserver tick public final com.destroystokyo.paper.util.misc.PlayerAreaMap playerChunkTickRangeMap; // Paper end - optimise PlayerChunkMap#isOutsideRange @@ -53,7 +53,7 @@ index 4aad2cee76f4368f607475425c5bf516f51f830d..0bd55c5a43bfed7d5c80f6859b2827b7 // Note: players need to be explicitly added to distance maps before they can be updated // Paper start - optimise PlayerChunkMap#isOutsideRange this.playerChunkTickRangeMap.update(player, chunkX, chunkZ, DistanceManager.MOB_SPAWN_RANGE); -@@ -199,6 +225,11 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -200,6 +226,11 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } void removePlayerFromDistanceMaps(ServerPlayer player) { @@ -65,7 +65,7 @@ index 4aad2cee76f4368f607475425c5bf516f51f830d..0bd55c5a43bfed7d5c80f6859b2827b7 // Paper start - optimise PlayerChunkMap#isOutsideRange this.playerMobSpawnMap.remove(player); this.playerChunkTickRangeMap.remove(player); -@@ -209,6 +240,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -210,6 +241,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider int chunkX = MCUtil.getChunkCoordinate(player.getX()); int chunkZ = MCUtil.getChunkCoordinate(player.getZ()); // Note: players need to be explicitly added to distance maps before they can be updated @@ -80,7 +80,7 @@ index 4aad2cee76f4368f607475425c5bf516f51f830d..0bd55c5a43bfed7d5c80f6859b2827b7 this.playerChunkTickRangeMap.update(player, chunkX, chunkZ, DistanceManager.MOB_SPAWN_RANGE); // Paper - optimise PlayerChunkMap#isOutsideRange } // Paper end -@@ -284,6 +323,45 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -285,6 +324,45 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider this.regionManagers.add(this.dataRegionManager); // Paper end this.playerMobDistanceMap = this.level.paperConfig.perPlayerMobSpawns ? new com.destroystokyo.paper.util.PlayerMobDistanceMap() : null; // Paper @@ -126,7 +126,7 @@ index 4aad2cee76f4368f607475425c5bf516f51f830d..0bd55c5a43bfed7d5c80f6859b2827b7 // Paper start - optimise PlayerChunkMap#isOutsideRange this.playerChunkTickRangeMap = new com.destroystokyo.paper.util.misc.PlayerAreaMap(this.pooledLinkedPlayerHashSets, (ServerPlayer player, int rangeX, int rangeZ, int currPosX, int currPosZ, int prevPosX, int prevPosZ, -@@ -1517,17 +1595,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1522,17 +1600,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } public void move(ServerPlayer player) { @@ -145,7 +145,7 @@ index 4aad2cee76f4368f607475425c5bf516f51f830d..0bd55c5a43bfed7d5c80f6859b2827b7 int i = SectionPos.blockToSectionCoord(player.getBlockX()); int j = SectionPos.blockToSectionCoord(player.getBlockZ()); -@@ -1657,7 +1725,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1662,7 +1730,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider entity.tracker = playerchunkmap_entitytracker; // Paper - Fast access to tracker this.entityMap.put(entity.getId(), playerchunkmap_entitytracker); @@ -154,7 +154,7 @@ index 4aad2cee76f4368f607475425c5bf516f51f830d..0bd55c5a43bfed7d5c80f6859b2827b7 if (entity instanceof ServerPlayer) { ServerPlayer entityplayer = (ServerPlayer) entity; -@@ -1701,7 +1769,37 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1706,7 +1774,37 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider entity.tracker = null; // Paper - We're no longer tracked } @@ -192,7 +192,7 @@ index 4aad2cee76f4368f607475425c5bf516f51f830d..0bd55c5a43bfed7d5c80f6859b2827b7 List list = Lists.newArrayList(); List list1 = this.level.players(); ObjectIterator objectiterator = this.entityMap.values().iterator(); -@@ -1772,23 +1870,31 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1777,23 +1875,31 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider DebugPackets.sendPoiPacketsForChunk(this.level, chunk.getPos()); List list = Lists.newArrayList(); List list1 = Lists.newArrayList(); @@ -236,7 +236,7 @@ index 4aad2cee76f4368f607475425c5bf516f51f830d..0bd55c5a43bfed7d5c80f6859b2827b7 Iterator iterator; Entity entity1; -@@ -1864,6 +1970,42 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1869,6 +1975,42 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider this.lastSectionPos = SectionPos.of(entity); } diff --git a/patches/server/0456-incremental-chunk-saving.patch b/patches/server/0456-incremental-chunk-saving.patch index b9952cab0..19daf3774 100644 --- a/patches/server/0456-incremental-chunk-saving.patch +++ b/patches/server/0456-incremental-chunk-saving.patch @@ -97,7 +97,7 @@ index 4351dd9c293d1db48c87c5df28bcb2b9a59583f7..8a3583bcf2d2a694b30718062bc7f2e1 // Paper start - move executeAll() into full server tick timing try (co.aikar.timings.Timing ignored = MinecraftTimings.processTasksTimer.startTiming()) { diff --git a/src/main/java/net/minecraft/server/level/ChunkHolder.java b/src/main/java/net/minecraft/server/level/ChunkHolder.java -index 347cf5d00d986ae8ad60af7f6eabde9fbfd78561..bab59dc2747a24ce6b48c8f962f81c50a316d89e 100644 +index 7c3eaa72263708f5b2cea455b3eea230bc633c5d..9c58274f680c1f873b7832d2175d1d449544bff1 100644 --- a/src/main/java/net/minecraft/server/level/ChunkHolder.java +++ b/src/main/java/net/minecraft/server/level/ChunkHolder.java @@ -84,6 +84,8 @@ public class ChunkHolder { @@ -109,7 +109,7 @@ index 347cf5d00d986ae8ad60af7f6eabde9fbfd78561..bab59dc2747a24ce6b48c8f962f81c50 public ChunkHolder(ChunkPos pos, int level, LevelHeightAccessor world, LevelLightEngine lightingProvider, ChunkHolder.LevelChangeListener levelUpdateListener, ChunkHolder.PlayerProvider playersWatchingChunkProvider) { this.futures = new AtomicReferenceArray(ChunkHolder.CHUNK_STATUSES.size()); -@@ -463,7 +465,19 @@ public class ChunkHolder { +@@ -473,7 +475,19 @@ public class ChunkHolder { boolean flag2 = playerchunk_state.isOrAfter(ChunkHolder.FullChunkStatus.BORDER); boolean flag3 = playerchunk_state1.isOrAfter(ChunkHolder.FullChunkStatus.BORDER); @@ -129,7 +129,7 @@ index 347cf5d00d986ae8ad60af7f6eabde9fbfd78561..bab59dc2747a24ce6b48c8f962f81c50 if (!flag2 && flag3) { int expectCreateCount = ++this.fullChunkCreateCount; // Paper this.fullChunkFuture = chunkStorage.prepareAccessibleChunk(this); -@@ -594,9 +608,33 @@ public class ChunkHolder { +@@ -604,9 +618,33 @@ public class ChunkHolder { } public void refreshAccessibility() { @@ -164,10 +164,10 @@ index 347cf5d00d986ae8ad60af7f6eabde9fbfd78561..bab59dc2747a24ce6b48c8f962f81c50 for (int i = 0; i < this.futures.length(); ++i) { CompletableFuture> completablefuture = (CompletableFuture) this.futures.get(i); diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index 4ceeec4bc9faad457c2a3389cbe0ce3353bb54cb..7b5c49f17c2a69a45a77423f89bf7c31cbd26c23 100644 +index c9a10f327f971e68bf5bb4ed0793a046233e3d74..a65f3f24fe00b130520ba9af178f1cf7ad3ece26 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -100,6 +100,7 @@ import net.minecraft.world.level.levelgen.structure.templatesystem.StructureMana +@@ -101,6 +101,7 @@ import net.minecraft.world.level.levelgen.structure.templatesystem.StructureMana import net.minecraft.world.level.storage.DimensionDataStorage; import net.minecraft.world.level.storage.LevelStorageSource; import net.minecraft.world.phys.Vec3; @@ -175,7 +175,7 @@ index 4ceeec4bc9faad457c2a3389cbe0ce3353bb54cb..7b5c49f17c2a69a45a77423f89bf7c31 import org.apache.commons.lang3.mutable.MutableBoolean; import org.apache.commons.lang3.mutable.MutableObject; import org.apache.logging.log4j.LogManager; -@@ -666,6 +667,64 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -677,6 +678,64 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } @@ -240,7 +240,7 @@ index 4ceeec4bc9faad457c2a3389cbe0ce3353bb54cb..7b5c49f17c2a69a45a77423f89bf7c31 protected void saveAllChunks(boolean flush) { if (flush) { List list = (List) this.visibleChunkMap.values().stream().filter(ChunkHolder::wasAccessibleSinceLastSave).peek(ChunkHolder::refreshAccessibility).collect(Collectors.toList()); -@@ -761,7 +820,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -772,7 +831,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider int l = 0; ObjectIterator objectiterator = this.visibleChunkMap.values().iterator(); @@ -249,7 +249,7 @@ index 4ceeec4bc9faad457c2a3389cbe0ce3353bb54cb..7b5c49f17c2a69a45a77423f89bf7c31 if (this.saveChunkIfNeeded((ChunkHolder) objectiterator.next())) { ++l; } -@@ -803,6 +862,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -814,6 +873,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider this.level.unload(chunk); } @@ -257,7 +257,7 @@ index 4ceeec4bc9faad457c2a3389cbe0ce3353bb54cb..7b5c49f17c2a69a45a77423f89bf7c31 this.lightEngine.updateChunkStatus(ichunkaccess.getPos()); this.lightEngine.tryScheduleUpdate(); -@@ -1206,6 +1266,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1211,6 +1271,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider asyncSaveData, chunk); chunk.setUnsaved(false); @@ -265,7 +265,7 @@ index 4ceeec4bc9faad457c2a3389cbe0ce3353bb54cb..7b5c49f17c2a69a45a77423f89bf7c31 } // Paper end -@@ -1215,6 +1276,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1220,6 +1281,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider if (!chunk.isUnsaved()) { return false; } else { diff --git a/patches/server/0461-Remove-some-streams-from-structures.patch b/patches/server/0461-Remove-some-streams-from-structures.patch index b4ec016db..0f1c83377 100644 --- a/patches/server/0461-Remove-some-streams-from-structures.patch +++ b/patches/server/0461-Remove-some-streams-from-structures.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Remove some streams from structures This showed up a lot in the spark profiler, should have a low-medium performance improvement. diff --git a/src/main/java/net/minecraft/world/level/levelgen/Beardifier.java b/src/main/java/net/minecraft/world/level/levelgen/Beardifier.java -index 1de44cc8d3e030421ad50a732bfe569f569655f0..98c4ddb261b6a17f6b8fc269c98add92688cae96 100644 +index 81b3f09e2da2363184f57bac08651185c8685b1a..6a2db2294d8692c070243d5e4f8773daa30bead6 100644 --- a/src/main/java/net/minecraft/world/level/levelgen/Beardifier.java +++ b/src/main/java/net/minecraft/world/level/levelgen/Beardifier.java @@ -16,6 +16,7 @@ import net.minecraft.world.level.levelgen.feature.structures.StructureTemplatePo @@ -21,9 +21,9 @@ index 1de44cc8d3e030421ad50a732bfe569f569655f0..98c4ddb261b6a17f6b8fc269c98add92 this.rigids = new ObjectArrayList<>(10); for(StructureFeature structureFeature : StructureFeature.NOISE_AFFECTING_FEATURES) { -- structureAccessor.startsForFeature(SectionPos.bottomOf(chunk), structureFeature).forEach((structureStart) -> { -+ for (StructureStart structureStart : structureAccessor.startsForFeature(SectionPos.bottomOf(chunk), structureFeature)) { // Paper - remove streams - for(StructurePiece structurePiece : structureStart.getPieces()) { +- structureAccessor.startsForFeature(SectionPos.bottomOf(chunk), structureFeature).forEach((start) -> { ++ for (StructureStart start : structureAccessor.startsForFeature(SectionPos.bottomOf(chunk), structureFeature)) { // Paper - remove streams + for(StructurePiece structurePiece : start.getPieces()) { if (structurePiece.isCloseToChunk(chunkPos, 12)) { if (structurePiece instanceof PoolElementStructurePiece) { @@ -66,7 +67,7 @@ public class Beardifier implements NoiseChunk.NoiseFiller { diff --git a/patches/server/0471-Implement-Chunk-Priority-Urgency-System-for-Chunks.patch b/patches/server/0471-Implement-Chunk-Priority-Urgency-System-for-Chunks.patch index 201fbdfd4..91bf85df1 100644 --- a/patches/server/0471-Implement-Chunk-Priority-Urgency-System-for-Chunks.patch +++ b/patches/server/0471-Implement-Chunk-Priority-Urgency-System-for-Chunks.patch @@ -80,7 +80,7 @@ index 2fe519d4059fac06781c30e140895b604e13104f..35949e9c15eb998aa89842d34d0999cd chunkData.addProperty("queued-for-unload", chunkMap.toDrop.contains(playerChunk.pos.longKey)); chunkData.addProperty("status", status == null ? "unloaded" : status.toString()); diff --git a/src/main/java/net/minecraft/server/level/ChunkHolder.java b/src/main/java/net/minecraft/server/level/ChunkHolder.java -index bab59dc2747a24ce6b48c8f962f81c50a316d89e..05814028d205f7a1e468bdaaae9e9916047ff4ce 100644 +index 9c58274f680c1f873b7832d2175d1d449544bff1..26cafbffd6820411df6b9c41bd295883e1090c40 100644 --- a/src/main/java/net/minecraft/server/level/ChunkHolder.java +++ b/src/main/java/net/minecraft/server/level/ChunkHolder.java @@ -57,7 +57,7 @@ public class ChunkHolder { @@ -100,7 +100,7 @@ index bab59dc2747a24ce6b48c8f962f81c50a316d89e..05814028d205f7a1e468bdaaae9e9916 boolean isUpdateQueued = false; // Paper private final ChunkMap chunkMap; // Paper -@@ -409,12 +410,18 @@ public class ChunkHolder { +@@ -419,12 +420,18 @@ public class ChunkHolder { }); } @@ -119,7 +119,7 @@ index bab59dc2747a24ce6b48c8f962f81c50a316d89e..05814028d205f7a1e468bdaaae9e9916 ChunkStatus chunkstatus = ChunkHolder.getStatus(this.oldTicketLevel); ChunkStatus chunkstatus1 = ChunkHolder.getStatus(this.ticketLevel); boolean flag = this.oldTicketLevel <= ChunkMap.MAX_CHUNK_DISTANCE; -@@ -425,9 +432,22 @@ public class ChunkHolder { +@@ -435,9 +442,22 @@ public class ChunkHolder { // ChunkUnloadEvent: Called before the chunk is unloaded: isChunkLoaded is still true and chunk can still be modified by plugins. if (playerchunk_state.isOrAfter(ChunkHolder.FullChunkStatus.BORDER) && !playerchunk_state1.isOrAfter(ChunkHolder.FullChunkStatus.BORDER)) { this.getFutureIfPresentUnchecked(ChunkStatus.FULL).thenAccept((either) -> { @@ -143,7 +143,7 @@ index bab59dc2747a24ce6b48c8f962f81c50a316d89e..05814028d205f7a1e468bdaaae9e9916 // Minecraft will apply the chunks tick lists to the world once the chunk got loaded, and then store the tick // lists again inside the chunk once the chunk becomes inaccessible and set the chunk's needsSaving flag. // These actions may however happen deferred, so we manually set the needsSaving flag already here. -@@ -484,12 +504,14 @@ public class ChunkHolder { +@@ -494,12 +514,14 @@ public class ChunkHolder { this.scheduleFullChunkPromotion(chunkStorage, this.fullChunkFuture, executor, ChunkHolder.FullChunkStatus.BORDER); // Paper start - cache ticking ready status this.fullChunkFuture.thenAccept(either -> { @@ -158,7 +158,7 @@ index bab59dc2747a24ce6b48c8f962f81c50a316d89e..05814028d205f7a1e468bdaaae9e9916 } }); this.updateChunkToSave(this.fullChunkFuture, "full"); -@@ -510,6 +532,7 @@ public class ChunkHolder { +@@ -520,6 +542,7 @@ public class ChunkHolder { this.scheduleFullChunkPromotion(chunkStorage, this.tickingChunkFuture, executor, ChunkHolder.FullChunkStatus.TICKING); // Paper start - cache ticking ready status this.tickingChunkFuture.thenAccept(either -> { @@ -166,7 +166,7 @@ index bab59dc2747a24ce6b48c8f962f81c50a316d89e..05814028d205f7a1e468bdaaae9e9916 either.ifLeft(chunk -> { // note: Here is a very good place to add callbacks to logic waiting on this. ChunkHolder.this.isTickingReady = true; -@@ -545,6 +568,7 @@ public class ChunkHolder { +@@ -555,6 +578,7 @@ public class ChunkHolder { this.scheduleFullChunkPromotion(chunkStorage, this.entityTickingChunkFuture, executor, ChunkHolder.FullChunkStatus.ENTITY_TICKING); // Paper start - cache ticking ready status this.entityTickingChunkFuture.thenAccept(either -> { @@ -174,7 +174,7 @@ index bab59dc2747a24ce6b48c8f962f81c50a316d89e..05814028d205f7a1e468bdaaae9e9916 either.ifLeft(chunk -> { ChunkHolder.this.isEntityTickingReady = true; // Paper start - entity ticking chunk set -@@ -571,16 +595,45 @@ public class ChunkHolder { +@@ -581,16 +605,45 @@ public class ChunkHolder { this.demoteFullChunk(chunkStorage, playerchunk_state1); } @@ -223,7 +223,7 @@ index bab59dc2747a24ce6b48c8f962f81c50a316d89e..05814028d205f7a1e468bdaaae9e9916 }); } }).exceptionally((throwable) -> { -@@ -695,7 +748,134 @@ public class ChunkHolder { +@@ -705,7 +758,134 @@ public class ChunkHolder { }; } @@ -360,10 +360,10 @@ index bab59dc2747a24ce6b48c8f962f81c50a316d89e..05814028d205f7a1e468bdaaae9e9916 return this.isEntityTickingReady; } diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index 771f34b8a8b4d46343264be59da47ed4bb4cfdf5..d3d5041bddafd03e053c1bc04883c67d7d98556f 100644 +index a65f3f24fe00b130520ba9af178f1cf7ad3ece26..4c48dcdb825e041a1d7392cea0e8afb687d45a0a 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -127,6 +127,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -128,6 +128,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider public final ServerLevel level; private final ThreadedLevelLightEngine lightEngine; private final BlockableEventLoop mainThreadExecutor; @@ -371,7 +371,7 @@ index 771f34b8a8b4d46343264be59da47ed4bb4cfdf5..d3d5041bddafd03e053c1bc04883c67d public ChunkGenerator generator; public final Supplier overworldDataStorage; private final PoiManager poiManager; -@@ -301,6 +302,15 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -302,6 +303,15 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider this.level = world; this.generator = chunkGenerator; this.mainThreadExecutor = mainThreadExecutor; @@ -387,7 +387,7 @@ index 771f34b8a8b4d46343264be59da47ed4bb4cfdf5..d3d5041bddafd03e053c1bc04883c67d ProcessorMailbox threadedmailbox = ProcessorMailbox.create(executor, "worldgen"); Objects.requireNonNull(mainThreadExecutor); -@@ -412,6 +422,37 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -413,6 +423,37 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider }); } @@ -425,15 +425,15 @@ index 771f34b8a8b4d46343264be59da47ed4bb4cfdf5..d3d5041bddafd03e053c1bc04883c67d // Paper start public void updatePlayerMobTypeMap(Entity entity) { if (!this.level.paperConfig.perPlayerMobSpawns) { -@@ -553,6 +594,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider - List>> list = Lists.newArrayList(); +@@ -555,6 +596,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider + List list1 = new ArrayList(); int j = centerChunk.x; int k = centerChunk.z; + ChunkHolder requestingNeighbor = getUpdatingChunkIfPresent(centerChunk.toLong()); // Paper for (int l = -margin; l <= margin; ++l) { for (int i1 = -margin; i1 <= margin; ++i1) { -@@ -571,6 +613,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -573,6 +615,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider ChunkStatus chunkstatus = (ChunkStatus) distanceToStatus.apply(j1); CompletableFuture> completablefuture = playerchunk.getOrScheduleFuture(chunkstatus, this); @@ -446,9 +446,9 @@ index 771f34b8a8b4d46343264be59da47ed4bb4cfdf5..d3d5041bddafd03e053c1bc04883c67d + } + // Paper end + list1.add(playerchunk); list.add(completablefuture); - } -@@ -902,11 +952,19 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -913,11 +963,19 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider if (requiredStatus == ChunkStatus.EMPTY) { return this.scheduleChunkLoad(chunkcoordintpair); } else { @@ -469,7 +469,7 @@ index 771f34b8a8b4d46343264be59da47ed4bb4cfdf5..d3d5041bddafd03e053c1bc04883c67d if (optional.isPresent() && ((ChunkAccess) optional.get()).getStatus().isOrAfter(requiredStatus)) { CompletableFuture> completablefuture = requiredStatus.load(this.level, this.structureManager, this.lightEngine, (ichunkaccess) -> { -@@ -918,6 +976,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -929,6 +987,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } else { return this.scheduleChunkGeneration(holder, requiredStatus); } @@ -477,7 +477,7 @@ index 771f34b8a8b4d46343264be59da47ed4bb4cfdf5..d3d5041bddafd03e053c1bc04883c67d } } -@@ -974,14 +1033,24 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -985,14 +1044,24 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider }; CompletableFuture chunkSaveFuture = this.level.asyncChunkTaskManager.getChunkSaveFuture(pos.x, pos.z); @@ -507,7 +507,7 @@ index 771f34b8a8b4d46343264be59da47ed4bb4cfdf5..d3d5041bddafd03e053c1bc04883c67d return ret; // Paper end } -@@ -1033,7 +1102,10 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1044,7 +1113,10 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider this.releaseLightTicket(chunkcoordintpair); return CompletableFuture.completedFuture(Either.right(playerchunk_failure)); }); @@ -519,7 +519,7 @@ index 771f34b8a8b4d46343264be59da47ed4bb4cfdf5..d3d5041bddafd03e053c1bc04883c67d } protected void releaseLightTicket(ChunkPos pos) { -@@ -1117,7 +1189,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1128,7 +1200,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider long i = chunkHolder.getPos().toLong(); Objects.requireNonNull(chunkHolder); @@ -1210,10 +1210,10 @@ index 3bc98586792960f50ca25929f1d91fc60a8577ce..ea4e897e04de9474abec5f6d0819bff4 net.minecraft.world.level.chunk.LevelChunk chunk = (net.minecraft.world.level.chunk.LevelChunk) either.left().orElse(null); if (chunk != null) addTicket(x, z); // Paper diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index ac535aef823ebe286847dafb8b0678de5d3128a1..e8f487d8338f1ef0b68150c30dcab5f9b3140e7d 100644 +index c9d2777748f2df4260fa2a7df4ddb090524fa9f8..da614e5fd56963794cf4915076a42693d5b3ffbe 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -907,6 +907,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -908,6 +908,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player { throw new UnsupportedOperationException("Cannot set rotation of players. Consider teleporting instead."); } diff --git a/patches/server/0485-Brand-support.patch b/patches/server/0485-Brand-support.patch index 03b69330c..b3efaa93c 100644 --- a/patches/server/0485-Brand-support.patch +++ b/patches/server/0485-Brand-support.patch @@ -72,10 +72,10 @@ index 26bd27d3dd6e99488fd0a77257866b1eb1b191b8..c5fc4a2470093202f38472df84355ba0 return (!this.player.joining && !this.connection.isConnected()) || this.processedDisconnect; // Paper } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index e8f487d8338f1ef0b68150c30dcab5f9b3140e7d..d99000543d880c3d9904e84059cf9ecf89fb8ac8 100644 +index da614e5fd56963794cf4915076a42693d5b3ffbe..f89fdf2913fb7caf0526b6f144638294cc688af4 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2492,6 +2492,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2500,6 +2500,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { // Paper end }; diff --git a/patches/server/0491-Improve-Chunk-Status-Transition-Speed.patch b/patches/server/0491-Improve-Chunk-Status-Transition-Speed.patch index 48697d05b..565e1bc8e 100644 --- a/patches/server/0491-Improve-Chunk-Status-Transition-Speed.patch +++ b/patches/server/0491-Improve-Chunk-Status-Transition-Speed.patch @@ -36,7 +36,7 @@ scenario / path: Previously would have hopped to SERVER around 12+ times there extra. diff --git a/src/main/java/net/minecraft/server/level/ChunkHolder.java b/src/main/java/net/minecraft/server/level/ChunkHolder.java -index 05814028d205f7a1e468bdaaae9e9916047ff4ce..8950470bbaa57ac0ef6ca4d6e3796a712e0b6cd6 100644 +index 26cafbffd6820411df6b9c41bd295883e1090c40..5b9abfb7b8edd686f416a46851f12bd52bea7000 100644 --- a/src/main/java/net/minecraft/server/level/ChunkHolder.java +++ b/src/main/java/net/minecraft/server/level/ChunkHolder.java @@ -87,6 +87,13 @@ public class ChunkHolder { @@ -54,10 +54,10 @@ index 05814028d205f7a1e468bdaaae9e9916047ff4ce..8950470bbaa57ac0ef6ca4d6e3796a71 public ChunkHolder(ChunkPos pos, int level, LevelHeightAccessor world, LevelLightEngine lightingProvider, ChunkHolder.LevelChangeListener levelUpdateListener, ChunkHolder.PlayerProvider playersWatchingChunkProvider) { this.futures = new AtomicReferenceArray(ChunkHolder.CHUNK_STATUSES.size()); diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index d3d5041bddafd03e053c1bc04883c67d7d98556f..b75ad5ee074489e3c66ef6524106241c6d577916 100644 +index 4c48dcdb825e041a1d7392cea0e8afb687d45a0a..d9f6d47629f2f4aa1db5a19b8cb7229a0905b75e 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -663,7 +663,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -674,7 +674,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider return either.mapLeft((list) -> { return (LevelChunk) list.get(list.size() / 2); }); @@ -66,7 +66,7 @@ index d3d5041bddafd03e053c1bc04883c67d7d98556f..b75ad5ee074489e3c66ef6524106241c } @Nullable -@@ -1073,6 +1073,12 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1084,6 +1084,12 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider return "chunkGenerate " + requiredStatus.getName(); }); Executor executor = (runnable) -> { diff --git a/patches/server/0522-Player-elytra-boost-API.patch b/patches/server/0522-Player-elytra-boost-API.patch index 5078f4db6..7191ed321 100644 --- a/patches/server/0522-Player-elytra-boost-API.patch +++ b/patches/server/0522-Player-elytra-boost-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Player elytra boost API diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index d99000543d880c3d9904e84059cf9ecf89fb8ac8..26fe2e651d7432591bd5ef910e6db06ba214fd4f 100644 +index f89fdf2913fb7caf0526b6f144638294cc688af4..10435f34526b20e50737a0328b464d7f1236f4bd 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -562,6 +562,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -563,6 +563,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } throw new RuntimeException("Unknown settings type"); } diff --git a/patches/server/0537-Fix-Player-spawnParticle-x-y-z-precision-loss.patch b/patches/server/0537-Fix-Player-spawnParticle-x-y-z-precision-loss.patch index 291319052..673f5803d 100644 --- a/patches/server/0537-Fix-Player-spawnParticle-x-y-z-precision-loss.patch +++ b/patches/server/0537-Fix-Player-spawnParticle-x-y-z-precision-loss.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix Player spawnParticle x/y/z precision loss diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 26fe2e651d7432591bd5ef910e6db06ba214fd4f..f4e5e1029eefd4a951b8e8ab291a2b94e4c96936 100644 +index 10435f34526b20e50737a0328b464d7f1236f4bd..ef6c209221ad3a48ea9749d81a9f536443fb9403 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2079,7 +2079,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2080,7 +2080,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { if (data != null && !particle.getDataType().isInstance(data)) { throw new IllegalArgumentException("data should be " + particle.getDataType() + " got " + data.getClass()); } diff --git a/patches/server/0578-Add-sendOpLevel-API.patch b/patches/server/0578-Add-sendOpLevel-API.patch index 86049b267..d4b019c7e 100644 --- a/patches/server/0578-Add-sendOpLevel-API.patch +++ b/patches/server/0578-Add-sendOpLevel-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add sendOpLevel API diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index ef1b4c290a9dee365a353a9ab26159ef399f0425..a841435338d6c242be35441d902ef2749ea6d406 100644 +index 236641fa4c325e455de0a5ad83541143f5bc18d1..e04e4cf62d2a7dcf95ffee452dc2ee2e2a4fdf6f 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -1119,6 +1119,11 @@ public abstract class PlayerList { @@ -32,10 +32,10 @@ index ef1b4c290a9dee365a353a9ab26159ef399f0425..a841435338d6c242be35441d902ef274 // Paper start diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index f4e5e1029eefd4a951b8e8ab291a2b94e4c96936..890a7ad0b18358d87b5dd746784e0025b30d08f6 100644 +index ef6c209221ad3a48ea9749d81a9f536443fb9403..eeaab3d50318dd06684bee3e484f6c7218259717 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -576,6 +576,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -577,6 +577,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { ? (org.bukkit.entity.Firework) entity.getBukkitEntity() : null; } diff --git a/patches/server/0657-additions-to-PlayerGameModeChangeEvent.patch b/patches/server/0657-additions-to-PlayerGameModeChangeEvent.patch index 723ea2b77..01cab80fa 100644 --- a/patches/server/0657-additions-to-PlayerGameModeChangeEvent.patch +++ b/patches/server/0657-additions-to-PlayerGameModeChangeEvent.patch @@ -139,10 +139,10 @@ index 9daad376b7c837ac5dcda5f54d520e2adfda0481..311df240858d4416306a795d893bdf7d } } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 890a7ad0b18358d87b5dd746784e0025b30d08f6..faf75252015d3852578c4ff047082a269f728592 100644 +index eeaab3d50318dd06684bee3e484f6c7218259717..edaf40cfe543ff7aeb356559dedc17620fd52056 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1267,7 +1267,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1268,7 +1268,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { throw new IllegalArgumentException("Mode cannot be null"); } diff --git a/patches/server/0668-Add-PlayerKickEvent-causes.patch b/patches/server/0668-Add-PlayerKickEvent-causes.patch index ecef9afce..fa4f57fe2 100644 --- a/patches/server/0668-Add-PlayerKickEvent-causes.patch +++ b/patches/server/0668-Add-PlayerKickEvent-causes.patch @@ -342,10 +342,10 @@ index f61c31a028c286399f0921c516b5d94ad52f88b5..13f68b8d241a0b2532a1bd9d9554d2e6 // CraftBukkit end diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index faf75252015d3852578c4ff047082a269f728592..c43e12f1f4e940fac2a070fd45f3f91f862c35ba 100644 +index edaf40cfe543ff7aeb356559dedc17620fd52056..c4e979055c54f147dd7e01b120de00bb5338bede 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -502,16 +502,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -503,16 +503,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player { org.spigotmc.AsyncCatcher.catchOp("player kick"); // Spigot if (this.getHandle().connection == null) return; diff --git a/patches/server/0671-Synchronize-PalettedContainer-instead-of-ReentrantLo.patch b/patches/server/0671-Synchronize-PalettedContainer-instead-of-ReentrantLo.patch index 5d4a0e1e8..6fd4dcb05 100644 --- a/patches/server/0671-Synchronize-PalettedContainer-instead-of-ReentrantLo.patch +++ b/patches/server/0671-Synchronize-PalettedContainer-instead-of-ReentrantLo.patch @@ -13,10 +13,10 @@ contention situations. And this is extremely a low contention situation. 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 d030baca9dd3c34d14653094c139d853c67ac332..bd003e980ac0fe8c4e4b5df5b4002ae3ada39862 100644 +index 71fbb476ad081424cc8807c01818f332887ae366..ec285516c2c403b65b2446f20b187628539d96a6 100644 --- a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java +++ b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java -@@ -35,15 +35,15 @@ public class PalettedContainer implements PaletteResize { +@@ -34,15 +34,15 @@ public class PalettedContainer implements PaletteResize { private final ThreadingDetector threadingDetector = new ThreadingDetector("PalettedContainer"); public void acquire() { @@ -35,7 +35,7 @@ index d030baca9dd3c34d14653094c139d853c67ac332..bd003e980ac0fe8c4e4b5df5b4002ae3 return instance.group(entryCodec.mapResult(ExtraCodecs.orElsePartial(object)).listOf().fieldOf("palette").forGetter(PalettedContainer.DiscData::paletteEntries), Codec.LONG_STREAM.optionalFieldOf("data").forGetter(PalettedContainer.DiscData::storage)).apply(instance, PalettedContainer.DiscData::new); }).comapFlatMap((serialized) -> { return read(idList, provider, serialized); -@@ -85,7 +85,7 @@ public class PalettedContainer implements PaletteResize { +@@ -84,7 +84,7 @@ public class PalettedContainer implements PaletteResize { return data2.palette.idFor(object); } @@ -44,7 +44,7 @@ index d030baca9dd3c34d14653094c139d853c67ac332..bd003e980ac0fe8c4e4b5df5b4002ae3 this.acquire(); Object var5; -@@ -108,7 +108,7 @@ public class PalettedContainer implements PaletteResize { +@@ -107,7 +107,7 @@ public class PalettedContainer implements PaletteResize { return this.data.palette.valueFor(j); } @@ -53,7 +53,7 @@ index d030baca9dd3c34d14653094c139d853c67ac332..bd003e980ac0fe8c4e4b5df5b4002ae3 this.acquire(); try { -@@ -142,7 +142,7 @@ public class PalettedContainer implements PaletteResize { +@@ -141,7 +141,7 @@ public class PalettedContainer implements PaletteResize { }); } @@ -62,7 +62,7 @@ index d030baca9dd3c34d14653094c139d853c67ac332..bd003e980ac0fe8c4e4b5df5b4002ae3 this.acquire(); try { -@@ -157,7 +157,7 @@ public class PalettedContainer implements PaletteResize { +@@ -156,7 +156,7 @@ public class PalettedContainer implements PaletteResize { } @@ -71,7 +71,7 @@ index d030baca9dd3c34d14653094c139d853c67ac332..bd003e980ac0fe8c4e4b5df5b4002ae3 this.acquire(); try { -@@ -168,7 +168,7 @@ public class PalettedContainer implements PaletteResize { +@@ -167,7 +167,7 @@ public class PalettedContainer implements PaletteResize { } @@ -80,7 +80,7 @@ index d030baca9dd3c34d14653094c139d853c67ac332..bd003e980ac0fe8c4e4b5df5b4002ae3 List list = serialized.paletteEntries(); int i = provider.size(); int j = provider.calculateBitsForSerialization(idList, list.size()); -@@ -207,7 +207,7 @@ public class PalettedContainer implements PaletteResize { +@@ -206,7 +206,7 @@ public class PalettedContainer implements PaletteResize { return DataResult.success(new PalettedContainer<>(idList, provider, configuration, bitStorage, list)); } diff --git a/patches/server/0705-Add-PlayerSetSpawnEvent.patch b/patches/server/0705-Add-PlayerSetSpawnEvent.patch index a2c0b45f6..7e196e797 100644 --- a/patches/server/0705-Add-PlayerSetSpawnEvent.patch +++ b/patches/server/0705-Add-PlayerSetSpawnEvent.patch @@ -67,7 +67,7 @@ index 2607dc36e0bd7a915afb0cc9e0f453a2b301c0bd..ea724b1781ea256c991fe47aa044183e this.respawnPosition = pos; diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index f135c9011801c07d1c3aaa326f49bc6018ad8727..bacfdafadaff4ab11fdc91b6a2614ca1dfb65596 100644 +index 932598d92e24521fed11d7236d87f34703b7bdd4..92a3df6d2435d8800a8173e7be3ba11577f23b5a 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -891,7 +891,7 @@ public abstract class PlayerList { @@ -93,10 +93,10 @@ index d620f559cdd1bd0e161a99123ef6c6f64e3302df..07e893f1859abe3c2a765694c21309d6 return InteractionResult.SUCCESS; } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index c43e12f1f4e940fac2a070fd45f3f91f862c35ba..bc529afc8aff97b620209332aa2a4c8111075d62 100644 +index c4e979055c54f147dd7e01b120de00bb5338bede..2ebeb2ab175cd93f7adc9f4ed923831e37481b8f 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1087,9 +1087,9 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1088,9 +1088,9 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public void setBedSpawnLocation(Location location, boolean override) { if (location == null) { diff --git a/patches/server/0736-Make-CallbackExecutor-strict-again.patch b/patches/server/0736-Make-CallbackExecutor-strict-again.patch index 54594efbd..4e4f0003f 100644 --- a/patches/server/0736-Make-CallbackExecutor-strict-again.patch +++ b/patches/server/0736-Make-CallbackExecutor-strict-again.patch @@ -10,10 +10,10 @@ schedules. Effectively, use the callback executor as a tool of finding issues rather than hiding these issues. diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index b75ad5ee074489e3c66ef6524106241c6d577916..75de80747ecd26c5cb91e6be25cada16aa206b8b 100644 +index d9f6d47629f2f4aa1db5a19b8cb7229a0905b75e..dec387e56928fa9b07a183e3055489dfe3dd94fe 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -159,17 +159,28 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -160,17 +160,28 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider public final CallbackExecutor callbackExecutor = new CallbackExecutor(); public static final class CallbackExecutor implements java.util.concurrent.Executor, Runnable { diff --git a/patches/server/0739-Correctly-handle-recursion-for-chunkholder-updates.patch b/patches/server/0739-Correctly-handle-recursion-for-chunkholder-updates.patch index a1ab43360..3cfb006b2 100644 --- a/patches/server/0739-Correctly-handle-recursion-for-chunkholder-updates.patch +++ b/patches/server/0739-Correctly-handle-recursion-for-chunkholder-updates.patch @@ -8,10 +8,10 @@ cause a recursive call which would handle the increase but then the caller would think the chunk would be unloaded. diff --git a/src/main/java/net/minecraft/server/level/ChunkHolder.java b/src/main/java/net/minecraft/server/level/ChunkHolder.java -index b493769dd420f0dd93fdf8184c452c53cb63e95b..75166c2db7e86c54787a085c6a58762b30bc2863 100644 +index 874c99cdb8ea57c7ba986dd1cbd43bedbff30260..b6445778a023531774784f1a6e569849dda4c8ce 100644 --- a/src/main/java/net/minecraft/server/level/ChunkHolder.java +++ b/src/main/java/net/minecraft/server/level/ChunkHolder.java -@@ -428,8 +428,10 @@ public class ChunkHolder { +@@ -438,8 +438,10 @@ public class ChunkHolder { playerchunkmap.onFullChunkStatusChange(this.pos, playerchunk_state); } @@ -22,7 +22,7 @@ index b493769dd420f0dd93fdf8184c452c53cb63e95b..75166c2db7e86c54787a085c6a58762b ChunkStatus chunkstatus = ChunkHolder.getStatus(this.oldTicketLevel); ChunkStatus chunkstatus1 = ChunkHolder.getStatus(this.ticketLevel); boolean flag = this.oldTicketLevel <= ChunkMap.MAX_CHUNK_DISTANCE; -@@ -471,6 +473,12 @@ public class ChunkHolder { +@@ -481,6 +483,12 @@ public class ChunkHolder { // Run callback right away if the future was already done chunkStorage.callbackExecutor.run(); diff --git a/patches/server/0741-Fix-chunks-refusing-to-unload-at-low-TPS.patch b/patches/server/0741-Fix-chunks-refusing-to-unload-at-low-TPS.patch index 99d564c3e..f4ea93a3a 100644 --- a/patches/server/0741-Fix-chunks-refusing-to-unload-at-low-TPS.patch +++ b/patches/server/0741-Fix-chunks-refusing-to-unload-at-low-TPS.patch @@ -10,10 +10,10 @@ chunk future to complete. We can simply schedule to the immediate executor to get this effect, rather than the main mailbox. diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index 75de80747ecd26c5cb91e6be25cada16aa206b8b..1667e1074294cc3d1d286066917555289234a33d 100644 +index dec387e56928fa9b07a183e3055489dfe3dd94fe..e106583bbd3268e48b485019e5b6a80f36aa161e 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -1286,9 +1286,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1297,9 +1297,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider return chunk; }); diff --git a/patches/server/0742-Do-not-allow-ticket-level-changes-while-unloading-pl.patch b/patches/server/0742-Do-not-allow-ticket-level-changes-while-unloading-pl.patch index 2591b6346..476788236 100644 --- a/patches/server/0742-Do-not-allow-ticket-level-changes-while-unloading-pl.patch +++ b/patches/server/0742-Do-not-allow-ticket-level-changes-while-unloading-pl.patch @@ -8,10 +8,10 @@ Sync loading the chunk at this stage would cause it to load older data, as well as screwing our region state. diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index 1667e1074294cc3d1d286066917555289234a33d..8a890c17521049a79295e180538451ba4f2b7fc1 100644 +index e106583bbd3268e48b485019e5b6a80f36aa161e..ba7cd04b33fcaea7e7cea43b5929df56e130bf3f 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -295,6 +295,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -296,6 +296,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } // Paper end @@ -19,7 +19,7 @@ index 1667e1074294cc3d1d286066917555289234a33d..8a890c17521049a79295e180538451ba public ChunkMap(ServerLevel world, LevelStorageSource.LevelStorageAccess session, DataFixer dataFixer, StructureManager structureManager, Executor executor, BlockableEventLoop mainThreadExecutor, LightChunkGetter chunkProvider, ChunkGenerator chunkGenerator, ChunkProgressListener worldGenerationProgressListener, ChunkStatusUpdateListener chunkStatusChangeListener, Supplier persistentStateManagerFactory, int viewDistance, boolean dsync) { super(session.getDimensionPath(world.dimension()).resolve("region"), dataFixer, dsync); this.visibleChunkMap = this.updatingChunkMap.clone(); -@@ -679,6 +680,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -690,6 +691,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @Nullable ChunkHolder updateChunkScheduling(long pos, int level, @Nullable ChunkHolder holder, int k) { @@ -27,7 +27,7 @@ index 1667e1074294cc3d1d286066917555289234a33d..8a890c17521049a79295e180538451ba if (k > ChunkMap.MAX_CHUNK_DISTANCE && level > ChunkMap.MAX_CHUNK_DISTANCE) { return holder; } else { -@@ -897,6 +899,12 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -908,6 +910,12 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider if (completablefuture1 != completablefuture) { this.scheduleUnload(pos, holder); } else { @@ -40,7 +40,7 @@ index 1667e1074294cc3d1d286066917555289234a33d..8a890c17521049a79295e180538451ba // Paper start boolean removed; if ((removed = this.pendingUnloads.remove(pos, holder)) && ichunkaccess != null) { -@@ -933,6 +941,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -944,6 +952,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider this.regionManagers.get(index).removeChunk(holder.pos.x, holder.pos.z); } } // Paper end diff --git a/patches/server/0743-Do-not-allow-ticket-level-changes-when-updating-chun.patch b/patches/server/0743-Do-not-allow-ticket-level-changes-when-updating-chun.patch index 5cfc1dab0..65687508d 100644 --- a/patches/server/0743-Do-not-allow-ticket-level-changes-when-updating-chun.patch +++ b/patches/server/0743-Do-not-allow-ticket-level-changes-when-updating-chun.patch @@ -8,10 +8,10 @@ This WILL cause state corruption if it happens. So, don't allow it. diff --git a/src/main/java/net/minecraft/server/level/ChunkHolder.java b/src/main/java/net/minecraft/server/level/ChunkHolder.java -index 75166c2db7e86c54787a085c6a58762b30bc2863..223f6e0dd7df135f0d15fc8a9e78cb426cda911d 100644 +index b6445778a023531774784f1a6e569849dda4c8ce..c70e1018c5e5b65911ee430be123e38f03666df2 100644 --- a/src/main/java/net/minecraft/server/level/ChunkHolder.java +++ b/src/main/java/net/minecraft/server/level/ChunkHolder.java -@@ -408,7 +408,13 @@ public class ChunkHolder { +@@ -418,7 +418,13 @@ public class ChunkHolder { CompletableFuture completablefuture1 = new CompletableFuture(); completablefuture1.thenRunAsync(() -> { @@ -25,7 +25,7 @@ index 75166c2db7e86c54787a085c6a58762b30bc2863..223f6e0dd7df135f0d15fc8a9e78cb42 }, executor); this.pendingFullStateConfirmation = completablefuture1; completablefuture.thenAccept((either) -> { -@@ -425,7 +431,12 @@ public class ChunkHolder { +@@ -435,7 +441,12 @@ public class ChunkHolder { private void demoteFullChunk(ChunkMap playerchunkmap, ChunkHolder.FullChunkStatus playerchunk_state) { this.pendingFullStateConfirmation.cancel(false); diff --git a/patches/server/0752-Do-not-copy-visible-chunks.patch b/patches/server/0752-Do-not-copy-visible-chunks.patch index b3a1f21d6..3042f4211 100644 --- a/patches/server/0752-Do-not-copy-visible-chunks.patch +++ b/patches/server/0752-Do-not-copy-visible-chunks.patch @@ -35,10 +35,10 @@ index 35949e9c15eb998aa89842d34d0999cd973590e0..15f0c85ba9f4f9666e94e67dde43eb2e List allChunks = new ArrayList<>(visibleChunks.values()); List players = world.players; diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index 6ade79dba07435f3ccc19554e48574bb3bcb2f9c..594f5f3303c21439707f70426baa900af6d94a04 100644 +index ba7cd04b33fcaea7e7cea43b5929df56e130bf3f..72c769d627779224091660c44ccd2ba40796bb58 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -119,9 +119,11 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -120,9 +120,11 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider private static final int MIN_VIEW_DISTANCE = 3; public static final int MAX_VIEW_DISTANCE = 33; public static final int MAX_CHUNK_DISTANCE = 33 + ChunkStatus.maxDistance(); @@ -52,7 +52,7 @@ index 6ade79dba07435f3ccc19554e48574bb3bcb2f9c..594f5f3303c21439707f70426baa900a private final Long2ObjectLinkedOpenHashMap pendingUnloads; public final LongSet entitiesInLevel; public final ServerLevel level; -@@ -298,7 +300,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -299,7 +301,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider boolean unloadingPlayerChunk = false; // Paper - do not allow ticket level changes while unloading chunks public ChunkMap(ServerLevel world, LevelStorageSource.LevelStorageAccess session, DataFixer dataFixer, StructureManager structureManager, Executor executor, BlockableEventLoop mainThreadExecutor, LightChunkGetter chunkProvider, ChunkGenerator chunkGenerator, ChunkProgressListener worldGenerationProgressListener, ChunkStatusUpdateListener chunkStatusChangeListener, Supplier persistentStateManagerFactory, int viewDistance, boolean dsync) { super(session.getDimensionPath(world.dimension()).resolve("region"), dataFixer, dsync); @@ -61,7 +61,7 @@ index 6ade79dba07435f3ccc19554e48574bb3bcb2f9c..594f5f3303c21439707f70426baa900a this.pendingUnloads = new Long2ObjectLinkedOpenHashMap(); this.entitiesInLevel = new LongOpenHashSet(); this.toDrop = new LongOpenHashSet(); -@@ -553,12 +555,17 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -554,12 +556,17 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @Nullable public ChunkHolder getUpdatingChunkIfPresent(long pos) { @@ -81,7 +81,7 @@ index 6ade79dba07435f3ccc19554e48574bb3bcb2f9c..594f5f3303c21439707f70426baa900a } protected IntSupplier getChunkQueueLevel(long pos) { -@@ -710,7 +717,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -721,7 +728,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider // Paper end } @@ -90,7 +90,7 @@ index 6ade79dba07435f3ccc19554e48574bb3bcb2f9c..594f5f3303c21439707f70426baa900a this.modified = true; } -@@ -790,7 +797,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -801,7 +808,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider protected void saveAllChunks(boolean flush) { if (flush) { @@ -99,7 +99,7 @@ index 6ade79dba07435f3ccc19554e48574bb3bcb2f9c..594f5f3303c21439707f70426baa900a MutableBoolean mutableboolean = new MutableBoolean(); do { -@@ -821,7 +828,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -832,7 +839,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider //this.flushWorker(); // Paper - nuke IOWorker this.level.asyncChunkTaskManager.flush(); // Paper - flush to preserve behavior compat with pre-async behaviour } else { @@ -108,7 +108,7 @@ index 6ade79dba07435f3ccc19554e48574bb3bcb2f9c..594f5f3303c21439707f70426baa900a } } -@@ -855,7 +862,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -866,7 +873,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider while (longiterator.hasNext()) { // Spigot long j = longiterator.nextLong(); longiterator.remove(); // Spigot @@ -117,7 +117,7 @@ index 6ade79dba07435f3ccc19554e48574bb3bcb2f9c..594f5f3303c21439707f70426baa900a if (playerchunk != null) { this.pendingUnloads.put(j, playerchunk); -@@ -881,7 +888,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -892,7 +899,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } int l = 0; @@ -126,7 +126,7 @@ index 6ade79dba07435f3ccc19554e48574bb3bcb2f9c..594f5f3303c21439707f70426baa900a while (false && l < 20 && shouldKeepTicking.getAsBoolean() && objectiterator.hasNext()) { // Paper - incremental chunk and player saving if (this.saveChunkIfNeeded((ChunkHolder) objectiterator.next())) { -@@ -960,7 +967,12 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -971,7 +978,12 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider if (!this.modified) { return false; } else { @@ -140,7 +140,7 @@ index 6ade79dba07435f3ccc19554e48574bb3bcb2f9c..594f5f3303c21439707f70426baa900a this.modified = false; return true; } -@@ -1444,7 +1456,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1449,7 +1461,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider this.viewDistance = j; this.distanceManager.updatePlayerTickets(this.viewDistance); @@ -149,7 +149,7 @@ index 6ade79dba07435f3ccc19554e48574bb3bcb2f9c..594f5f3303c21439707f70426baa900a while (objectiterator.hasNext()) { ChunkHolder playerchunk = (ChunkHolder) objectiterator.next(); -@@ -1486,7 +1498,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1491,7 +1503,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } public int size() { @@ -158,7 +158,7 @@ index 6ade79dba07435f3ccc19554e48574bb3bcb2f9c..594f5f3303c21439707f70426baa900a } public DistanceManager getDistanceManager() { -@@ -1494,13 +1506,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1499,13 +1511,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } protected Iterable getChunks() { diff --git a/patches/server/0769-Oprimise-map-impl-for-tracked-players.patch b/patches/server/0769-Oprimise-map-impl-for-tracked-players.patch index ee2bde265..f0744df77 100644 --- a/patches/server/0769-Oprimise-map-impl-for-tracked-players.patch +++ b/patches/server/0769-Oprimise-map-impl-for-tracked-players.patch @@ -7,10 +7,10 @@ Reference2BooleanOpenHashMap is going to have better lookups than HashMap. diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index 82c46feffefb9b27c793625e392472bcf8e1b54d..edb94ce747afae854fcfa63e08467b18982f6db7 100644 +index 72c769d627779224091660c44ccd2ba40796bb58..bf87cbe80a5119fd06b108722d3968c72c41fe2a 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -107,6 +107,7 @@ import org.apache.logging.log4j.LogManager; +@@ -108,6 +108,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.bukkit.entity.Player; // CraftBukkit end @@ -18,7 +18,7 @@ index 82c46feffefb9b27c793625e392472bcf8e1b54d..edb94ce747afae854fcfa63e08467b18 public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider { -@@ -2131,7 +2132,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -2136,7 +2137,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider final Entity entity; private final int range; SectionPos lastSectionPos; diff --git a/patches/server/0772-Optimise-random-block-ticking.patch b/patches/server/0772-Optimise-random-block-ticking.patch index 9ba04cbaf..eec0d5403 100644 --- a/patches/server/0772-Optimise-random-block-ticking.patch +++ b/patches/server/0772-Optimise-random-block-ticking.patch @@ -71,7 +71,7 @@ index 0000000000000000000000000000000000000000..e8b4053babe46999980b926431254050 + } +} diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index dc9cfa468b92bacfa25437d969b4e4a0f59daade..1c92416c3dc07d2348f092eee663e0226d43c8ba 100644 +index f31d84f0eb65c2754b8622997f404b8cd5ee845d..94ba82b4c7d4a308eec0475d3fe790f0498dbe29 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -639,6 +639,10 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -388,10 +388,10 @@ index f9e871cff9318e6fea92d5b7a7035b3bfa259bca..c579be24944b310151738d375c53e2d5 } 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 bd003e980ac0fe8c4e4b5df5b4002ae3ada39862..283622b3657e0a5c0b1da9c4b234924d64c867bb 100644 +index ec285516c2c403b65b2446f20b187628539d96a6..dea80ddba894453a0229888adfa235638cc9f659 100644 --- a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java +++ b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java -@@ -283,6 +283,14 @@ public class PalettedContainer implements PaletteResize { +@@ -286,6 +286,14 @@ public class PalettedContainer implements PaletteResize { } } diff --git a/patches/server/0774-Optimise-nearby-player-lookups.patch b/patches/server/0774-Optimise-nearby-player-lookups.patch index 1ebfb7ebe..1b2bd0305 100644 --- a/patches/server/0774-Optimise-nearby-player-lookups.patch +++ b/patches/server/0774-Optimise-nearby-player-lookups.patch @@ -9,7 +9,7 @@ since the penalty of a map lookup could outweigh the benefits of searching less players (as it basically did in the outside range patch). diff --git a/src/main/java/net/minecraft/server/level/ChunkHolder.java b/src/main/java/net/minecraft/server/level/ChunkHolder.java -index 223f6e0dd7df135f0d15fc8a9e78cb426cda911d..c3d1adaf7abfafa8e4c5d173c0d2ec40ca655cfb 100644 +index c70e1018c5e5b65911ee430be123e38f03666df2..3e526ba04f52e39591016dc107dd8913220cb343 100644 --- a/src/main/java/net/minecraft/server/level/ChunkHolder.java +++ b/src/main/java/net/minecraft/server/level/ChunkHolder.java @@ -83,6 +83,12 @@ public class ChunkHolder { @@ -26,10 +26,10 @@ index 223f6e0dd7df135f0d15fc8a9e78cb426cda911d..c3d1adaf7abfafa8e4c5d173c0d2ec40 // Paper end - optimise isOutsideOfRange long lastAutoSaveTime; // Paper - incremental autosave diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index edb94ce747afae854fcfa63e08467b18982f6db7..399a98437ea632b8768a7c153dee7723c8499317 100644 +index bf87cbe80a5119fd06b108722d3968c72c41fe2a..f6d5bf3474dbf37095778cd8d774b58338d53877 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -158,6 +158,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -159,6 +159,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider int viewDistance; public final com.destroystokyo.paper.util.PlayerMobDistanceMap playerMobDistanceMap; // Paper @@ -43,7 +43,7 @@ index edb94ce747afae854fcfa63e08467b18982f6db7..399a98437ea632b8768a7c153dee7723 // CraftBukkit start - recursion-safe executor for Chunk loadCallback() and unloadCallback() public final CallbackExecutor callbackExecutor = new CallbackExecutor(); public static final class CallbackExecutor implements java.util.concurrent.Executor, Runnable { -@@ -238,6 +245,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -239,6 +246,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider this.playerChunkTickRangeMap.update(player, chunkX, chunkZ, DistanceManager.MOB_SPAWN_RANGE); this.playerChunkTickRangeMap.add(player, chunkX, chunkZ, DistanceManager.MOB_SPAWN_RANGE); // Paper end - optimise PlayerChunkMap#isOutsideRange @@ -51,7 +51,7 @@ index edb94ce747afae854fcfa63e08467b18982f6db7..399a98437ea632b8768a7c153dee7723 } void removePlayerFromDistanceMaps(ServerPlayer player) { -@@ -250,6 +258,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -251,6 +259,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider this.playerMobSpawnMap.remove(player); this.playerChunkTickRangeMap.remove(player); // Paper end - optimise PlayerChunkMap#isOutsideRange @@ -59,7 +59,7 @@ index edb94ce747afae854fcfa63e08467b18982f6db7..399a98437ea632b8768a7c153dee7723 } void updateMaps(ServerPlayer player) { -@@ -265,6 +274,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -266,6 +275,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } // Paper end - use distance map to optimise entity tracker this.playerChunkTickRangeMap.update(player, chunkX, chunkZ, DistanceManager.MOB_SPAWN_RANGE); // Paper - optimise PlayerChunkMap#isOutsideRange @@ -67,7 +67,7 @@ index edb94ce747afae854fcfa63e08467b18982f6db7..399a98437ea632b8768a7c153dee7723 } // Paper end // Paper start -@@ -420,6 +430,23 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -421,6 +431,23 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } }); // Paper end - optimise PlayerChunkMap#isOutsideRange diff --git a/patches/server/0775-Optimise-WorldServer-notify.patch b/patches/server/0775-Optimise-WorldServer-notify.patch index 54f02d8d8..4dd1785af 100644 --- a/patches/server/0775-Optimise-WorldServer-notify.patch +++ b/patches/server/0775-Optimise-WorldServer-notify.patch @@ -8,10 +8,10 @@ Instead, only iterate over navigators in the current region that are eligible for repathing. diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index 399a98437ea632b8768a7c153dee7723c8499317..0b8a222e88794a4c54fc0010842b46a5df800068 100644 +index f6d5bf3474dbf37095778cd8d774b58338d53877..a3f3015f9eba9a2eccbc3f1f64bca4c66d52b9f2 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -282,15 +282,81 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -283,15 +283,81 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider public final io.papermc.paper.chunk.SingleThreadChunkRegionManager dataRegionManager; public static final class DataRegionData implements io.papermc.paper.chunk.SingleThreadChunkRegionManager.RegionData { @@ -93,7 +93,7 @@ index 399a98437ea632b8768a7c153dee7723c8499317..0b8a222e88794a4c54fc0010842b46a5 } @Override -@@ -300,6 +366,15 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -301,6 +367,15 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider final DataRegionSectionData sectionData = (DataRegionSectionData)section.sectionData; final DataRegionData oldRegionData = oldRegion == null ? null : (DataRegionData)oldRegion.regionData; final DataRegionData newRegionData = (DataRegionData)newRegion.regionData; diff --git a/patches/server/0793-Do-not-overload-I-O-threads-with-chunk-data-while-fl.patch b/patches/server/0793-Do-not-overload-I-O-threads-with-chunk-data-while-fl.patch index 50bd45e23..443f7b493 100644 --- a/patches/server/0793-Do-not-overload-I-O-threads-with-chunk-data-while-fl.patch +++ b/patches/server/0793-Do-not-overload-I-O-threads-with-chunk-data-while-fl.patch @@ -12,10 +12,10 @@ time to save, as flush saving performs a full flush at the end anyways. diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index 0b8a222e88794a4c54fc0010842b46a5df800068..8dbbb09cac61da0d252974f2df85ce6aa655a853 100644 +index a3f3015f9eba9a2eccbc3f1f64bca4c66d52b9f2..7c4154b1b5ccc53af5f5fb186c2a5d1ff88c7af1 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -899,6 +899,16 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -910,6 +910,16 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider // Paper end protected void saveAllChunks(boolean flush) { @@ -32,7 +32,7 @@ index 0b8a222e88794a4c54fc0010842b46a5df800068..8dbbb09cac61da0d252974f2df85ce6a if (flush) { List list = (List) this.updatingChunks.getVisibleValuesCopy().stream().filter(ChunkHolder::wasAccessibleSinceLastSave).peek(ChunkHolder::refreshAccessibility).collect(Collectors.toList()); // Paper MutableBoolean mutableboolean = new MutableBoolean(); -@@ -921,6 +931,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -932,6 +942,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider }).filter((ichunkaccess) -> { return ichunkaccess instanceof ImposterProtoChunk || ichunkaccess instanceof LevelChunk; }).filter(this::save).forEach((ichunkaccess) -> { diff --git a/work/BuildData b/work/BuildData index 09c3da501..403e1fc44 160000 --- a/work/BuildData +++ b/work/BuildData @@ -1 +1 @@ -Subproject commit 09c3da501e40b5090cbd93cc91c8e5c49ce053b7 +Subproject commit 403e1fc440fdc9eeb6e854e6db1c1974034fccab diff --git a/work/Bukkit b/work/Bukkit index d25437bce..716b4fce8 160000 --- a/work/Bukkit +++ b/work/Bukkit @@ -1 +1 @@ -Subproject commit d25437bce34e0cb0b7c895867183dc949ea41667 +Subproject commit 716b4fce8443809ed39119dbffdd21c04fcea04a diff --git a/work/CraftBukkit b/work/CraftBukkit index 5a39a236c..c98abfb0f 160000 --- a/work/CraftBukkit +++ b/work/CraftBukkit @@ -1 +1 @@ -Subproject commit 5a39a236c11b6a5a19f8d26b4c5af1f59f16d447 +Subproject commit c98abfb0ff79f77e91a4116bd7df47495bf81162 diff --git a/work/Spigot b/work/Spigot index 7840c2af5..b7a4222ea 160000 --- a/work/Spigot +++ b/work/Spigot @@ -1 +1 @@ -Subproject commit 7840c2af5f487981d5a2eab4f9e832fdd7cfb298 +Subproject commit b7a4222eac8fe8634946023cbba965187f568d07