From 31ad90b0181d25184e9e6cf1b0b2f4740386b1df Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Thu, 25 Apr 2024 18:51:28 -0700 Subject: [PATCH] some more compile fixes --- patches/server/0010-Adventure.patch | 19 ++++---- patches/server/0025-Timings-v2.patch | 4 +- .../0040-Player-affects-spawning-API.patch | 2 +- ...041-Only-refresh-abilities-if-needed.patch | 2 +- ...54-Implement-PlayerLocaleChangeEvent.patch | 2 +- ...061-Improve-Player-chat-API-handling.patch | 2 +- .../0065-Player-Tab-List-and-Title-APIs.patch | 2 +- ...ble-inter-world-teleportation-safety.patch | 2 +- .../0073-Complete-resource-pack-API.patch | 2 +- ...th-absorb-values-and-repair-bad-data.patch | 2 +- ...able-API-and-replenishable-lootables.patch | 21 +++++---- .../0126-String-based-Action-Bar-API.patch | 2 +- ...nt-protocol-version-and-virtual-host.patch | 2 +- ...0-Ability-to-apply-mending-to-XP-API.patch | 2 +- .../0183-Player.setPlayerProfile-API.patch | 2 +- ...88-Flag-to-disable-the-channel-limit.patch | 2 +- .../0215-InventoryCloseEvent-Reason-API.patch | 2 +- ...e-attack-cooldown-methods-for-Player.patch | 4 +- .../server/0250-Improve-death-events.patch | 2 +- ...-Replace-OfflinePlayer-getLastPlayed.patch | 2 +- ...r-remove-if-the-handle-is-a-custom-p.patch | 2 +- ...-Implement-Player-Client-Options-API.patch | 2 +- patches/server/0407-Brand-support.patch | 4 +- ...r-spawnParticle-x-y-z-precision-loss.patch | 2 +- patches/server/0487-Add-sendOpLevel-API.patch | 2 +- ...550-Expand-PlayerGameModeChangeEvent.patch | 2 +- .../0562-Add-PlayerKickEvent-causes.patch | 2 +- .../0575-Add-more-LimitedRegion-API.patch | 4 +- .../server/0591-Add-PlayerSetSpawnEvent.patch | 2 +- ...ulti-Block-Change-API-Implementation.patch | 2 +- .../0679-More-PotionEffectType-API.patch | 12 ++--- ...d-missing-structure-set-seed-configs.patch | 34 ++++++++++++++ patches/server/0699-More-Projectile-API.patch | 47 ++++++++++--------- .../0702-Implement-getComputedBiome-API.patch | 2 +- ...shPotion-and-LingeringPotion-spawnin.patch | 2 +- patches/server/0746-More-Teleport-API.patch | 2 +- ...stom-Chat-Completion-Suggestions-API.patch | 2 +- ...ook-changes-from-crashing-the-server.patch | 2 +- .../0777-Elder-Guardian-appearance-API.patch | 4 +- .../0791-Add-Player-Warden-Warning-API.patch | 4 +- patches/server/0804-fix-Instruments.patch | 2 +- patches/server/0814-Flying-Fall-Damage.patch | 2 +- patches/server/0820-Win-Screen-API.patch | 2 +- .../0846-Expand-PlayerItemMendEvent.patch | 2 +- ...esh-ProjectileSource-for-projectiles.patch | 4 +- ...apLike-spam-for-missing-key-selector.patch | 4 +- patches/server/0866-Fix-BanList-API.patch | 2 +- .../server/0885-Bandaid-fix-for-Effect.patch | 2 +- .../0893-Add-Listing-API-for-Player.patch | 2 +- ...-Implement-OfflinePlayer-isConnected.patch | 2 +- .../0923-Add-player-idle-duration-API.patch | 4 +- ...stack-for-Player-sendEquipmentChange.patch | 2 +- .../0947-Add-experience-points-API.patch | 2 +- .../0952-Fixup-NamespacedKey-handling.patch | 16 +++---- ...953-Expose-LootTable-of-DecoratedPot.patch | 8 ++-- patches/server/0961-Add-FluidState-API.patch | 2 +- .../0980-Rewrite-dataconverter-system.patch | 4 +- .../server/0985-Rewrite-chunk-system.patch | 14 +++--- .../1024-Properly-resend-entities.patch | 4 +- .../1035-API-for-checking-sent-chunks.patch | 4 +- 60 files changed, 171 insertions(+), 128 deletions(-) diff --git a/patches/server/0010-Adventure.patch b/patches/server/0010-Adventure.patch index a9cff2ccf8..75ecfafed9 100644 --- a/patches/server/0010-Adventure.patch +++ b/patches/server/0010-Adventure.patch @@ -3608,7 +3608,7 @@ index f9b89a7c6ac9f7fdbd29567a5b6550398dbc7345..2789d29f5be041a550618d455bb8912e + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftContainer.java b/src/main/java/org/bukkit/craftbukkit/block/CraftContainer.java -index 007b6d66dd837ca6352c0fba5c2399139f6b5425..a1cfddbcabe719121dfe6c960e65dc0ffd0d6de9 100644 +index 007b6d66dd837ca6352c0fba5c2399139f6b5425..513402b61e6b8388b7bc163d98e54ffae0e18254 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftContainer.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftContainer.java @@ -32,6 +32,19 @@ public abstract class CraftContainer extends @@ -3624,7 +3624,7 @@ index 007b6d66dd837ca6352c0fba5c2399139f6b5425..a1cfddbcabe719121dfe6c960e65dc0f + + @Override + public void customName(final net.kyori.adventure.text.Component customName) { -+ this.getSnapshot().setCustomName(customName != null ? io.papermc.paper.adventure.PaperAdventure.asVanilla(customName) : null); ++ this.getSnapshot().name = (customName != null ? io.papermc.paper.adventure.PaperAdventure.asVanilla(customName) : null); + } + // Paper end + @@ -3632,7 +3632,7 @@ index 007b6d66dd837ca6352c0fba5c2399139f6b5425..a1cfddbcabe719121dfe6c960e65dc0f public String getCustomName() { T container = this.getSnapshot(); diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftEnchantingTable.java b/src/main/java/org/bukkit/craftbukkit/block/CraftEnchantingTable.java -index 690dd79b82108322a290c00de63b1f038f617c84..0854b803b29212ef761536e99c9d9e7d04ea194b 100644 +index 690dd79b82108322a290c00de63b1f038f617c84..a01691f98a378a818b8bf12176c7270e15c316d8 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftEnchantingTable.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftEnchantingTable.java @@ -16,6 +16,19 @@ public class CraftEnchantingTable extends CraftBlockEntityState chatTypeRegistry = this.getHandle().level().registryAccess().registryOrThrow(net.minecraft.core.registries.Registries.CHAT_TYPE); + + return new net.minecraft.network.chat.ChatType.Bound( -+ chatTypeRegistry.get(io.papermc.paper.adventure.PaperAdventure.asVanilla(boundChatType.type().key())), ++ chatTypeRegistry.getHolderOrThrow(net.minecraft.resources.ResourceKey.create(net.minecraft.core.registries.Registries.CHAT_TYPE, io.papermc.paper.adventure.PaperAdventure.asVanilla(boundChatType.type().key()))), + io.papermc.paper.adventure.PaperAdventure.asVanilla(boundChatType.name()), -+ io.papermc.paper.adventure.PaperAdventure.asVanilla(boundChatType.target()) ++ Optional.ofNullable(io.papermc.paper.adventure.PaperAdventure.asVanilla(boundChatType.target())) + ); + } + @@ -4400,8 +4400,7 @@ index 13c3ac65f26e6cfc55ee3538b6308ef93f9936aa..09293673061edc99d38933d2e4f1a8c0 + + @Override + public void sendActionBar(final net.kyori.adventure.text.Component message) { -+ final net.minecraft.network.protocol.game.ClientboundSetActionBarTextPacket packet = new net.minecraft.network.protocol.game.ClientboundSetActionBarTextPacket((net.minecraft.network.chat.Component) null); -+ packet.adventure$text = message; ++ final net.minecraft.network.protocol.game.ClientboundSetActionBarTextPacket packet = new net.minecraft.network.protocol.game.ClientboundSetActionBarTextPacket(io.papermc.paper.adventure.PaperAdventure.asVanillaNullToEmpty(message)); + this.getHandle().connection.send(packet); + } + diff --git a/patches/server/0025-Timings-v2.patch b/patches/server/0025-Timings-v2.patch index dbeba37ef4..e82b379523 100644 --- a/patches/server/0025-Timings-v2.patch +++ b/patches/server/0025-Timings-v2.patch @@ -1805,10 +1805,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 09293673061edc99d38933d2e4f1a8c0e3f9dac0..8342d0cb6b54c4f21b70ed005aec3ae09b9a2697 100644 +index 0b15c8a3906221ef09261f3d42c0aa93de8c5570..27909f2aa7c1e56ae4fd4fe23678d45da5fba9cf 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2763,6 +2763,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2762,6 +2762,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player { CraftPlayer.this.getHandle().connection.send(new net.minecraft.network.protocol.game.ClientboundSystemChatPacket(components, position == net.md_5.bungee.api.ChatMessageType.ACTION_BAR)); } diff --git a/patches/server/0040-Player-affects-spawning-API.patch b/patches/server/0040-Player-affects-spawning-API.patch index 8eb031e835..da0e19a5dc 100644 --- a/patches/server/0040-Player-affects-spawning-API.patch +++ b/patches/server/0040-Player-affects-spawning-API.patch @@ -135,7 +135,7 @@ index f38f62e777d88a783e1e3b7e1a48da921cc67cf4..77ae7882a08441d9a80b50492be5e484 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 8342d0cb6b54c4f21b70ed005aec3ae09b9a2697..e0737fd20fd0e292cf43c50633a68b061e5743bf 100644 +index 27909f2aa7c1e56ae4fd4fe23678d45da5fba9cf..77d62778ba5b7ff0af3234ac9bd6f6161881c028 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -2405,6 +2405,17 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/patches/server/0041-Only-refresh-abilities-if-needed.patch b/patches/server/0041-Only-refresh-abilities-if-needed.patch index 8a80f02da4..b49e75f193 100644 --- a/patches/server/0041-Only-refresh-abilities-if-needed.patch +++ b/patches/server/0041-Only-refresh-abilities-if-needed.patch @@ -5,7 +5,7 @@ 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 e0737fd20fd0e292cf43c50633a68b061e5743bf..bae02f826767f6eca80a56e610c16a555673d856 100644 +index 77d62778ba5b7ff0af3234ac9bd6f6161881c028..adf76abd693d8cfba76a18d46fcd672fecd52f7e 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -2082,12 +2082,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/patches/server/0054-Implement-PlayerLocaleChangeEvent.patch b/patches/server/0054-Implement-PlayerLocaleChangeEvent.patch index 3417a486e9..039776ed1c 100644 --- a/patches/server/0054-Implement-PlayerLocaleChangeEvent.patch +++ b/patches/server/0054-Implement-PlayerLocaleChangeEvent.patch @@ -39,7 +39,7 @@ index d75c3c10dcbd777796e479b9538e5254857ac07c..ab2336a30c1ffc1698c327c031a648d4 // CraftBukkit end this.language = clientOptions.language(); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index bae02f826767f6eca80a56e610c16a555673d856..d2111ebdea4cbed688c6cfe585d63c6d4ef451f4 100644 +index adf76abd693d8cfba76a18d46fcd672fecd52f7e..a7ccce7b5036eb0602e6030be6fbaa9f032f78c2 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -2403,7 +2403,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/patches/server/0061-Improve-Player-chat-API-handling.patch b/patches/server/0061-Improve-Player-chat-API-handling.patch index dc101862d6..9f73bcc555 100644 --- a/patches/server/0061-Improve-Player-chat-API-handling.patch +++ b/patches/server/0061-Improve-Player-chat-API-handling.patch @@ -53,7 +53,7 @@ index b43dae6ed6ebdd1978e35e9d43e07591f90dcb09..4a1305df41c42be65dbb0438066e148e if (this.commandMap.dispatch(sender, commandLine)) { 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 d2111ebdea4cbed688c6cfe585d63c6d4ef451f4..a32d3dfafebc27d3792b12c21ecc8f0b54d918ba 100644 +index a7ccce7b5036eb0602e6030be6fbaa9f032f78c2..a51bce9252328df85b485a5af7786db0622a4672 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -544,7 +544,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/patches/server/0065-Player-Tab-List-and-Title-APIs.patch b/patches/server/0065-Player-Tab-List-and-Title-APIs.patch index abed8a91a5..396ca10a8d 100644 --- a/patches/server/0065-Player-Tab-List-and-Title-APIs.patch +++ b/patches/server/0065-Player-Tab-List-and-Title-APIs.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Player Tab List and Title APIs diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index a32d3dfafebc27d3792b12c21ecc8f0b54d918ba..c3677a72abd6ca5f2a4efd1e736512051d51ee2b 100644 +index a51bce9252328df85b485a5af7786db0622a4672..b53d62754f823c2e41c92a95f200af7c388ed011 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -384,6 +384,98 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/patches/server/0068-Configurable-inter-world-teleportation-safety.patch b/patches/server/0068-Configurable-inter-world-teleportation-safety.patch index 57ac3703f3..2154200454 100644 --- a/patches/server/0068-Configurable-inter-world-teleportation-safety.patch +++ b/patches/server/0068-Configurable-inter-world-teleportation-safety.patch @@ -16,7 +16,7 @@ The wanted destination was on top of the emerald block however the player ended This only is the case if the player is teleporting between worlds. diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index c3677a72abd6ca5f2a4efd1e736512051d51ee2b..0f919096e344e8bbd90ff0937dcd1de32a32763b 100644 +index b53d62754f823c2e41c92a95f200af7c388ed011..392d77e43d5add1fd71f35817435c2b3c6a7a8fa 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -1235,7 +1235,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/patches/server/0073-Complete-resource-pack-API.patch b/patches/server/0073-Complete-resource-pack-API.patch index 466656fb2f..cc03581dff 100644 --- a/patches/server/0073-Complete-resource-pack-API.patch +++ b/patches/server/0073-Complete-resource-pack-API.patch @@ -22,7 +22,7 @@ index 26b8a69a528db8a836b138a2a223c385508ce2c4..5f5d8ae29ff702eacc72341fae074a05 } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 0f919096e344e8bbd90ff0937dcd1de32a32763b..268eaf8493e23c5d3763c6c2d6da0e3f78818fd7 100644 +index 392d77e43d5add1fd71f35817435c2b3c6a7a8fa..9743f5b8b6e1cbbe43788a42c02bb7cfbdd8f380 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -206,6 +206,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/patches/server/0081-handle-NaN-health-absorb-values-and-repair-bad-data.patch b/patches/server/0081-handle-NaN-health-absorb-values-and-repair-bad-data.patch index 5a2ec045a4..56e384c127 100644 --- a/patches/server/0081-handle-NaN-health-absorb-values-and-repair-bad-data.patch +++ b/patches/server/0081-handle-NaN-health-absorb-values-and-repair-bad-data.patch @@ -44,7 +44,7 @@ index 53da8935e076d56f0a5423e5c1bdcdddc7cbd882..f02b12f3853bf4bf29b59a505f06cb98 protected void internalSetAbsorptionAmount(float absorptionAmount) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 268eaf8493e23c5d3763c6c2d6da0e3f78818fd7..4543f060e46791d03c503637e9f17a5d9f10d879 100644 +index 9743f5b8b6e1cbbe43788a42c02bb7cfbdd8f380..d616f6c1fe63e3fe9d811d670dbc78a44e7afcbd 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -2327,6 +2327,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/patches/server/0102-LootTable-API-and-replenishable-lootables.patch b/patches/server/0102-LootTable-API-and-replenishable-lootables.patch index 7525d2714a..b09c92c498 100644 --- a/patches/server/0102-LootTable-API-and-replenishable-lootables.patch +++ b/patches/server/0102-LootTable-API-and-replenishable-lootables.patch @@ -17,12 +17,15 @@ public org.bukkit.craftbukkit.entity.CraftMinecartContainer setLootTable(Lorg/bu diff --git a/src/main/java/com/destroystokyo/paper/loottable/PaperContainerEntityLootableInventory.java b/src/main/java/com/destroystokyo/paper/loottable/PaperContainerEntityLootableInventory.java new file mode 100644 -index 0000000000000000000000000000000000000000..9ca389ca789dc54bba3542cac0aac2e1dc66c870 +index 0000000000000000000000000000000000000000..7f5283a8ee74253e326fe994f20ae00cf3c75e1b --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/loottable/PaperContainerEntityLootableInventory.java -@@ -0,0 +1,63 @@ +@@ -0,0 +1,66 @@ +package com.destroystokyo.paper.loottable; + ++import net.minecraft.Optionull; ++import net.minecraft.core.registries.Registries; ++import net.minecraft.resources.ResourceKey; +import net.minecraft.world.entity.Entity; +import net.minecraft.world.entity.vehicle.AbstractMinecartContainer; +import net.minecraft.world.entity.vehicle.ContainerEntity; @@ -40,7 +43,7 @@ index 0000000000000000000000000000000000000000..9ca389ca789dc54bba3542cac0aac2e1 + + @Override + public org.bukkit.loot.LootTable getLootTable() { -+ return entity.getLootTable() != null ? Bukkit.getLootTable(CraftNamespacedKey.fromMinecraft(entity.getLootTable())) : null; ++ return entity.getLootTable() != null ? Optionull.map(entity.getLootTable(), rk -> Bukkit.getLootTable(CraftNamespacedKey.fromMinecraft(rk.location()))) : null; + } + + @Override @@ -61,7 +64,7 @@ index 0000000000000000000000000000000000000000..9ca389ca789dc54bba3542cac0aac2e1 + + @Override + public void setLootTable(org.bukkit.loot.LootTable table) { -+ entity.setLootTable((table == null) ? null : CraftNamespacedKey.toMinecraft(table.getKey())); ++ entity.setLootTable((table == null) ? null : ResourceKey.create(Registries.LOOT_TABLE, CraftNamespacedKey.toMinecraft(table.getKey()))); + } + + @Override @@ -434,13 +437,15 @@ index 0000000000000000000000000000000000000000..6e72c43b9d3834eb91c02ce68e7d114a +} diff --git a/src/main/java/com/destroystokyo/paper/loottable/PaperTileEntityLootableInventory.java b/src/main/java/com/destroystokyo/paper/loottable/PaperTileEntityLootableInventory.java new file mode 100644 -index 0000000000000000000000000000000000000000..9cfa5d36a6991067a3866e0d437749fafcc0158e +index 0000000000000000000000000000000000000000..fb72bdea520ccc0928cfbda0569e02a1917a7e86 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/loottable/PaperTileEntityLootableInventory.java -@@ -0,0 +1,65 @@ +@@ -0,0 +1,67 @@ +package com.destroystokyo.paper.loottable; + +import io.papermc.paper.util.MCUtil; ++import net.minecraft.core.registries.Registries; ++import net.minecraft.resources.ResourceKey; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.entity.RandomizableContainerBlockEntity; +import org.bukkit.Bukkit; @@ -455,7 +460,7 @@ index 0000000000000000000000000000000000000000..9cfa5d36a6991067a3866e0d437749fa + + @Override + public org.bukkit.loot.LootTable getLootTable() { -+ return tileEntityLootable.lootTable != null ? Bukkit.getLootTable(CraftNamespacedKey.fromMinecraft(tileEntityLootable.lootTable)) : null; ++ return tileEntityLootable.lootTable != null ? Bukkit.getLootTable(CraftNamespacedKey.fromMinecraft(tileEntityLootable.lootTable.location())) : null; + } + + @Override @@ -466,7 +471,7 @@ index 0000000000000000000000000000000000000000..9cfa5d36a6991067a3866e0d437749fa + + @Override + public void setLootTable(org.bukkit.loot.LootTable table) { -+ tileEntityLootable.lootTable = (table == null) ? null : CraftNamespacedKey.toMinecraft(table.getKey()); ++ tileEntityLootable.lootTable = (table == null) ? null : ResourceKey.create(Registries.LOOT_TABLE, CraftNamespacedKey.toMinecraft(table.getKey())); + } + + @Override diff --git a/patches/server/0126-String-based-Action-Bar-API.patch b/patches/server/0126-String-based-Action-Bar-API.patch index 08ca7a8ecc..c6afb32b4d 100644 --- a/patches/server/0126-String-based-Action-Bar-API.patch +++ b/patches/server/0126-String-based-Action-Bar-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] String based Action Bar API diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 4543f060e46791d03c503637e9f17a5d9f10d879..ab1b594cd1af0e966c2a722f2c9003772433be3c 100644 +index d616f6c1fe63e3fe9d811d670dbc78a44e7afcbd..a9922e5f5c19cd6455b6ca9a3db7aa0a42f99524 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -386,6 +386,28 @@ public class CraftPlayer extends CraftHumanEntity implements Player { 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 c66ecd22a5..6f1694b0be 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,7 +90,7 @@ index 9214fb6b8e21ff6aee8be0691f1fe6e41c901ba3..644214cc3a3c8e560b6ce470fe5997e3 @Override diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index ab1b594cd1af0e966c2a722f2c9003772433be3c..7d202f4098e0b63ae0f208c4a882844be567ea73 100644 +index a9922e5f5c19cd6455b6ca9a3db7aa0a42f99524..7e1f6e23980f12786abaa4218d8d77dd1a8feb3c 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -332,6 +332,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 7ea416cb57..4dbdc50fe5 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 @@ -14,7 +14,7 @@ public net.minecraft.world.entity.ExperienceOrb durabilityToXp(I)I public net.minecraft.world.entity.ExperienceOrb xpToDurability(I)I diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 7d202f4098e0b63ae0f208c4a882844be567ea73..97f159fd2f8f616415ef7ce1c18ab95f372d2da1 100644 +index 7e1f6e23980f12786abaa4218d8d77dd1a8feb3c..791b655890ce5b144f8649f687945c17a390ce76 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -1624,7 +1624,37 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/patches/server/0183-Player.setPlayerProfile-API.patch b/patches/server/0183-Player.setPlayerProfile-API.patch index 87ed2840a3..9c4d661771 100644 --- a/patches/server/0183-Player.setPlayerProfile-API.patch +++ b/patches/server/0183-Player.setPlayerProfile-API.patch @@ -77,7 +77,7 @@ index 818df09e9245b5d89b4180b1eaa51470b7539341..461656e1cb095243bfe7a9ee2906e5b0 public Server getServer() { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 97f159fd2f8f616415ef7ce1c18ab95f372d2da1..bd27eb448db2488a617e11a2cfadf937b34f6279 100644 +index 791b655890ce5b144f8649f687945c17a390ce76..ea82243ea965ee70ef1f94cb699d9ab262415b7a 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -247,11 +247,6 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/patches/server/0188-Flag-to-disable-the-channel-limit.patch b/patches/server/0188-Flag-to-disable-the-channel-limit.patch index d4b37a5355..1ec64fa716 100644 --- a/patches/server/0188-Flag-to-disable-the-channel-limit.patch +++ b/patches/server/0188-Flag-to-disable-the-channel-limit.patch @@ -9,7 +9,7 @@ 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 bd27eb448db2488a617e11a2cfadf937b34f6279..568aec34f5900f690eeb121bd908b501bf4c0838 100644 +index ea82243ea965ee70ef1f94cb699d9ab262415b7a..df351eb47360e94d6974950bf219989951426fa6 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -207,6 +207,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/patches/server/0215-InventoryCloseEvent-Reason-API.patch b/patches/server/0215-InventoryCloseEvent-Reason-API.patch index 4d71778b77..e02b376de2 100644 --- a/patches/server/0215-InventoryCloseEvent-Reason-API.patch +++ b/patches/server/0215-InventoryCloseEvent-Reason-API.patch @@ -165,7 +165,7 @@ index dd3377a4f69e5ac10905e52d0eecc2427e72d856..c79607a2f45b7a487a95cf98b9b0eb6b @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 568aec34f5900f690eeb121bd908b501bf4c0838..2c16e8036695c853a4a9dba18617b904c1487a9a 100644 +index df351eb47360e94d6974950bf219989951426fa6..e28f9563ce9e3c762b237013f322265c16484192 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -1260,7 +1260,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/patches/server/0249-Expose-attack-cooldown-methods-for-Player.patch b/patches/server/0249-Expose-attack-cooldown-methods-for-Player.patch index fdeb442961..e382df3eff 100644 --- a/patches/server/0249-Expose-attack-cooldown-methods-for-Player.patch +++ b/patches/server/0249-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 2c16e8036695c853a4a9dba18617b904c1487a9a..46c206794b6f69761be87d2674d283977c28882a 100644 +index e28f9563ce9e3c762b237013f322265c16484192..f00afc993fc343a1fbc6cf71f8b3e45f8d76e42b 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2957,6 +2957,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2956,6 +2956,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player { return this.adventure$pointers; } diff --git a/patches/server/0250-Improve-death-events.patch b/patches/server/0250-Improve-death-events.patch index 88736e7328..5bb85c8f53 100644 --- a/patches/server/0250-Improve-death-events.patch +++ b/patches/server/0250-Improve-death-events.patch @@ -427,7 +427,7 @@ index 042968ff848da74be0c9fcf9bac3d0adfb135802..cb3729509e50fed64b17f16797825c1d this.gameEvent(GameEvent.ENTITY_DIE); } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 46c206794b6f69761be87d2674d283977c28882a..47c747b355737a81cc1d71659a0c8762a37329a8 100644 +index f00afc993fc343a1fbc6cf71f8b3e45f8d76e42b..9d3cef9bb395a64ea934f4496ec8556b67d83bf2 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -2502,7 +2502,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/patches/server/0280-Replace-OfflinePlayer-getLastPlayed.patch b/patches/server/0280-Replace-OfflinePlayer-getLastPlayed.patch index b9da3375dd..aa6050d048 100644 --- a/patches/server/0280-Replace-OfflinePlayer-getLastPlayed.patch +++ b/patches/server/0280-Replace-OfflinePlayer-getLastPlayed.patch @@ -106,7 +106,7 @@ index 461656e1cb095243bfe7a9ee2906e5b00574ae78..411b280ac3e27e72091db813c0c9b69b public Location getLastDeathLocation() { if (this.getData().contains("LastDeathLocation", 10)) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 47c747b355737a81cc1d71659a0c8762a37329a8..f6c70805e621365c2a4cc96fb51839cef4f04a5a 100644 +index 9d3cef9bb395a64ea934f4496ec8556b67d83bf2..11c429225f3242a0bb4bcef8c47fad1cbb5c9a43 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -208,6 +208,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/patches/server/0282-Dont-block-Player-remove-if-the-handle-is-a-custom-p.patch b/patches/server/0282-Dont-block-Player-remove-if-the-handle-is-a-custom-p.patch index 0ff526b8e2..7ff0d9c37b 100644 --- a/patches/server/0282-Dont-block-Player-remove-if-the-handle-is-a-custom-p.patch +++ b/patches/server/0282-Dont-block-Player-remove-if-the-handle-is-a-custom-p.patch @@ -8,7 +8,7 @@ We just add a check to ensure that the CraftPlayer's handle is a ServerPlayer diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index f6c70805e621365c2a4cc96fb51839cef4f04a5a..130aa837f448ba22deb6075757b7f151763a1475 100644 +index 11c429225f3242a0bb4bcef8c47fad1cbb5c9a43..4c12ad37d304460ca79033282c52cf851537d1f9 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -222,8 +222,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/patches/server/0351-Implement-Player-Client-Options-API.patch b/patches/server/0351-Implement-Player-Client-Options-API.patch index 64ad3548db..cee4051d9c 100644 --- a/patches/server/0351-Implement-Player-Client-Options-API.patch +++ b/patches/server/0351-Implement-Player-Client-Options-API.patch @@ -136,7 +136,7 @@ index f6e4172f1c7ad38128e77e53f099e67a4c4be620..62bdc3016120271da2ca3a1f6ac46757 this.adventure$locale = java.util.Objects.requireNonNullElse(net.kyori.adventure.translation.Translator.parseLocale(this.language), java.util.Locale.US); // Paper this.requestedViewDistance = clientOptions.viewDistance(); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 130aa837f448ba22deb6075757b7f151763a1475..de972df14afa5ce021260dd1a0c6fa0f85e26df5 100644 +index 4c12ad37d304460ca79033282c52cf851537d1f9..381207e020e5b06cacb98142663db5f2030615ce 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -651,6 +651,28 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/patches/server/0407-Brand-support.patch b/patches/server/0407-Brand-support.patch index cbbdaf4cf7..2622e64ecf 100644 --- a/patches/server/0407-Brand-support.patch +++ b/patches/server/0407-Brand-support.patch @@ -57,10 +57,10 @@ index 237e3d8d2fd539f1fc6cd466ff124890dfa644d6..d7ddfabcbacb077c337c789083a24ad8 } catch (Exception ex) { ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t dispatch custom payload", ex); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index de972df14afa5ce021260dd1a0c6fa0f85e26df5..cc003b562d4df8e01b8d3f6e150b30ad716f6427 100644 +index 381207e020e5b06cacb98142663db5f2030615ce..a52fab6dc676ed1949e3e7db31d2543a6f5d1eba 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -3116,6 +3116,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -3115,6 +3115,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { // Paper end }; diff --git a/patches/server/0450-Fix-Player-spawnParticle-x-y-z-precision-loss.patch b/patches/server/0450-Fix-Player-spawnParticle-x-y-z-precision-loss.patch index b6d807d385..b837b1cf1f 100644 --- a/patches/server/0450-Fix-Player-spawnParticle-x-y-z-precision-loss.patch +++ b/patches/server/0450-Fix-Player-spawnParticle-x-y-z-precision-loss.patch @@ -5,7 +5,7 @@ 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 cc003b562d4df8e01b8d3f6e150b30ad716f6427..3fd8e11b3ae0a60ab7d62866dfb50386fb6efbc3 100644 +index a52fab6dc676ed1949e3e7db31d2543a6f5d1eba..5550586022538be993a7b1d9f3d33c6785df73b5 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -2682,7 +2682,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/patches/server/0487-Add-sendOpLevel-API.patch b/patches/server/0487-Add-sendOpLevel-API.patch index 8737d09c0f..fd90e10a99 100644 --- a/patches/server/0487-Add-sendOpLevel-API.patch +++ b/patches/server/0487-Add-sendOpLevel-API.patch @@ -32,7 +32,7 @@ index 505af87eaf8209437978848be1dde86f879f82f2..d5071f9f2d433706fc378f77906bb5f0 public boolean isWhiteListed(GameProfile profile) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 3fd8e11b3ae0a60ab7d62866dfb50386fb6efbc3..ca046ab01c39546b0f4abb95a50045c48e850a6c 100644 +index 5550586022538be993a7b1d9f3d33c6785df73b5..36aaf37154c01c7a8f8543149e6bedec1386f5e7 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -675,6 +675,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/patches/server/0550-Expand-PlayerGameModeChangeEvent.patch b/patches/server/0550-Expand-PlayerGameModeChangeEvent.patch index 6ff7dbaf60..e8a43cf71d 100644 --- a/patches/server/0550-Expand-PlayerGameModeChangeEvent.patch +++ b/patches/server/0550-Expand-PlayerGameModeChangeEvent.patch @@ -145,7 +145,7 @@ index f84a6f1ec9d1081b05ab44dd99659918aa0f1874..806f16a183ff1abae4cc21409bf8d26e } } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index ca046ab01c39546b0f4abb95a50045c48e850a6c..69013e355fe5a846d825fa07c37c28aaabd04585 100644 +index 36aaf37154c01c7a8f8543149e6bedec1386f5e7..6100e2313a86f9baca136a178cc30d4adc5cae53 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -1640,7 +1640,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/patches/server/0562-Add-PlayerKickEvent-causes.patch b/patches/server/0562-Add-PlayerKickEvent-causes.patch index c7afa27fc0..ef97541bc5 100644 --- a/patches/server/0562-Add-PlayerKickEvent-causes.patch +++ b/patches/server/0562-Add-PlayerKickEvent-causes.patch @@ -477,7 +477,7 @@ index f472dea0bd4f834c0c8f0aa59ae7cdae082b14af..2fa51c3a70f43cd23b8f494fc643d66c } } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 69013e355fe5a846d825fa07c37c28aaabd04585..fd748146bebeca92d3b0a7be8521e45a7764aae7 100644 +index 6100e2313a86f9baca136a178cc30d4adc5cae53..1cbf70e8f238a3e67f27d86b9f685d5303fa5527 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -633,7 +633,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/patches/server/0575-Add-more-LimitedRegion-API.patch b/patches/server/0575-Add-more-LimitedRegion-API.patch index fc86ca4869..6e183e954e 100644 --- a/patches/server/0575-Add-more-LimitedRegion-API.patch +++ b/patches/server/0575-Add-more-LimitedRegion-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add more LimitedRegion API diff --git a/src/main/java/org/bukkit/craftbukkit/generator/CraftLimitedRegion.java b/src/main/java/org/bukkit/craftbukkit/generator/CraftLimitedRegion.java -index e7266835946c3bf49dbd83fe677481e8eddd16e5..09c282b3fbbdec82f21ab97fe0a486eacc2c2e8b 100644 +index e7266835946c3bf49dbd83fe677481e8eddd16e5..7d6ee60b1d3e023e1eabc59eb591c3ae3d8ac043 100644 --- a/src/main/java/org/bukkit/craftbukkit/generator/CraftLimitedRegion.java +++ b/src/main/java/org/bukkit/craftbukkit/generator/CraftLimitedRegion.java @@ -254,4 +254,45 @@ public class CraftLimitedRegion extends CraftRegionAccessor implements LimitedRe @@ -20,7 +20,7 @@ index e7266835946c3bf49dbd83fe677481e8eddd16e5..09c282b3fbbdec82f21ab97fe0a486ea + if (!state.getBlockData().matches(getHandle().getBlockState(pos).createCraftBlockData())) { + throw new IllegalArgumentException("BlockData does not match! Expected " + state.getBlockData().getAsString(false) + ", got " + getHandle().getBlockState(pos).createCraftBlockData().getAsString(false)); + } -+ getHandle().getBlockEntity(pos).load(((org.bukkit.craftbukkit.block.CraftBlockEntityState) state).getSnapshotNBT()); ++ getHandle().getBlockEntity(pos).loadWithComponents(((org.bukkit.craftbukkit.block.CraftBlockEntityState) state).getSnapshotNBT(), this.getHandle().registryAccess()); + } + + @Override diff --git a/patches/server/0591-Add-PlayerSetSpawnEvent.patch b/patches/server/0591-Add-PlayerSetSpawnEvent.patch index d3575cc2be..5c81577101 100644 --- a/patches/server/0591-Add-PlayerSetSpawnEvent.patch +++ b/patches/server/0591-Add-PlayerSetSpawnEvent.patch @@ -187,7 +187,7 @@ index e18726915d1491d74084827afd9978800aecb644..a4a90df0b500fb440226b07462faaa87 } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index fd748146bebeca92d3b0a7be8521e45a7764aae7..4cc40a0b1bc3153797b32e273694a25606e68832 100644 +index 1cbf70e8f238a3e67f27d86b9f685d5303fa5527..cc6d0b713f839d482dfba8a1e83f927923c9c690 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -1399,9 +1399,9 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/patches/server/0676-Multi-Block-Change-API-Implementation.patch b/patches/server/0676-Multi-Block-Change-API-Implementation.patch index fc3dccaf67..3eee7a872a 100644 --- a/patches/server/0676-Multi-Block-Change-API-Implementation.patch +++ b/patches/server/0676-Multi-Block-Change-API-Implementation.patch @@ -24,7 +24,7 @@ index 926ff9be3d9e3f5d620e4c7ccb22b9f64865ff8c..1a37654aff9a9c86c9f7af10a1cf7213 buf.writeLong(this.sectionPos.asLong()); buf.writeVarInt(this.positions.length); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 4cc40a0b1bc3153797b32e273694a25606e68832..8f9676fca039ba2b5c52960eb1e4382219e59eb4 100644 +index cc6d0b713f839d482dfba8a1e83f927923c9c690..ee31c18ae530cb064ae9d1cc3f3d68312c1f854c 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -928,6 +928,32 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/patches/server/0679-More-PotionEffectType-API.patch b/patches/server/0679-More-PotionEffectType-API.patch index 8b793975b7..6c51197700 100644 --- a/patches/server/0679-More-PotionEffectType-API.patch +++ b/patches/server/0679-More-PotionEffectType-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] More PotionEffectType API diff --git a/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionEffectType.java b/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionEffectType.java -index 8dffef71c8b193c0fc84b65a592c93827e341bf7..670a278c1573899f846d33aebc59d2e6616d2c5d 100644 +index 8dffef71c8b193c0fc84b65a592c93827e341bf7..97b31ffb86fa5c8b567a6b3793389571b6bf846f 100644 --- a/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionEffectType.java +++ b/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionEffectType.java @@ -123,6 +123,48 @@ public class CraftPotionEffectType extends PotionEffectType implements Handleabl @@ -17,11 +17,11 @@ index 8dffef71c8b193c0fc84b65a592c93827e341bf7..670a278c1573899f846d33aebc59d2e6 + public java.util.Map getEffectAttributes() { + // re-create map each time because a nms MobEffect can have its attributes modified + final java.util.Map attributeMap = new java.util.HashMap<>(); -+ this.handle.getAttributeModifiers().forEach((attribute, attributeModifier) -> { ++ this.handle.attributeModifiers.forEach((attribute, attributeModifier) -> { + attributeMap.put( + org.bukkit.craftbukkit.attribute.CraftAttribute.stringToBukkit(attribute.toString()), + // use zero as amplifier to get the base amount, as it is amount = base * (amplifier + 1) -+ org.bukkit.craftbukkit.attribute.CraftAttributeInstance.convert(attributeModifier.create(0)) ++ org.bukkit.craftbukkit.attribute.CraftAttributeInstance.convert(attributeModifier.create(this.handle.getDescriptionId(), 0)) + ); + }); + return java.util.Map.copyOf(attributeMap); @@ -30,9 +30,9 @@ index 8dffef71c8b193c0fc84b65a592c93827e341bf7..670a278c1573899f846d33aebc59d2e6 + @Override + public double getAttributeModifierAmount(org.bukkit.attribute.Attribute attribute, int effectAmplifier) { + com.google.common.base.Preconditions.checkArgument(effectAmplifier >= 0, "effectAmplifier must be greater than or equal to 0"); -+ net.minecraft.world.entity.ai.attributes.Attribute nmsAttribute = org.bukkit.craftbukkit.attribute.CraftAttribute.bukkitToMinecraft(attribute); -+ com.google.common.base.Preconditions.checkArgument(this.handle.getAttributeModifiers().containsKey(nmsAttribute), attribute + " is not present on " + this.getKey()); -+ return this.handle.getAttributeModifiers().get(nmsAttribute).create(effectAmplifier).getAmount(); ++ Holder nmsAttribute = org.bukkit.craftbukkit.attribute.CraftAttribute.bukkitToMinecraftHolder(attribute); ++ com.google.common.base.Preconditions.checkArgument(this.handle.attributeModifiers.containsKey(nmsAttribute), attribute + " is not present on " + this.getKey()); ++ return this.handle.attributeModifiers.get(nmsAttribute).create(effectAmplifier).getAmount(); + } + + @Override diff --git a/patches/server/0682-Add-missing-structure-set-seed-configs.patch b/patches/server/0682-Add-missing-structure-set-seed-configs.patch index 3118eb5fb7..0c160b7c1c 100644 --- a/patches/server/0682-Add-missing-structure-set-seed-configs.patch +++ b/patches/server/0682-Add-missing-structure-set-seed-configs.patch @@ -147,6 +147,40 @@ index e6c59f986ae89022bd76463209dfa550a3d4fb59..a6b6e5ea191c0e2cd7a2e4f01b89d8af return true; } } +diff --git a/src/main/java/net/minecraft/world/level/levelgen/structure/StructureCheck.java b/src/main/java/net/minecraft/world/level/levelgen/structure/StructureCheck.java +index aae73586265593ee7830fb8dd5c2e3d7560057f0..c6181e14d85d454506534f9bbe856156c0d4a062 100644 +--- a/src/main/java/net/minecraft/world/level/levelgen/structure/StructureCheck.java ++++ b/src/main/java/net/minecraft/world/level/levelgen/structure/StructureCheck.java +@@ -74,6 +74,20 @@ public class StructureCheck { + this.fixerUpper = dataFixer; + } + ++ // Paper start - add missing structure salt configs ++ @Nullable ++ private Integer getSaltOverride(Structure type) { ++ if (this.heightAccessor instanceof net.minecraft.server.level.ServerLevel serverLevel) { ++ if (type instanceof net.minecraft.world.level.levelgen.structure.structures.MineshaftStructure) { ++ return serverLevel.spigotConfig.mineshaftSeed; ++ } else if (type instanceof net.minecraft.world.level.levelgen.structure.structures.BuriedTreasureStructure) { ++ return serverLevel.spigotConfig.buriedTreasureSeed; ++ } ++ } ++ return null; ++ } ++ // Paper end - add missing structure seed configs ++ + public StructureCheckResult checkStart(ChunkPos pos, Structure type, StructurePlacement placement, boolean skipReferencedStructures) { + long l = pos.toLong(); + Object2IntMap object2IntMap = this.loadedChunks.get(l); +@@ -83,7 +97,7 @@ public class StructureCheck { + StructureCheckResult structureCheckResult = this.tryLoadFromStorage(pos, type, skipReferencedStructures, l); + if (structureCheckResult != null) { + return structureCheckResult; +- } else if (!placement.applyAdditionalChunkRestrictions(pos.x, pos.z, this.seed)) { ++ } else if (!placement.applyAdditionalChunkRestrictions(pos.x, pos.z, this.seed, this.getSaltOverride(type))) { // Paper - add missing structure seed configs + return StructureCheckResult.START_NOT_PRESENT; + } else { + boolean bl = this.featureChecks diff --git a/src/main/java/net/minecraft/world/level/levelgen/structure/placement/StructurePlacement.java b/src/main/java/net/minecraft/world/level/levelgen/structure/placement/StructurePlacement.java index a4c34e9415632354d33668a38d06453ada4d3c77..cbf13e4f2da6a27619e9bc9a7cd73bb6e69cad2a 100644 --- a/src/main/java/net/minecraft/world/level/levelgen/structure/placement/StructurePlacement.java diff --git a/patches/server/0699-More-Projectile-API.patch b/patches/server/0699-More-Projectile-API.patch index 502e5f9098..bccb9ad23b 100644 --- a/patches/server/0699-More-Projectile-API.patch +++ b/patches/server/0699-More-Projectile-API.patch @@ -19,6 +19,19 @@ public net.minecraft.world.entity.projectile.Projectile canHitEntity(Lnet/minecr Co-authored-by: Nassim Jahnke +diff --git a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java +index 40348e45b02be9a0b397a883940a476fb6738ef4..ccb7aa341e3087255bce1f6fb953d33584147fd3 100644 +--- a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java ++++ b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java +@@ -180,7 +180,7 @@ public abstract class Projectile extends Entity implements TraceableEntity { + } + + // CraftBukkit start - call projectile hit event +- protected ProjectileDeflection preHitTargetOrDeflectSelf(HitResult movingobjectposition) { ++ public ProjectileDeflection preHitTargetOrDeflectSelf(HitResult movingobjectposition) { // Paper - protected -> public + org.bukkit.event.entity.ProjectileHitEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileHitEvent(this, movingobjectposition); + this.hitCancelled = event != null && event.isCancelled(); + if (movingobjectposition.getType() == HitResult.Type.BLOCK || !this.hitCancelled) { diff --git a/src/main/java/net/minecraft/world/entity/projectile/ThrownPotion.java b/src/main/java/net/minecraft/world/entity/projectile/ThrownPotion.java index bf627d66310f201172d3cd3ea12f1d321cd3cd62..5adaeb59f7733809f1cf6b52031292c9611a3a86 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/ThrownPotion.java @@ -63,7 +76,7 @@ index bf627d66310f201172d3cd3ea12f1d321cd3cd62..5adaeb59f7733809f1cf6b52031292c9 Entity entity = this.getOwner(); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/AbstractProjectile.java b/src/main/java/org/bukkit/craftbukkit/entity/AbstractProjectile.java -index 91c2d0b40d3fca86938cd454e1415a4eea3df7c7..c1c52f4fc5f900fac4098e5e37c52dfc4e82b8bb 100644 +index 91c2d0b40d3fca86938cd454e1415a4eea3df7c7..de4fb2654c7895cfd83ad694455ee56cb708c2f2 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/AbstractProjectile.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/AbstractProjectile.java @@ -17,4 +17,65 @@ public abstract class AbstractProjectile extends CraftEntity implements Projecti @@ -98,12 +111,12 @@ index 91c2d0b40d3fca86938cd454e1415a4eea3df7c7..c1c52f4fc5f900fac4098e5e37c52dfc + + @Override + public void hitEntity(org.bukkit.entity.Entity entity) { -+ this.getHandle().preOnHit(new net.minecraft.world.phys.EntityHitResult(((CraftEntity) entity).getHandle())); ++ this.getHandle().preHitTargetOrDeflectSelf(new net.minecraft.world.phys.EntityHitResult(((CraftEntity) entity).getHandle())); + } + + @Override + public void hitEntity(org.bukkit.entity.Entity entity, org.bukkit.util.Vector vector) { -+ this.getHandle().preOnHit(new net.minecraft.world.phys.EntityHitResult(((CraftEntity) entity).getHandle(), new net.minecraft.world.phys.Vec3(vector.getX(), vector.getY(), vector.getZ()))); ++ this.getHandle().preHitTargetOrDeflectSelf(new net.minecraft.world.phys.EntityHitResult(((CraftEntity) entity).getHandle(), new net.minecraft.world.phys.Vec3(vector.getX(), vector.getY(), vector.getZ()))); + } + + @Override @@ -133,7 +146,7 @@ index 91c2d0b40d3fca86938cd454e1415a4eea3df7c7..c1c52f4fc5f900fac4098e5e37c52dfc + // Paper end - More projectile API } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractArrow.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractArrow.java -index 98f46fadd60ea688fefa8d83dbd6fe9b61b6a96f..54daf160748ae4c952ee605a2d55ee7533c42093 100644 +index 98f46fadd60ea688fefa8d83dbd6fe9b61b6a96f..d4e0170694409e674d488f913e61c205f6483712 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractArrow.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractArrow.java @@ -60,20 +60,7 @@ public class CraftAbstractArrow extends AbstractProjectile implements AbstractAr @@ -158,19 +171,15 @@ index 98f46fadd60ea688fefa8d83dbd6fe9b61b6a96f..54daf160748ae4c952ee605a2d55ee75 @Override public boolean isInBlock() { -diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java -index 62fe1ae5cfdcba84d8d1456a9939e4649aea8794..291e97eedda1c6d77d53631253be8c3333b88ff2 100644 ---- a/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java -+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java -@@ -72,6 +72,35 @@ public class CraftArrow extends CraftAbstractArrow implements Arrow { - return false; +@@ -140,4 +127,31 @@ public class CraftAbstractArrow extends AbstractProjectile implements AbstractAr + public String toString() { + return "CraftArrow"; } - ++ + // Paper start + @Override -+ @org.jetbrains.annotations.NotNull + public org.bukkit.craftbukkit.inventory.CraftItemStack getItemStack() { -+ return org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(getHandle().getPickupItem()); ++ return org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(this.getHandle().getPickupItem()); + } + + @Override @@ -183,21 +192,17 @@ index 62fe1ae5cfdcba84d8d1456a9939e4649aea8794..291e97eedda1c6d77d53631253be8c33 + return this.getHandle().life; + } + -+ @org.jetbrains.annotations.NotNull + @Override + public org.bukkit.Sound getHitSound() { + return org.bukkit.craftbukkit.CraftSound.minecraftToBukkit(this.getHandle().soundEvent); + } + + @Override -+ public void setHitSound(@org.jetbrains.annotations.NotNull org.bukkit.Sound sound) { ++ public void setHitSound(org.bukkit.Sound sound) { + this.getHandle().setSoundEvent(org.bukkit.craftbukkit.CraftSound.bukkitToMinecraft(sound)); + } + // Paper end -+ - @Override - public boolean hasCustomEffects() { - return !this.getHandle().getPotionContents().customEffects().isEmpty(); + } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFireball.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFireball.java index 3815b68e139702f3f97c4fa2a77a0314d83fa758..939a0713c74dd92273190017d3976d894f002d95 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFireball.java @@ -464,7 +469,7 @@ index d685d09cae5f862c0004f148298c800736d2139e..636c4481e3afdf20197e502cf221f5d3 public String toString() { return "CraftShulkerBullet"; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftThrownPotion.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftThrownPotion.java -index a7443a61e796e8b8f4b480085a77e098d1b134e5..a5edfd484737b5f6af8aa1d9a1d31d7d2710f7da 100644 +index a7443a61e796e8b8f4b480085a77e098d1b134e5..7c872f6a214d3d361aa63b06b001bde31fa54e96 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftThrownPotion.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftThrownPotion.java @@ -36,11 +36,31 @@ public class CraftThrownPotion extends CraftThrowableProjectile implements Throw @@ -482,7 +487,7 @@ index a7443a61e796e8b8f4b480085a77e098d1b134e5..a5edfd484737b5f6af8aa1d9a1d31d7d + // Paper start - Projectile API + @Override + public org.bukkit.inventory.meta.PotionMeta getPotionMeta() { -+ return (org.bukkit.inventory.meta.PotionMeta) CraftItemStack.getItemMeta(this.getHandle().getItemRaw(), Material.SPLASH_POTION); ++ return (org.bukkit.inventory.meta.PotionMeta) CraftItemStack.getItemMeta(this.getHandle().getItem(), Material.SPLASH_POTION); + } + + @Override diff --git a/patches/server/0702-Implement-getComputedBiome-API.patch b/patches/server/0702-Implement-getComputedBiome-API.patch index 75326082a2..57a6b3a7c5 100644 --- a/patches/server/0702-Implement-getComputedBiome-API.patch +++ b/patches/server/0702-Implement-getComputedBiome-API.patch @@ -41,7 +41,7 @@ index 068b3735b6c50a7a2053c7dc39856f728fb7218a..6d10396347b69d9243ab902ecc68ede9 public void setBiome(Biome bio) { this.getWorld().setBiome(this.getX(), this.getY(), this.getZ(), bio); diff --git a/src/main/java/org/bukkit/craftbukkit/generator/CraftLimitedRegion.java b/src/main/java/org/bukkit/craftbukkit/generator/CraftLimitedRegion.java -index 09c282b3fbbdec82f21ab97fe0a486eacc2c2e8b..06ab1ac654e0c6f0ab7208783d186ed306ce204f 100644 +index 7d6ee60b1d3e023e1eabc59eb591c3ae3d8ac043..eaa9ba70b0b80d86eb376a0641420093a7c9dfdb 100644 --- a/src/main/java/org/bukkit/craftbukkit/generator/CraftLimitedRegion.java +++ b/src/main/java/org/bukkit/craftbukkit/generator/CraftLimitedRegion.java @@ -165,6 +165,14 @@ public class CraftLimitedRegion extends CraftRegionAccessor implements LimitedRe diff --git a/patches/server/0740-Fix-CCE-for-SplashPotion-and-LingeringPotion-spawnin.patch b/patches/server/0740-Fix-CCE-for-SplashPotion-and-LingeringPotion-spawnin.patch index 22edd6c689..2c104c79c4 100644 --- a/patches/server/0740-Fix-CCE-for-SplashPotion-and-LingeringPotion-spawnin.patch +++ b/patches/server/0740-Fix-CCE-for-SplashPotion-and-LingeringPotion-spawnin.patch @@ -7,7 +7,7 @@ Remove in 1.19 along with the SplashPotion and LingeringPotion interfaces diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftThrownPotion.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftThrownPotion.java -index a5edfd484737b5f6af8aa1d9a1d31d7d2710f7da..ca87f0d59e6cf4b214b8322701ad0c16e49bad48 100644 +index 7c872f6a214d3d361aa63b06b001bde31fa54e96..93b42b970b174b800cf89cb0d12cf3d2574323bd 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftThrownPotion.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftThrownPotion.java @@ -14,7 +14,7 @@ import org.bukkit.entity.ThrownPotion; diff --git a/patches/server/0746-More-Teleport-API.patch b/patches/server/0746-More-Teleport-API.patch index b751485e44..9a4763b6fe 100644 --- a/patches/server/0746-More-Teleport-API.patch +++ b/patches/server/0746-More-Teleport-API.patch @@ -112,7 +112,7 @@ index 113ca1d16cb7650d72f488cdaa9e670d51dc85f0..b6fef2ca5b564c293cb602cb8e300d35 private final org.bukkit.entity.Entity.Spigot spigot = new org.bukkit.entity.Entity.Spigot() { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 8f9676fca039ba2b5c52960eb1e4382219e59eb4..f72b0ad304deb4e07c4d4a547613baaab7b076b0 100644 +index ee31c18ae530cb064ae9d1cc3f3d68312c1f854c..cfcba16427d9c562bae987abc995775c4ee2956d 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -1273,13 +1273,101 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/patches/server/0751-Custom-Chat-Completion-Suggestions-API.patch b/patches/server/0751-Custom-Chat-Completion-Suggestions-API.patch index a31dfaba12..52d9d632bf 100644 --- a/patches/server/0751-Custom-Chat-Completion-Suggestions-API.patch +++ b/patches/server/0751-Custom-Chat-Completion-Suggestions-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Custom Chat Completion Suggestions API diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index f72b0ad304deb4e07c4d4a547613baaab7b076b0..f8d8b22a6bd039004318524b2cfd0a290f7b2073 100644 +index cfcba16427d9c562bae987abc995775c4ee2956d..a5b87aaa0b5ae437a44c5576ff6f7c28e07e36bf 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -689,6 +689,24 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/patches/server/0759-Stop-large-look-changes-from-crashing-the-server.patch b/patches/server/0759-Stop-large-look-changes-from-crashing-the-server.patch index 1f49c39b57..4604a3c7d6 100644 --- a/patches/server/0759-Stop-large-look-changes-from-crashing-the-server.patch +++ b/patches/server/0759-Stop-large-look-changes-from-crashing-the-server.patch @@ -54,7 +54,7 @@ index f3ca6f6c7a8f2dc51e263ee879412bf2806b0946..4bda4252889cc42bb5a38c45d87f5ec0 this.level().getProfiler().pop(); this.animStep += f2; diff --git a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java -index 40348e45b02be9a0b397a883940a476fb6738ef4..734e00caf72a694654319f69f793dcbf616f1784 100644 +index ccb7aa341e3087255bce1f6fb953d33584147fd3..4c6fbf19d6bb01e67c6141aea757fae434ee8233 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java +++ b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java @@ -298,13 +298,7 @@ public abstract class Projectile extends Entity implements TraceableEntity { diff --git a/patches/server/0777-Elder-Guardian-appearance-API.patch b/patches/server/0777-Elder-Guardian-appearance-API.patch index 9a2454922d..403482552b 100644 --- a/patches/server/0777-Elder-Guardian-appearance-API.patch +++ b/patches/server/0777-Elder-Guardian-appearance-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Elder Guardian appearance API diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index f8d8b22a6bd039004318524b2cfd0a290f7b2073..a8dd25a4ed581f3902fa46b225a86d4d635feed4 100644 +index a5b87aaa0b5ae437a44c5576ff6f7c28e07e36bf..331e565cf9d145c03150f402b1538b539e1e1816 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -3275,6 +3275,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -3274,6 +3274,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } // Paper end diff --git a/patches/server/0791-Add-Player-Warden-Warning-API.patch b/patches/server/0791-Add-Player-Warden-Warning-API.patch index 5b64196927..cbda3eac9c 100644 --- a/patches/server/0791-Add-Player-Warden-Warning-API.patch +++ b/patches/server/0791-Add-Player-Warden-Warning-API.patch @@ -10,10 +10,10 @@ public net.minecraft.world.entity.monster.warden.WardenSpawnTracker cooldownTick public net.minecraft.world.entity.monster.warden.WardenSpawnTracker increaseWarningLevel()V diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index a8dd25a4ed581f3902fa46b225a86d4d635feed4..ba236636f590858cc5d9ab80949eaa61cf7acb6b 100644 +index 331e565cf9d145c03150f402b1538b539e1e1816..02420c94c4efc2fb201bfcfd95867aced9f14da9 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -3280,6 +3280,41 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -3279,6 +3279,41 @@ public class CraftPlayer extends CraftHumanEntity implements Player { public void showElderGuardian(boolean silent) { if (getHandle().connection != null) getHandle().connection.send(new ClientboundGameEventPacket(ClientboundGameEventPacket.GUARDIAN_ELDER_EFFECT, silent ? 0F : 1F)); } diff --git a/patches/server/0804-fix-Instruments.patch b/patches/server/0804-fix-Instruments.patch index 37029bc0d8..610a880852 100644 --- a/patches/server/0804-fix-Instruments.patch +++ b/patches/server/0804-fix-Instruments.patch @@ -6,7 +6,7 @@ Subject: [PATCH] fix Instruments properly handle Player#playNote diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index ba236636f590858cc5d9ab80949eaa61cf7acb6b..acfbd4d4a4916183252812553d5b43485e21d30d 100644 +index 02420c94c4efc2fb201bfcfd95867aced9f14da9..0d2b87257f797de02f1dd68f1eb740a3d99dad22 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -766,7 +766,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/patches/server/0814-Flying-Fall-Damage.patch b/patches/server/0814-Flying-Fall-Damage.patch index d5f5b88ac2..46bd6e117e 100644 --- a/patches/server/0814-Flying-Fall-Damage.patch +++ b/patches/server/0814-Flying-Fall-Damage.patch @@ -26,7 +26,7 @@ index 761e8a0c4e1db465c18892999e86885f27ca8075..230ffd3c4541ef8979605d733b6463e3 } else { if (fallDistance >= 2.0F) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index acfbd4d4a4916183252812553d5b43485e21d30d..9806ff40a34a6592c8d26061f89f888c9a8cc717 100644 +index 0d2b87257f797de02f1dd68f1eb740a3d99dad22..4dbcde83c62b331d5b9112874c68c4d026abb53b 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -2566,6 +2566,19 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/patches/server/0820-Win-Screen-API.patch b/patches/server/0820-Win-Screen-API.patch index 388e89d524..55b4336093 100644 --- a/patches/server/0820-Win-Screen-API.patch +++ b/patches/server/0820-Win-Screen-API.patch @@ -7,7 +7,7 @@ Subject: [PATCH] Win Screen API public net.minecraft.server.level.ServerPlayer seenCredits diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 9806ff40a34a6592c8d26061f89f888c9a8cc717..0ee1f22acfe660b8c3b86817879c1556434c761f 100644 +index 4dbcde83c62b331d5b9112874c68c4d026abb53b..37c23923ebd4dfd6405d3c19fa42609fc683a42e 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -1292,6 +1292,25 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/patches/server/0846-Expand-PlayerItemMendEvent.patch b/patches/server/0846-Expand-PlayerItemMendEvent.patch index 0cd65fdc24..617b45a407 100644 --- a/patches/server/0846-Expand-PlayerItemMendEvent.patch +++ b/patches/server/0846-Expand-PlayerItemMendEvent.patch @@ -33,7 +33,7 @@ index adc3e6298a1946fdea029c82a9954fb5b6e24497..a207a31d80a302dbdfe80f8727222542 return k > 0 ? this.repairPlayerItems(player, k) : 0; } else { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 0ee1f22acfe660b8c3b86817879c1556434c761f..12a096d20d254a9cbdfc28b923afef474fa5698f 100644 +index 37c23923ebd4dfd6405d3c19fa42609fc683a42e..7c039d79b6fba3358daaaf8894e05d9493fa6af8 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -1835,11 +1835,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/patches/server/0847-Refresh-ProjectileSource-for-projectiles.patch b/patches/server/0847-Refresh-ProjectileSource-for-projectiles.patch index 4b9522e0d5..f6d4037762 100644 --- a/patches/server/0847-Refresh-ProjectileSource-for-projectiles.patch +++ b/patches/server/0847-Refresh-ProjectileSource-for-projectiles.patch @@ -26,7 +26,7 @@ index 09defe4a20c7b0794cba358c177e787f1c0273c1..b2e2bd4d7e3b373a92d3a4a13446f27f public boolean lastDamageCancelled; // SPIGOT-5339, SPIGOT-6252, SPIGOT-6777: Keep track if the event was canceled public boolean persistentInvisibility = false; diff --git a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java -index 734e00caf72a694654319f69f793dcbf616f1784..64f7ae4d9e37daf2d48231f44f686008953ad39b 100644 +index 4c6fbf19d6bb01e67c6141aea757fae434ee8233..74c596264d4da551437bd2a23e1c70022cfc73fc 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java +++ b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java @@ -51,14 +51,31 @@ public abstract class Projectile extends Entity implements TraceableEntity { @@ -72,7 +72,7 @@ index 734e00caf72a694654319f69f793dcbf616f1784..64f7ae4d9e37daf2d48231f44f686008 } } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/AbstractProjectile.java b/src/main/java/org/bukkit/craftbukkit/entity/AbstractProjectile.java -index c1c52f4fc5f900fac4098e5e37c52dfc4e82b8bb..236f94348ff8da661e23e3e17b7fc1b143680da9 100644 +index de4fb2654c7895cfd83ad694455ee56cb708c2f2..591af9d0d2fdc9953415979fc97a4a00afd85885 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/AbstractProjectile.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/AbstractProjectile.java @@ -60,6 +60,7 @@ public abstract class AbstractProjectile extends CraftEntity implements Projecti diff --git a/patches/server/0853-fix-MapLike-spam-for-missing-key-selector.patch b/patches/server/0853-fix-MapLike-spam-for-missing-key-selector.patch index 591273e2fe..2bd3b889f1 100644 --- a/patches/server/0853-fix-MapLike-spam-for-missing-key-selector.patch +++ b/patches/server/0853-fix-MapLike-spam-for-missing-key-selector.patch @@ -5,7 +5,7 @@ Subject: [PATCH] fix MapLike spam for missing key 'selector' diff --git a/src/main/java/net/minecraft/world/level/gameevent/vibrations/VibrationSystem.java b/src/main/java/net/minecraft/world/level/gameevent/vibrations/VibrationSystem.java -index 8c8c16ce53f5bdf88274cb80767decf0a2612637..d4288ae84c08ff6cb2f6763eeb9c358d5bf38f55 100644 +index 8c8c16ce53f5bdf88274cb80767decf0a2612637..0efe935e1f0a25bff95cdb849117b222ae8c603e 100644 --- a/src/main/java/net/minecraft/world/level/gameevent/vibrations/VibrationSystem.java +++ b/src/main/java/net/minecraft/world/level/gameevent/vibrations/VibrationSystem.java @@ -353,7 +353,7 @@ public interface VibrationSystem { @@ -13,7 +13,7 @@ index 8c8c16ce53f5bdf88274cb80767decf0a2612637..d4288ae84c08ff6cb2f6763eeb9c358d return instance.group(VibrationInfo.CODEC.lenientOptionalFieldOf("event").forGetter((vibrationsystem_a) -> { return Optional.ofNullable(vibrationsystem_a.currentVibration); - }), VibrationSelector.CODEC.fieldOf("selector").forGetter(VibrationSystem.Data::getSelectionStrategy), ExtraCodecs.NON_NEGATIVE_INT.fieldOf("event_delay").orElse(0).forGetter(VibrationSystem.Data::getTravelTimeInTicks)).apply(instance, (optional, vibrationselector, integer) -> { -+ }), Codec.optionalField("selector", VibrationSelector.CODEC).xmap(o -> o.orElseGet(VibrationSelector::new), Optional::of).forGetter(VibrationSystem.Data::getSelectionStrategy), ExtraCodecs.NON_NEGATIVE_INT.fieldOf("event_delay").orElse(0).forGetter(VibrationSystem.Data::getTravelTimeInTicks)).apply(instance, (optional, vibrationselector, integer) -> { // Paper - fix MapLike spam for missing "selector" in 1.19.2 ++ }), VibrationSelector.CODEC.optionalFieldOf("selector").xmap(o -> o.orElseGet(VibrationSelector::new), Optional::of).forGetter(VibrationSystem.Data::getSelectionStrategy), ExtraCodecs.NON_NEGATIVE_INT.fieldOf("event_delay").orElse(0).forGetter(VibrationSystem.Data::getTravelTimeInTicks)).apply(instance, (optional, vibrationselector, integer) -> { // Paper - fix MapLike spam for missing "selector" in 1.19.2 return new VibrationSystem.Data((VibrationInfo) optional.orElse(null), vibrationselector, integer, true); // CraftBukkit - decompile error }); }); diff --git a/patches/server/0866-Fix-BanList-API.patch b/patches/server/0866-Fix-BanList-API.patch index e4e7e8a14b..ad75aaf764 100644 --- a/patches/server/0866-Fix-BanList-API.patch +++ b/patches/server/0866-Fix-BanList-API.patch @@ -208,7 +208,7 @@ index 172202accf4448a933fcf1ff820316c7910dd7f7..50ee7656580d386db473c054f5c5ec57 return null; } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 12a096d20d254a9cbdfc28b923afef474fa5698f..661789f7e26496162b6d86d698fd91aab5f5fe0d 100644 +index 7c039d79b6fba3358daaaf8894e05d9493fa6af8..1c264135c34117407bfbb2d230e2ea1f9ebd0671 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -1733,23 +1733,23 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/patches/server/0885-Bandaid-fix-for-Effect.patch b/patches/server/0885-Bandaid-fix-for-Effect.patch index 736ca0c37a..8700267771 100644 --- a/patches/server/0885-Bandaid-fix-for-Effect.patch +++ b/patches/server/0885-Bandaid-fix-for-Effect.patch @@ -65,7 +65,7 @@ index 0c5c67480e16333641f4ebc89d892f7a0e2387fd..18c1cceb9e8b2873b24134a9e0126336 // Special case: the axis is optional for ELECTRIC_SPARK Preconditions.checkArgument(effect.getData() == null || effect == Effect.ELECTRIC_SPARK, "Wrong kind of data for the %s effect", effect); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 661789f7e26496162b6d86d698fd91aab5f5fe0d..d4889bcb83be1f6d8099810b784acbaf764c9885 100644 +index 1c264135c34117407bfbb2d230e2ea1f9ebd0671..463b24fd34f76632b590ad659676ba49090f4bef 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -915,7 +915,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/patches/server/0893-Add-Listing-API-for-Player.patch b/patches/server/0893-Add-Listing-API-for-Player.patch index 22568e6730..280e547dd5 100644 --- a/patches/server/0893-Add-Listing-API-for-Player.patch +++ b/patches/server/0893-Add-Listing-API-for-Player.patch @@ -119,7 +119,7 @@ index ea04eb049e16d1027d15f9863d1fcd16f090c464..0aa28caa1254137c0bae8e213bd08c9a // Paper end - Use single player info update packet on join player.sentListPacket = true; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index d4889bcb83be1f6d8099810b784acbaf764c9885..7cec63cf1d1b33e23cc0a110f3ad0e16bf77ec78 100644 +index 463b24fd34f76632b590ad659676ba49090f4bef..5f5632e7d6d02fbe9f7024b8316414d8aa302d60 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -199,6 +199,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/patches/server/0903-Implement-OfflinePlayer-isConnected.patch b/patches/server/0903-Implement-OfflinePlayer-isConnected.patch index 7e05ab3fb7..45edfbf777 100644 --- a/patches/server/0903-Implement-OfflinePlayer-isConnected.patch +++ b/patches/server/0903-Implement-OfflinePlayer-isConnected.patch @@ -23,7 +23,7 @@ index 4d654c4f0b6210a9841427789ba70ce5d1d308be..9d93130f23addb18b97d7f5ec013faef public String getName() { Player player = this.getPlayer(); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 7cec63cf1d1b33e23cc0a110f3ad0e16bf77ec78..fbeddf9ccb5331598228c4846925268a14a21054 100644 +index 5f5632e7d6d02fbe9f7024b8316414d8aa302d60..8f92ff51647a1919d90219d0cab1710aa9ff7361 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -254,6 +254,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/patches/server/0923-Add-player-idle-duration-API.patch b/patches/server/0923-Add-player-idle-duration-API.patch index c4a929a7e4..3aaeed1d13 100644 --- a/patches/server/0923-Add-player-idle-duration-API.patch +++ b/patches/server/0923-Add-player-idle-duration-API.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Add player idle duration API Implements API for getting and resetting a player's idle duration. diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index fbeddf9ccb5331598228c4846925268a14a21054..6365418ed2aa478b19312cdbf6cefd8d44d96db2 100644 +index 8f92ff51647a1919d90219d0cab1710aa9ff7361..e2986f07a7f7a3f15275fa6366ebaaf65019036d 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -3395,6 +3395,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -3394,6 +3394,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } // Paper end diff --git a/patches/server/0926-Allow-null-itemstack-for-Player-sendEquipmentChange.patch b/patches/server/0926-Allow-null-itemstack-for-Player-sendEquipmentChange.patch index 529a4a83c0..2778d6eb28 100644 --- a/patches/server/0926-Allow-null-itemstack-for-Player-sendEquipmentChange.patch +++ b/patches/server/0926-Allow-null-itemstack-for-Player-sendEquipmentChange.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Allow null itemstack for Player#sendEquipmentChange diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 6365418ed2aa478b19312cdbf6cefd8d44d96db2..1bcb5f28b37473ac9079638669dff6f60a614cf9 100644 +index e2986f07a7f7a3f15275fa6366ebaaf65019036d..483221803ec1f1c78da1f83ccf42b041cb782d7a 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -1125,7 +1125,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/patches/server/0947-Add-experience-points-API.patch b/patches/server/0947-Add-experience-points-API.patch index 2cd4426a45..cdd4f08f67 100644 --- a/patches/server/0947-Add-experience-points-API.patch +++ b/patches/server/0947-Add-experience-points-API.patch @@ -18,7 +18,7 @@ index 230ffd3c4541ef8979605d733b6463e39cd00206..446556028028b25c35dbf3d099bf14a5 // Paper start - send while respecting visibility private static void sendSoundEffect(Player fromEntity, double x, double y, double z, SoundEvent soundEffect, SoundSource soundCategory, float volume, float pitch) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 1bcb5f28b37473ac9079638669dff6f60a614cf9..41d6f164251d1de4663383a024e9edd5257f97f3 100644 +index 483221803ec1f1c78da1f83ccf42b041cb782d7a..e1af41a8d938420694a5342f08b811615dc46003 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -1902,6 +1902,49 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/patches/server/0952-Fixup-NamespacedKey-handling.patch b/patches/server/0952-Fixup-NamespacedKey-handling.patch index 2666cb6589..20c52c2fba 100644 --- a/patches/server/0952-Fixup-NamespacedKey-handling.patch +++ b/patches/server/0952-Fixup-NamespacedKey-handling.patch @@ -5,28 +5,28 @@ Subject: [PATCH] Fixup NamespacedKey handling diff --git a/src/main/java/com/destroystokyo/paper/loottable/PaperContainerEntityLootableInventory.java b/src/main/java/com/destroystokyo/paper/loottable/PaperContainerEntityLootableInventory.java -index 9ca389ca789dc54bba3542cac0aac2e1dc66c870..15173e715fa36546820d930a46e0f0c493d07cfc 100644 +index 7f5283a8ee74253e326fe994f20ae00cf3c75e1b..183f31c81d9c0a966e6b20c2cff3d279dfc7e622 100644 --- a/src/main/java/com/destroystokyo/paper/loottable/PaperContainerEntityLootableInventory.java +++ b/src/main/java/com/destroystokyo/paper/loottable/PaperContainerEntityLootableInventory.java -@@ -17,7 +17,7 @@ public class PaperContainerEntityLootableInventory implements PaperLootableEntit +@@ -20,7 +20,7 @@ public class PaperContainerEntityLootableInventory implements PaperLootableEntit @Override public org.bukkit.loot.LootTable getLootTable() { -- return entity.getLootTable() != null ? Bukkit.getLootTable(CraftNamespacedKey.fromMinecraft(entity.getLootTable())) : null; -+ return entity.getLootTable() != null && !entity.getLootTable().getPath().isEmpty() ? Bukkit.getLootTable(CraftNamespacedKey.fromMinecraft(entity.getLootTable())) : null; +- return entity.getLootTable() != null ? Optionull.map(entity.getLootTable(), rk -> Bukkit.getLootTable(CraftNamespacedKey.fromMinecraft(rk.location()))) : null; ++ return entity.getLootTable() != null && !entity.getLootTable().location().getPath().isEmpty() ? Optionull.map(entity.getLootTable(), rk -> Bukkit.getLootTable(CraftNamespacedKey.fromMinecraft(rk.location()))) : null; } @Override diff --git a/src/main/java/com/destroystokyo/paper/loottable/PaperTileEntityLootableInventory.java b/src/main/java/com/destroystokyo/paper/loottable/PaperTileEntityLootableInventory.java -index 9cfa5d36a6991067a3866e0d437749fafcc0158e..2ee4ee14ab3345486dad6b24fd9a4fcc6c746b99 100644 +index fb72bdea520ccc0928cfbda0569e02a1917a7e86..6f6e19b7b57cb3070ef5b6810d8449344705af8c 100644 --- a/src/main/java/com/destroystokyo/paper/loottable/PaperTileEntityLootableInventory.java +++ b/src/main/java/com/destroystokyo/paper/loottable/PaperTileEntityLootableInventory.java -@@ -15,7 +15,7 @@ public class PaperTileEntityLootableInventory implements PaperLootableBlockInven +@@ -17,7 +17,7 @@ public class PaperTileEntityLootableInventory implements PaperLootableBlockInven @Override public org.bukkit.loot.LootTable getLootTable() { -- return tileEntityLootable.lootTable != null ? Bukkit.getLootTable(CraftNamespacedKey.fromMinecraft(tileEntityLootable.lootTable)) : null; -+ return tileEntityLootable.lootTable != null && !tileEntityLootable.lootTable.getPath().isEmpty() ? Bukkit.getLootTable(CraftNamespacedKey.fromMinecraft(tileEntityLootable.lootTable)) : null; +- return tileEntityLootable.lootTable != null ? Bukkit.getLootTable(CraftNamespacedKey.fromMinecraft(tileEntityLootable.lootTable.location())) : null; ++ return tileEntityLootable.lootTable != null && !tileEntityLootable.lootTable.location().getPath().isEmpty() ? Bukkit.getLootTable(CraftNamespacedKey.fromMinecraft(tileEntityLootable.lootTable.location())) : null; } @Override diff --git a/patches/server/0953-Expose-LootTable-of-DecoratedPot.patch b/patches/server/0953-Expose-LootTable-of-DecoratedPot.patch index c3556cc29b..6b5fd029f3 100644 --- a/patches/server/0953-Expose-LootTable-of-DecoratedPot.patch +++ b/patches/server/0953-Expose-LootTable-of-DecoratedPot.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Expose LootTable of DecoratedPot diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftDecoratedPot.java b/src/main/java/org/bukkit/craftbukkit/block/CraftDecoratedPot.java -index 6e0258d4d6a07e0f471640a9edda0adf7ef6cd9e..34ed28be8ac79181e6cd29a38b923cd16e6d25da 100644 +index 6e0258d4d6a07e0f471640a9edda0adf7ef6cd9e..6015565aeedc1b2cdddcdb488f8de71bc84b61f2 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftDecoratedPot.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftDecoratedPot.java @@ -43,6 +43,39 @@ public class CraftDecoratedPot extends CraftBlockEntityState key = (table == null) ? null : net.minecraft.resources.ResourceKey.create(net.minecraft.core.registries.Registries.LOOT_TABLE, org.bukkit.craftbukkit.util.CraftNamespacedKey.toMinecraft(table.getKey())); + this.getSnapshot().setLootTable(key, seed); + } + @@ -30,8 +30,8 @@ index 6e0258d4d6a07e0f471640a9edda0adf7ef6cd9e..34ed28be8ac79181e6cd29a38b923cd1 + return null; + } + -+ net.minecraft.resources.ResourceLocation key = this.getSnapshot().getLootTable(); -+ return org.bukkit.Bukkit.getLootTable(org.bukkit.craftbukkit.util.CraftNamespacedKey.fromMinecraft(key)); ++ net.minecraft.resources.ResourceKey key = this.getSnapshot().getLootTable(); ++ return org.bukkit.Bukkit.getLootTable(org.bukkit.craftbukkit.util.CraftNamespacedKey.fromMinecraft(key.location())); + } + + @Override diff --git a/patches/server/0961-Add-FluidState-API.patch b/patches/server/0961-Add-FluidState-API.patch index a50c185925..de7b959ccc 100644 --- a/patches/server/0961-Add-FluidState-API.patch +++ b/patches/server/0961-Add-FluidState-API.patch @@ -191,7 +191,7 @@ index 0e307c2bb788c1ec856613b0203f5fc7aca7e85d..1d16cd01e55f3e5bb8f49ad4c9f777d3 public BlockData getBlockData(Location location) { return this.getBlockData(location.getBlockX(), location.getBlockY(), location.getBlockZ()); diff --git a/src/main/java/org/bukkit/craftbukkit/generator/CraftLimitedRegion.java b/src/main/java/org/bukkit/craftbukkit/generator/CraftLimitedRegion.java -index 06ab1ac654e0c6f0ab7208783d186ed306ce204f..032ad671d232ab6f199c1d23f17de43a633587e7 100644 +index eaa9ba70b0b80d86eb376a0641420093a7c9dfdb..25598df0bb0d4347b2c17b6ec0afbfe4ecf808b9 100644 --- a/src/main/java/org/bukkit/craftbukkit/generator/CraftLimitedRegion.java +++ b/src/main/java/org/bukkit/craftbukkit/generator/CraftLimitedRegion.java @@ -303,4 +303,11 @@ public class CraftLimitedRegion extends CraftRegionAccessor implements LimitedRe diff --git a/patches/server/0980-Rewrite-dataconverter-system.patch b/patches/server/0980-Rewrite-dataconverter-system.patch index 773fa28d9a..01f755303a 100644 --- a/patches/server/0980-Rewrite-dataconverter-system.patch +++ b/patches/server/0980-Rewrite-dataconverter-system.patch @@ -28832,10 +28832,10 @@ index cf44d7b48c774d4c2431d42e352b42d200ee1b71..fa4f9afb421c7924557372cbb2f20caf public CompletableFuture synchronize(boolean sync) { diff --git a/src/main/java/net/minecraft/world/level/levelgen/structure/StructureCheck.java b/src/main/java/net/minecraft/world/level/levelgen/structure/StructureCheck.java -index aae73586265593ee7830fb8dd5c2e3d7560057f0..97a0ce3044457d22ad532e24f3330c85f73f12dc 100644 +index c6181e14d85d454506534f9bbe856156c0d4a062..609100ed7aa0b23aa5a9c6fbf6878ea320bd3a93 100644 --- a/src/main/java/net/minecraft/world/level/levelgen/structure/StructureCheck.java +++ b/src/main/java/net/minecraft/world/level/levelgen/structure/StructureCheck.java -@@ -137,7 +137,7 @@ public class StructureCheck { +@@ -151,7 +151,7 @@ public class StructureCheck { CompoundTag compoundTag2; try { diff --git a/patches/server/0985-Rewrite-chunk-system.patch b/patches/server/0985-Rewrite-chunk-system.patch index 738116a3f5..ada3a3b153 100644 --- a/patches/server/0985-Rewrite-chunk-system.patch +++ b/patches/server/0985-Rewrite-chunk-system.patch @@ -21221,7 +21221,7 @@ index 5d15c228c044a36c67014793decb314240cf6be1..dc765b92cc90f5f370254e68bbbdfa5a while (iterator.hasNext()) { diff --git a/src/main/java/net/minecraft/world/level/levelgen/structure/StructureCheck.java b/src/main/java/net/minecraft/world/level/levelgen/structure/StructureCheck.java -index 97a0ce3044457d22ad532e24f3330c85f73f12dc..fdf5afdba68cdeddb351ac3932057a1aa2d3167f 100644 +index 609100ed7aa0b23aa5a9c6fbf6878ea320bd3a93..7068657b28a9bc175ee23f5a18defb41168f1d76 100644 --- a/src/main/java/net/minecraft/world/level/levelgen/structure/StructureCheck.java +++ b/src/main/java/net/minecraft/world/level/levelgen/structure/StructureCheck.java @@ -47,8 +47,101 @@ public class StructureCheck { @@ -21328,7 +21328,7 @@ index 97a0ce3044457d22ad532e24f3330c85f73f12dc..fdf5afdba68cdeddb351ac3932057a1a public StructureCheck( ChunkScanAccess chunkIoWorker, -@@ -76,7 +169,7 @@ public class StructureCheck { +@@ -90,7 +183,7 @@ public class StructureCheck { public StructureCheckResult checkStart(ChunkPos pos, Structure type, StructurePlacement placement, boolean skipReferencedStructures) { long l = pos.toLong(); @@ -21337,8 +21337,8 @@ index 97a0ce3044457d22ad532e24f3330c85f73f12dc..fdf5afdba68cdeddb351ac3932057a1a if (object2IntMap != null) { return this.checkStructureInfo(object2IntMap, type, skipReferencedStructures); } else { -@@ -86,9 +179,9 @@ public class StructureCheck { - } else if (!placement.applyAdditionalChunkRestrictions(pos.x, pos.z, this.seed)) { +@@ -100,9 +193,9 @@ public class StructureCheck { + } else if (!placement.applyAdditionalChunkRestrictions(pos.x, pos.z, this.seed, this.getSaltOverride(type))) { // Paper - add missing structure seed configs return StructureCheckResult.START_NOT_PRESENT; } else { - boolean bl = this.featureChecks @@ -21350,7 +21350,7 @@ index 97a0ce3044457d22ad532e24f3330c85f73f12dc..fdf5afdba68cdeddb351ac3932057a1a return !bl ? StructureCheckResult.START_NOT_PRESENT : StructureCheckResult.CHUNK_LOAD_NEEDED; } } -@@ -214,15 +307,26 @@ public class StructureCheck { +@@ -228,15 +321,26 @@ public class StructureCheck { } private void storeFullResults(long pos, Object2IntMap referencesByStructure) { @@ -21649,10 +21649,10 @@ index 4b6a04e47f5d4c071607516519098fab317dcf12..01fc74e6cc8ea8808b821583afb26309 // Paper start - implement pointers diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 41d6f164251d1de4663383a024e9edd5257f97f3..2d232a5e978baaedab4665ac389187f8d81c5484 100644 +index e1af41a8d938420694a5342f08b811615dc46003..33c553d1558b3cdfac22948f3878e1a31d70f02b 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -3458,31 +3458,31 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -3457,31 +3457,31 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public int getViewDistance() { diff --git a/patches/server/1024-Properly-resend-entities.patch b/patches/server/1024-Properly-resend-entities.patch index 26e6823751..4ac71e7b7c 100644 --- a/patches/server/1024-Properly-resend-entities.patch +++ b/patches/server/1024-Properly-resend-entities.patch @@ -81,7 +81,7 @@ index abb9a86cd42a34cf722a312068134e820ac21956..f168044d36f22080504da171e5ed31a6 } } diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index ae927c2cdf151b901822636a2543668f85946430..b1e78d2bf20dc5ee93090615cce39d9f0ce0d80f 100644 +index ae927c2cdf151b901822636a2543668f85946430..ea7a2db0d71a69a6f67fda032f01c9a126bd3100 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -2004,6 +2004,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -97,7 +97,7 @@ index ae927c2cdf151b901822636a2543668f85946430..b1e78d2bf20dc5ee93090615cce39d9f // Entity in bucket - SPIGOT-4048 and SPIGOT-6859a if ((entity instanceof Bucketable && entity instanceof LivingEntity && origItem != null && origItem.asItem() == Items.WATER_BUCKET) && (event.isCancelled() || ServerGamePacketListenerImpl.this.player.getInventory().getSelected() == null || ServerGamePacketListenerImpl.this.player.getInventory().getSelected().getItem() != origItem)) { - ServerGamePacketListenerImpl.this.send(new ClientboundAddEntityPacket(entity)); -+ entity.getEntityData().resendPossiblyDesyncedEntityData(player); // Paper - The entire mob gets deleted, so resend it. ++ entity.resendPossiblyDesyncedEntityData(ServerGamePacketListenerImpl.this.player); // Paper - The entire mob gets deleted, so resend it. ServerGamePacketListenerImpl.this.player.containerMenu.sendAllDataToRemote(); } diff --git a/patches/server/1035-API-for-checking-sent-chunks.patch b/patches/server/1035-API-for-checking-sent-chunks.patch index 76acdb85e6..6187f99887 100644 --- a/patches/server/1035-API-for-checking-sent-chunks.patch +++ b/patches/server/1035-API-for-checking-sent-chunks.patch @@ -21,10 +21,10 @@ index ee58c67cb2bd78159cce19ec75f13dc6168a0e7a..149cfb0587299f72fcfddf395fb71b70 // TODO rebase into util patch diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 2d232a5e978baaedab4665ac389187f8d81c5484..2ec4d1e930b6cd02e105f5edb60493f060041589 100644 +index 33c553d1558b3cdfac22948f3878e1a31d70f02b..eddbbd0e9be3cb81d1030c0c9da829b9193ebc16 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -3450,6 +3450,35 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -3449,6 +3449,35 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } // Paper end