diff options
Diffstat (limited to 'patches/server')
168 files changed, 964 insertions, 745 deletions
diff --git a/patches/server/0003-Build-system-changes.patch b/patches/server/0003-Build-system-changes.patch index 3642230481..0961be72a4 100644 --- a/patches/server/0003-Build-system-changes.patch +++ b/patches/server/0003-Build-system-changes.patch @@ -131,7 +131,7 @@ index feca36209fd2405fab70f564f63e627b8b78ac18..396ec10a76bdadbf5be2f0e15e88eed4 public static PackRepository createPackRepository(Path dataPacksPath, DirectoryValidator symlinkFinder) { diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index 5595eb892fa868508c45448942da65d7c11d49fd..4b8602b168f9dd386aa72b4e5d189c441c93542e 100644 +index 9c232b6eb11d87420fb24a668a2043581cca3bd2..5f73afa688fd1c83af17e6f566862cd5e2603ff3 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -210,7 +210,7 @@ public class Main { @@ -142,7 +142,7 @@ index 5595eb892fa868508c45448942da65d7c11d49fd..4b8602b168f9dd386aa72b4e5d189c44 + Date buildDate = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss Z").parse(Main.class.getPackage().getImplementationVendor()); // Paper Calendar deadline = Calendar.getInstance(); - deadline.add(Calendar.DAY_OF_YEAR, -3); + deadline.add(Calendar.DAY_OF_YEAR, -7); diff --git a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java index 93046379d0cefd5d3236fc59e698809acdc18f80..774556a62eb240da42e84db4502e2ed43495be17 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java diff --git a/patches/server/0008-CB-fixes.patch b/patches/server/0008-CB-fixes.patch index 1062e3ebb7..178007d7bd 100644 --- a/patches/server/0008-CB-fixes.patch +++ b/patches/server/0008-CB-fixes.patch @@ -102,7 +102,7 @@ index f1302dfb68bf8e4e1f4d8b084ad81422f65eecc4..fe0f57dbeecc4b5a0c81863f33e41d11 @Override diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index 1e3ca7ca98abfd5be233a7eeb6dad201776d2d6a..9ec50bbb262b25fea157ae48e8395f5cd38f8906 100644 +index e2bfbedce18c4ecb01ffcc44d495e72b76806a92..7e3c4c8a4d87e0c616a9fb98f09d89c93597bb23 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -123,6 +123,7 @@ public class Main { @@ -134,10 +134,10 @@ index 905adf97c0d1f0d1c774a6835a5dffcfea884e58..c017ce2ca1bc535795c958a2e509af2a public class CraftScheduler implements BukkitScheduler { diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 4c3c9c0e01ba8eeb9bd3f31cd795445cf03f8278..e08d4a45e313ef1b9005ef00ee0185a188171207 100644 +index cfb4cf66aa5f32a96a15886c6cf4a3946bd232ec..aa6a9dcd5528df38dddc0c661334c35658a19cee 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -244,7 +244,7 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -240,7 +240,7 @@ public final class CraftMagicNumbers implements UnsafeValues { try { nmsStack.applyComponents(new ItemParser(Commands.createValidationContext(MinecraftServer.getDefaultRegistryAccess())).parse(new StringReader(arguments)).components()); } catch (CommandSyntaxException ex) { diff --git a/patches/server/0009-MC-Utils.patch b/patches/server/0009-MC-Utils.patch index c12a8e7c5c..653f48c157 100644 --- a/patches/server/0009-MC-Utils.patch +++ b/patches/server/0009-MC-Utils.patch @@ -4864,7 +4864,7 @@ index 9d11fcb3df12182ae00ce73f7e30091fd199a341..eea8bafd98e3a8d82b3216488537ab89 public ServerLevel(MinecraftServer minecraftserver, Executor executor, LevelStorageSource.LevelStorageAccess convertable_conversionsession, PrimaryLevelData iworlddataserver, ResourceKey<Level> resourcekey, LevelStem worlddimension, ChunkProgressListener worldloadlistener, boolean flag, long i, List<CustomSpawner> list, boolean flag1, @Nullable RandomSequences randomsequences, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider) { // IRegistryCustom.Dimension iregistrycustom_dimension = minecraftserver.registryAccess(); // CraftBukkit - decompile error diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index f6e28e64024549f4562ec4a4ba46a0429d9a9d52..d02e958d74fe4bb97ce36ca04a36bcf7e73de016 100644 +index defe0b30964613cbae5195485aafff21d73ff18e..684dfbcdd4d000ac918c0f77a60c9abf9b30d3a4 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -280,6 +280,8 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player { @@ -4975,7 +4975,7 @@ index 586acbb52b0fcb09cda195b49b6c737a29a4e35e..b0843917caedc32f800c50cc54706ace public Entity(EntityType<?> type, Level world) { this.id = Entity.ENTITY_COUNTER.incrementAndGet(); diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 726354da4a0008c0f09a0ac8a668378c75ee99b0..2345d79ebf1562054cb071ff1786392a937c8243 100644 +index 12db4c5db3d7951df984db03d09d14d808e58699..44d4aee059d74676bffb8b6bc6f6ad4dd96fcb33 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java @@ -282,6 +282,7 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -5634,10 +5634,10 @@ index 508419378c88ba8688edbd5142d9d8ba52396507..a59eebb89d11788b999d1e5cb4fd2f4e + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 91539582b65a87e2ed9901f2837c3148455d2669..c025542b1073ce7e6e30a43744276fd1fa1ca484 100644 +index e130d0aa64d0caaa7760d8de4b1f989523f9de20..45108559bb2e4ae9d33aed5d92b72cbe5c17f553 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2419,4 +2419,34 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2420,4 +2420,34 @@ public class CraftPlayer extends CraftHumanEntity implements Player { return this.spigot; } // Spigot end @@ -5920,10 +5920,10 @@ 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 e08d4a45e313ef1b9005ef00ee0185a188171207..2fc68d129e2fdfd51e310ea5bdfb83322666c87b 100644 +index aa6a9dcd5528df38dddc0c661334c35658a19cee..65b92a787b131984ad3e48d8dd6812e1b433c77f 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -110,8 +110,17 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -106,8 +106,17 @@ public final class CraftMagicNumbers implements UnsafeValues { private static final Map<Item, Material> ITEM_MATERIAL = new HashMap<>(); private static final Map<Material, Item> MATERIAL_ITEM = new HashMap<>(); private static final Map<Material, Block> MATERIAL_BLOCK = new HashMap<>(); @@ -5941,7 +5941,7 @@ index e08d4a45e313ef1b9005ef00ee0185a188171207..2fc68d129e2fdfd51e310ea5bdfb8332 for (Block block : BuiltInRegistries.BLOCK) { BLOCK_MATERIAL.put(block, Material.getMaterial(BuiltInRegistries.BLOCK.getKey(block).getPath().toUpperCase(Locale.ROOT))); } -@@ -162,6 +171,14 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -158,6 +167,14 @@ public final class CraftMagicNumbers implements UnsafeValues { public static ResourceLocation key(Material mat) { return CraftNamespacedKey.toMinecraft(mat.getKey()); } diff --git a/patches/server/0010-Adventure.patch b/patches/server/0010-Adventure.patch index 9d84d97b3c..fff8643fbd 100644 --- a/patches/server/0010-Adventure.patch +++ b/patches/server/0010-Adventure.patch @@ -2699,7 +2699,7 @@ index 9eb987f9d86396d6b7e9d4f3834bea3326640ac7..25d6be308be03815301cfbefdc4199c8 public boolean logIPs() { diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index d02e958d74fe4bb97ce36ca04a36bcf7e73de016..dc92e1cd0a10ec4e6b4ad6145d5fc0a4ef199365 100644 +index 684dfbcdd4d000ac918c0f77a60c9abf9b30d3a4..200993e8c482442a2c7ae4d9551d04708178bb24 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -171,6 +171,7 @@ import net.minecraft.world.item.trading.MerchantOffers; @@ -2974,7 +2974,7 @@ index 8e715261b99bcc19b6f4b9787987c59aa19ba70e..851e4bdf1739736fd193786a6541ffb3 } } diff --git a/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java -index 2c555c5ad05992b19f67b883c3c0ec7018180747..71540687b4212702cdaaad5fd4815fb3eb97ddd6 100644 +index 3848cc836785829c5aa82bdb5d37d36a97f94a04..f08700abb005f487aca95c0457c09cefa9a81be2 100644 --- a/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java @@ -58,7 +58,7 @@ public class ServerStatusPacketListenerImpl implements ServerStatusPacketListene @@ -3627,7 +3627,7 @@ index a59eebb89d11788b999d1e5cb4fd2f4e55e023ab..1e8d93d81b7a391bbd1e9926ff35a68d // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index 9ec50bbb262b25fea157ae48e8395f5cd38f8906..985b77911d03bc60a0210b796e901f31e2676268 100644 +index 7e3c4c8a4d87e0c616a9fb98f09d89c93597bb23..0736cf0b5ea327e73a457b55c9c0c4bb82d4c6e9 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -20,6 +20,12 @@ public class Main { @@ -4015,10 +4015,10 @@ index 1e82312c24cb752d63b165926861fc178cd7849b..7f22950ae61436e91a59cd29a345809c + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java b/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java -index ed6944418382dbd02e5ddbf50c6ac4bb26415807..97a7dc31fe7a2defed2202ccc518c66b7ff4b0da 100644 +index 2d0c82ca240e371a756d71f28e2e04d1aa8e6ad2..f73017bff613bd62b86c974b29576e241c24c927 100644 --- a/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java +++ b/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java -@@ -166,6 +166,12 @@ public class CraftEnchantment extends Enchantment implements Handleable<net.mine +@@ -145,6 +145,12 @@ public class CraftEnchantment extends Enchantment implements Handleable<net.mine CraftEnchantment ench = (CraftEnchantment) other; return !net.minecraft.world.item.enchantment.Enchantment.areCompatible(this.handle, ench.handle); } @@ -4095,7 +4095,7 @@ index d09102fe44dffa61dff883488f47715effaa8211..269326e7689eba91bcfd3475006e8cbf @Override public boolean isPermissionSet(String name) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -index 8ba24b389a16a7f4ec4dcac87f2acfd560d65c34..1010ac55d91559bcb6ebadeea447f32c6aa89226 100644 +index 59107e11f29e2c6dd213966b3000c79eabdbd39b..0c94a1094a3af0232bb2957708fa997933db621b 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java @@ -321,9 +321,12 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { @@ -4113,7 +4113,7 @@ index 8ba24b389a16a7f4ec4dcac87f2acfd560d65c34..1010ac55d91559bcb6ebadeea447f32c player.containerMenu = container; player.initMenu(container); } -@@ -392,8 +395,12 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { +@@ -393,8 +396,12 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { // Now open the window MenuType<?> windowType = CraftContainer.getNotchInventoryType(inventory.getTopInventory()); @@ -4147,7 +4147,7 @@ index 55945b83a5426b352bad9507cc9e94afb1278032..9ea1537408ff2d790747b6e5a681d917 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 c025542b1073ce7e6e30a43744276fd1fa1ca484..03c70d45941822239a0894f910cbaf114b939bec 100644 +index 45108559bb2e4ae9d33aed5d92b72cbe5c17f553..859f3eb2d616156b0efaa70ee03e357e6f0760f3 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -388,14 +388,40 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -4252,7 +4252,7 @@ index c025542b1073ce7e6e30a43744276fd1fa1ca484..03c70d45941822239a0894f910cbaf11 } @@ -481,6 +508,23 @@ public class CraftPlayer extends CraftHumanEntity implements Player { - this.getHandle().connection.disconnect(CraftChatMessage.fromStringOrEmpty(message)); + this.getHandle().connection.disconnect(CraftChatMessage.fromStringOrEmpty(message, true)); } + // Paper start @@ -4313,7 +4313,7 @@ index c025542b1073ce7e6e30a43744276fd1fa1ca484..03c70d45941822239a0894f910cbaf11 SignBlockEntity sign = new SignBlockEntity(CraftLocation.toBlockPosition(loc), Blocks.OAK_SIGN.defaultBlockState()); SignText text = sign.getFrontText(); text = text.setColor(net.minecraft.world.item.DyeColor.byId(dyeColor.getWoolData())); -@@ -1815,7 +1883,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1816,7 +1884,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public void setResourcePack(String url) { @@ -4322,7 +4322,7 @@ index c025542b1073ce7e6e30a43744276fd1fa1ca484..03c70d45941822239a0894f910cbaf11 } @Override -@@ -1830,7 +1898,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1831,7 +1899,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public void setResourcePack(String url, byte[] hash, boolean force) { @@ -4331,7 +4331,7 @@ index c025542b1073ce7e6e30a43744276fd1fa1ca484..03c70d45941822239a0894f910cbaf11 } @Override -@@ -1867,6 +1935,59 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1868,6 +1936,59 @@ public class CraftPlayer extends CraftHumanEntity implements Player { this.handlePushResourcePack(new ClientboundResourcePackPushPacket(id, url, hashStr, force, CraftChatMessage.fromStringOrOptional(prompt, true)), false); } @@ -4391,7 +4391,7 @@ index c025542b1073ce7e6e30a43744276fd1fa1ca484..03c70d45941822239a0894f910cbaf11 @Override public void removeResourcePack(UUID id) { Preconditions.checkArgument(id != null, "Resource pack id cannot be null"); -@@ -2287,6 +2408,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2288,6 +2409,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player { return (this.getHandle().requestedViewDistance() == 0) ? Bukkit.getViewDistance() : this.getHandle().requestedViewDistance(); } @@ -4404,7 +4404,7 @@ index c025542b1073ce7e6e30a43744276fd1fa1ca484..03c70d45941822239a0894f910cbaf11 @Override public int getPing() { return this.getHandle().connection.latency(); -@@ -2337,6 +2464,248 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2338,6 +2465,248 @@ public class CraftPlayer extends CraftHumanEntity implements Player { return this.getHandle().allowsListing(); } @@ -4676,10 +4676,10 @@ index 5725b0281ac53a2354b233223259d6784353bc6e..9ef939b76d06874b856e0c850addb364 @Override public int getLineWidth() { diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 889af27e3fe5ce98b68b3177639c338ca287b024..a29dfbe7aa06113358a2078d927fc53662a5f91f 100644 +index ae357fc3cabd9235488665ef74a3f7c703d64980..3595ff3db5eb0b1da100692702e514cb870220ee 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -907,7 +907,7 @@ public class CraftEventFactory { +@@ -908,7 +908,7 @@ public class CraftEventFactory { return event; } @@ -4886,7 +4886,7 @@ index 9e05a8515c5f6f340182e91150fcad8bbf80a22b..adf22ce4f0bcd3bd57dc2030c6c92d3d @Override public CraftMerchant getCraftMerchant() { diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java -index 61ad00c38cfef8a1de61b4597ec1042428feccf4..4da38ebb7fdbdb0f8fa422ebcd2e3eec2b2be846 100644 +index 3ab6b212001c2b92cac42c0ff97e59c3d08b3e49..552ebe67f87b48734adf0da8ef78dcac9dd670a2 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java @@ -2,8 +2,9 @@ package org.bukkit.craftbukkit.inventory; @@ -5041,24 +5041,15 @@ index 61ad00c38cfef8a1de61b4597ec1042428feccf4..4da38ebb7fdbdb0f8fa422ebcd2e3eec if (this.pages != null) { diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBookSigned.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBookSigned.java -index 2e6f0a0f4bbe4ae3c7c85e679f6187e89d1298ff..c7360e2b2d6e50abc371c21b09cdadd63892f439 100644 +index c71a4971f127fdfc753306019313ce1a31201120..162997fc80dfe2df1f13c802c1b610f04cb9d05a 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBookSigned.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBookSigned.java -@@ -2,7 +2,7 @@ package org.bukkit.craftbukkit.inventory; - - import com.google.common.base.Preconditions; - import com.google.common.collect.ImmutableList; --import com.google.common.collect.ImmutableMap.Builder; -+import com.google.common.collect.ImmutableMap; // Paper - import java.util.ArrayList; - import java.util.Arrays; - import java.util.List; @@ -346,7 +346,7 @@ public class CraftMetaBookSigned extends CraftMetaItem implements BookMeta { } @Override - Builder<String, Object> serialize(Builder<String, Object> builder) { -+ ImmutableMap.Builder<String, Object> serialize(ImmutableMap.Builder<String, Object> builder) { ++ com.google.common.collect.ImmutableMap.Builder<String, Object> serialize(com.google.common.collect.ImmutableMap.Builder<String, Object> builder) { // Paper - adventure - fqn as it conflicts with adventure book builder super.serialize(builder); if (this.hasTitle()) { @@ -5177,7 +5168,7 @@ index 2e6f0a0f4bbe4ae3c7c85e679f6187e89d1298ff..c7360e2b2d6e50abc371c21b09cdadd6 + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -index 607456854e6bce3f7b58469af4ce42b8bacb72fc..9ecbdd50aa2eb7851ce1716946fa31e5db8765b4 100644 +index e56e6d07f297491c8f92598b8105bfebead7a0a1..86a5e4f7b2a0d50d0a58d88e10a277cfbd09bf9d 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java @@ -952,6 +952,18 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -5589,10 +5580,10 @@ index 4d586e1375ed8782939c9d480479e0dd981f8cbc..7900adb0b158bc17dd792dd082c33854 + } diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java b/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java -index 28038c3a531680201dcc8f2716b8f46f3886e769..5a9ddf71dc186c537a23083ac59434fb446a2140 100644 +index ff040613083c015d9c52c0995591b64305fd5018..1b552b3f05ac7fc44450de4b1ec78907a0f62424 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java -@@ -308,6 +308,7 @@ public final class CraftChatMessage { +@@ -264,6 +264,7 @@ public final class CraftChatMessage { public static String fromComponent(Component component) { if (component == null) return ""; @@ -5601,10 +5592,10 @@ index 28038c3a531680201dcc8f2716b8f46f3886e769..5a9ddf71dc186c537a23083ac59434fb 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 2fc68d129e2fdfd51e310ea5bdfb83322666c87b..fb22e04a4a9f039f0e942ff837124b00ca1b12be 100644 +index 65b92a787b131984ad3e48d8dd6812e1b433c77f..1bf1f10f8691922a69cd13c6a4e643b863801b4f 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -81,6 +81,43 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -77,6 +77,43 @@ public final class CraftMagicNumbers implements UnsafeValues { private CraftMagicNumbers() {} diff --git a/patches/server/0019-Paper-Plugins.patch b/patches/server/0019-Paper-Plugins.patch index 8bb43515e2..77003e31d5 100644 --- a/patches/server/0019-Paper-Plugins.patch +++ b/patches/server/0019-Paper-Plugins.patch @@ -7346,10 +7346,10 @@ index 909b2c98e7a9117d2f737245e4661792ffafb744..d96399e9bf1a58db5a4a22e58abb99e7 @Override public FileConfiguration getConfig() { diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index fb22e04a4a9f039f0e942ff837124b00ca1b12be..297767f64c1a7c01cffd6d78e71b60746622f22e 100644 +index 1bf1f10f8691922a69cd13c6a4e643b863801b4f..e8205646dbe7088e6bdece2567151bd7f64f36cb 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -426,6 +426,16 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -412,6 +412,16 @@ public final class CraftMagicNumbers implements UnsafeValues { net.minecraft.world.item.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(itemStack); return nmsItemStack.getItem().getDescriptionId(nmsItemStack); } diff --git a/patches/server/0021-Hook-into-CB-plugin-rewrites.patch b/patches/server/0021-Hook-into-CB-plugin-rewrites.patch index 1bdec9b9e9..26965088ba 100644 --- a/patches/server/0021-Hook-into-CB-plugin-rewrites.patch +++ b/patches/server/0021-Hook-into-CB-plugin-rewrites.patch @@ -8,7 +8,7 @@ our own relocation. Also lets us rewrite NMS calls for when we're debugging in an IDE pre-relocate. diff --git a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java -index 3526ece6c12f76eca93c995018e0f262360e1ba9..51452d8a8969a303be1be5851b251243a5944be3 100644 +index acfb0269e15aba638b87b1e2f483ef96c9552693..8e29fae1be2b4d0b04e7788de7a3802aacae4588 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java +++ b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java @@ -8,6 +8,7 @@ import java.util.ArrayList; @@ -68,7 +68,7 @@ index 3526ece6c12f76eca93c995018e0f262360e1ba9..51452d8a8969a303be1be5851b251243 public static void main(String[] args) { OptionParser parser = new OptionParser(); OptionSpec<File> inputFlag = parser.acceptsAll(Arrays.asList("i", "input")).withRequiredArg().ofType(File.class).required(); -@@ -209,9 +245,49 @@ public class Commodore { +@@ -213,9 +249,49 @@ public class Commodore { @Override public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) { return new MethodVisitor(this.api, super.visitMethod(access, name, desc, signature, exceptions)) { @@ -118,7 +118,7 @@ index 3526ece6c12f76eca93c995018e0f262360e1ba9..51452d8a8969a303be1be5851b251243 name = FieldRename.rename(pluginVersion, owner, name); if (modern) { -@@ -321,6 +397,13 @@ public class Commodore { +@@ -331,6 +407,13 @@ public class Commodore { return; } @@ -132,7 +132,7 @@ index 3526ece6c12f76eca93c995018e0f262360e1ba9..51452d8a8969a303be1be5851b251243 if (modern) { if (owner.equals("org/bukkit/Material") || (instantiatedMethodType != null && instantiatedMethodType.getDescriptor().startsWith("(Lorg/bukkit/Material;)"))) { switch (name) { -@@ -417,6 +500,13 @@ public class Commodore { +@@ -427,6 +510,13 @@ public class Commodore { @Override public void visitLdcInsn(Object value) { @@ -146,7 +146,7 @@ index 3526ece6c12f76eca93c995018e0f262360e1ba9..51452d8a8969a303be1be5851b251243 if (value instanceof String && ((String) value).equals("com.mysql.jdbc.Driver")) { super.visitLdcInsn("com.mysql.cj.jdbc.Driver"); return; -@@ -427,6 +517,14 @@ public class Commodore { +@@ -437,6 +527,14 @@ public class Commodore { @Override public void visitInvokeDynamicInsn(String name, String descriptor, Handle bootstrapMethodHandle, Object... bootstrapMethodArguments) { @@ -161,7 +161,7 @@ index 3526ece6c12f76eca93c995018e0f262360e1ba9..51452d8a8969a303be1be5851b251243 if (bootstrapMethodHandle.getOwner().equals("java/lang/invoke/LambdaMetafactory") && bootstrapMethodHandle.getName().equals("metafactory") && bootstrapMethodArguments.length == 3) { Type samMethodType = (Type) bootstrapMethodArguments[0]; -@@ -443,7 +541,7 @@ public class Commodore { +@@ -453,7 +551,7 @@ public class Commodore { methodArgs.add(new Handle(newOpcode, newOwner, newName, newDescription, newItf)); methodArgs.add(newInstantiated); @@ -170,7 +170,7 @@ index 3526ece6c12f76eca93c995018e0f262360e1ba9..51452d8a8969a303be1be5851b251243 }, implMethod.getTag(), implMethod.getOwner(), implMethod.getName(), implMethod.getDesc(), implMethod.isInterface(), samMethodType, instantiatedMethodType); return; } -@@ -494,6 +592,12 @@ public class Commodore { +@@ -504,6 +602,12 @@ public class Commodore { @Override public FieldVisitor visitField(int access, String name, String descriptor, String signature, Object value) { diff --git a/patches/server/0022-Remap-reflection-calls-in-plugins-using-internals.patch b/patches/server/0022-Remap-reflection-calls-in-plugins-using-internals.patch index 34172199b4..9fa2e3351b 100644 --- a/patches/server/0022-Remap-reflection-calls-in-plugins-using-internals.patch +++ b/patches/server/0022-Remap-reflection-calls-in-plugins-using-internals.patch @@ -645,7 +645,7 @@ index 242811578a786e3807a1a7019d472d5a68f87116..0b65fdf53124f3dd042b2363b1b8df8e return traceElements; } diff --git a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java -index 51452d8a8969a303be1be5851b251243a5944be3..8757d4de8a589355b83690d37d9e81ce3cc6ae32 100644 +index 8e29fae1be2b4d0b04e7788de7a3802aacae4588..0bde8fc63d892cb615638769ca84beba9da80ff2 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java +++ b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java @@ -86,36 +86,26 @@ public class Commodore { @@ -706,10 +706,10 @@ index 51452d8a8969a303be1be5851b251243a5944be3..8757d4de8a589355b83690d37d9e81ce String className; boolean isInterface; diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 297767f64c1a7c01cffd6d78e71b60746622f22e..d551c9d898d8b5128dfef84d206396c84072abe4 100644 +index e8205646dbe7088e6bdece2567151bd7f64f36cb..10b5fcf6575255000e52166eb73b60f6a3f88e84 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -361,7 +361,7 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -357,7 +357,7 @@ public final class CraftMagicNumbers implements UnsafeValues { throw new InvalidPluginException("Plugin API version " + pdf.getAPIVersion() + " is lower than the minimum allowed version. Please update or replace it."); } @@ -718,7 +718,7 @@ index 297767f64c1a7c01cffd6d78e71b60746622f22e..d551c9d898d8b5128dfef84d206396c8 CraftLegacy.init(); } -@@ -376,6 +376,7 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -372,6 +372,7 @@ public final class CraftMagicNumbers implements UnsafeValues { @Override public byte[] processClass(PluginDescriptionFile pdf, String path, byte[] clazz) { diff --git a/patches/server/0023-Timings-v2.patch b/patches/server/0023-Timings-v2.patch index 3ed1b8f74e..5b034492d8 100644 --- a/patches/server/0023-Timings-v2.patch +++ b/patches/server/0023-Timings-v2.patch @@ -1379,7 +1379,7 @@ index e465aaa4fd29b4966ea8d88316c6d8f217da2e73..474f020371bb9e5fd2c5b22e44d79029 } diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 2345d79ebf1562054cb071ff1786392a937c8243..bb5e2fd7b8d9b8bec71d8c945d266765c42d3927 100644 +index 44d4aee059d74676bffb8b6bc6f6ad4dd96fcb33..97ad63aad3c559feb1e762af1e00fd550aa5b251 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java @@ -156,7 +156,7 @@ import org.bukkit.event.entity.EntityTeleportEvent; @@ -1391,7 +1391,7 @@ index 2345d79ebf1562054cb071ff1786392a937c8243..bb5e2fd7b8d9b8bec71d8c945d266765 public abstract class LivingEntity extends Entity implements Attackable { -@@ -2949,7 +2949,6 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -2977,7 +2977,6 @@ public abstract class LivingEntity extends Entity implements Attackable { @Override public void tick() { @@ -1399,7 +1399,7 @@ index 2345d79ebf1562054cb071ff1786392a937c8243..bb5e2fd7b8d9b8bec71d8c945d266765 super.tick(); this.updatingUsingItem(); this.updateSwimAmount(); -@@ -2991,9 +2990,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3019,9 +3018,7 @@ public abstract class LivingEntity extends Entity implements Attackable { } if (!this.isRemoved()) { @@ -1409,7 +1409,7 @@ index 2345d79ebf1562054cb071ff1786392a937c8243..bb5e2fd7b8d9b8bec71d8c945d266765 } double d0 = this.getX() - this.xo; -@@ -3084,7 +3081,6 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3112,7 +3109,6 @@ public abstract class LivingEntity extends Entity implements Attackable { this.refreshDimensions(); } @@ -1417,7 +1417,7 @@ index 2345d79ebf1562054cb071ff1786392a937c8243..bb5e2fd7b8d9b8bec71d8c945d266765 } public void detectEquipmentUpdatesPublic() { // CraftBukkit -@@ -3300,7 +3296,6 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3328,7 +3324,6 @@ public abstract class LivingEntity extends Entity implements Attackable { this.setDeltaMovement(d0, d1, d2); this.level().getProfiler().push("ai"); @@ -1425,7 +1425,7 @@ index 2345d79ebf1562054cb071ff1786392a937c8243..bb5e2fd7b8d9b8bec71d8c945d266765 if (this.isImmobile()) { this.jumping = false; this.xxa = 0.0F; -@@ -3310,7 +3305,6 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3338,7 +3333,6 @@ public abstract class LivingEntity extends Entity implements Attackable { this.serverAiStep(); this.level().getProfiler().pop(); } @@ -1433,7 +1433,7 @@ index 2345d79ebf1562054cb071ff1786392a937c8243..bb5e2fd7b8d9b8bec71d8c945d266765 this.level().getProfiler().pop(); this.level().getProfiler().push("jump"); -@@ -3350,7 +3344,6 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3378,7 +3372,6 @@ public abstract class LivingEntity extends Entity implements Attackable { this.resetFallDistance(); } @@ -1441,7 +1441,7 @@ index 2345d79ebf1562054cb071ff1786392a937c8243..bb5e2fd7b8d9b8bec71d8c945d266765 label104: { LivingEntity entityliving = this.getControllingPassenger(); -@@ -3364,7 +3357,6 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3392,7 +3385,6 @@ public abstract class LivingEntity extends Entity implements Attackable { this.travel(vec3d1); } @@ -1449,7 +1449,7 @@ index 2345d79ebf1562054cb071ff1786392a937c8243..bb5e2fd7b8d9b8bec71d8c945d266765 this.level().getProfiler().pop(); this.level().getProfiler().push("freezing"); -@@ -3391,9 +3383,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3419,9 +3411,7 @@ public abstract class LivingEntity extends Entity implements Attackable { this.checkAutoSpinAttack(axisalignedbb, this.getBoundingBox()); } @@ -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 03c70d45941822239a0894f910cbaf114b939bec..0a4d672adf9684b483964414cc14a58001aca508 100644 +index 859f3eb2d616156b0efaa70ee03e357e6f0760f3..a02e5c967d9dfcd507e1019d28ed3735945f9613 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2781,6 +2781,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2782,6 +2782,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)); } @@ -2005,10 +2005,10 @@ index f97eccb6a17c7876e1e002d798eb67bbe80571a0..76effc345d362047e64d064eb64a5222 + } // Paper } diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index d551c9d898d8b5128dfef84d206396c84072abe4..99f134d03b76e867a3e5084c5c89e53c74d8e7af 100644 +index 10b5fcf6575255000e52166eb73b60f6a3f88e84..a356d4d19e4b7a3d08c80a137609d1ed9db7c1b1 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -217,6 +217,12 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -213,6 +213,12 @@ public final class CraftMagicNumbers implements UnsafeValues { } // Paper end // ======================================================================== @@ -2021,7 +2021,7 @@ index d551c9d898d8b5128dfef84d206396c84072abe4..99f134d03b76e867a3e5084c5c89e53c public static byte toLegacyData(BlockState data) { return CraftLegacy.toLegacyData(data); -@@ -467,6 +473,12 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -453,6 +459,12 @@ public final class CraftMagicNumbers implements UnsafeValues { public DamageSource.Builder createDamageSourceBuilder(DamageType damageType) { return new CraftDamageSourceBuilder(damageType); } diff --git a/patches/server/0034-Expose-server-build-information.patch b/patches/server/0034-Expose-server-build-information.patch index 3540ec8999..4b12a0b98f 100644 --- a/patches/server/0034-Expose-server-build-information.patch +++ b/patches/server/0034-Expose-server-build-information.patch @@ -598,7 +598,7 @@ index a2f784b28c0d974ee45d61d6a3a0096dd7161d3e..7c97ec4aa57562a8383a40e493eaa8a3 public List<CraftPlayer> getOnlinePlayers() { return this.playerView; diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index bc664b090e16ed27ba795c204dc5639679e6eee8..9dc72b01092783c436bc1fa8ce29ff7cdaa39b19 100644 +index bd21da04390e486731a260f8fb0c70921320198e..14f63c179428bee61d3b931ea309f4c94b89a6cc 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -15,6 +15,7 @@ import joptsimple.OptionSet; @@ -610,7 +610,7 @@ index bc664b090e16ed27ba795c204dc5639679e6eee8..9dc72b01092783c436bc1fa8ce29ff7c public static boolean useConsole = true; @@ -252,13 +253,26 @@ public class Main { - deadline.add(Calendar.DAY_OF_YEAR, -3); + deadline.add(Calendar.DAY_OF_YEAR, -7); if (buildDate.before(deadline.getTime())) { System.err.println("*** Error, this build is outdated ***"); - System.err.println("*** Please download a new build as per instructions from https://www.spigotmc.org/go/outdated-spigot ***"); @@ -638,10 +638,10 @@ index bc664b090e16ed27ba795c204dc5639679e6eee8..9dc72b01092783c436bc1fa8ce29ff7c net.minecraft.server.Main.main(options); } catch (Throwable t) { diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 99f134d03b76e867a3e5084c5c89e53c74d8e7af..7800e0a5aa381181d6a19d55f90490154de05c04 100644 +index a356d4d19e4b7a3d08c80a137609d1ed9db7c1b1..e85faddc157869824e30426a7ca2c577552aea9c 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -478,6 +478,11 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -464,6 +464,11 @@ public final class CraftMagicNumbers implements UnsafeValues { public String getTimingsServerName() { return io.papermc.paper.configuration.GlobalConfiguration.get().timings.serverName; } diff --git a/patches/server/0035-Player-affects-spawning-API.patch b/patches/server/0035-Player-affects-spawning-API.patch index 825077ccab..2658310aaf 100644 --- a/patches/server/0035-Player-affects-spawning-API.patch +++ b/patches/server/0035-Player-affects-spawning-API.patch @@ -73,10 +73,10 @@ index 393a9c704f4637a0e8031328d2a0facef4723dd8..d97c3c139f10a45febc0cfb1057ff6e3 entityzombie.finalizeSpawn(worldserver, this.level().getCurrentDifficultyAt(entityzombie.blockPosition()), MobSpawnType.REINFORCEMENT, (SpawnGroupData) null); worldserver.addFreshEntityWithPassengers(entityzombie, CreatureSpawnEvent.SpawnReason.REINFORCEMENTS); // CraftBukkit diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java -index f652859457171759f72800df7a8d5475a0486759..0d1d8ad353ff2f2bd478cfdc2f6bebad5203e190 100644 +index 56f4d85d0d2014dfe4fb2598fa813ffc4a768d25..ba279ab6ec0ab41309607333b62a941e35dbf581 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java -@@ -194,6 +194,7 @@ public abstract class Player extends LivingEntity { +@@ -195,6 +195,7 @@ public abstract class Player extends LivingEntity { public Entity currentExplosionCause; private boolean ignoreFallDamageFromCurrentImpulse; private int currentImpulseContextResetGraceTime; @@ -135,10 +135,10 @@ 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 0a4d672adf9684b483964414cc14a58001aca508..96300cb91f734f45ca9bcf8b7a8e727049325144 100644 +index a02e5c967d9dfcd507e1019d28ed3735945f9613..69b4e27c6939f5a20276922714601b02d2832517 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2424,6 +2424,17 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2425,6 +2425,17 @@ public class CraftPlayer extends CraftHumanEntity implements Player { return this.getHandle().language; } diff --git a/patches/server/0036-Only-refresh-abilities-if-needed.patch b/patches/server/0036-Only-refresh-abilities-if-needed.patch index 0a3babbee6..4408550aa7 100644 --- a/patches/server/0036-Only-refresh-abilities-if-needed.patch +++ b/patches/server/0036-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 96300cb91f734f45ca9bcf8b7a8e727049325144..a9df824ae0a28256f3469e085c891a3a2af0fd30 100644 +index 69b4e27c6939f5a20276922714601b02d2832517..54ccf79ce6a9ca6c7ad63adb8b1bc32c1b373800 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2092,12 +2092,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2093,12 +2093,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public void setFlying(boolean value) { diff --git a/patches/server/0049-Use-null-Locale-by-default.patch b/patches/server/0049-Use-null-Locale-by-default.patch index e731a4f4c4..dd2e7cabdc 100644 --- a/patches/server/0049-Use-null-Locale-by-default.patch +++ b/patches/server/0049-Use-null-Locale-by-default.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Use null Locale by default diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 9f38010f247694e1014c9c93bfcf46d103d8fd20..1115655b1e8090c52840e85b75265da881bbc713 100644 +index 05103127d0ae220d3a27ba2bfbaa13d80ef7df7b..a9ab5b98296fe6d28d9087a7f171a0c110bc42e6 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -236,7 +236,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player { @@ -36,10 +36,10 @@ index 9f38010f247694e1014c9c93bfcf46d103d8fd20..1115655b1e8090c52840e85b75265da8 this.server.server.getPluginManager().callEvent(event); } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index a9df824ae0a28256f3469e085c891a3a2af0fd30..4079cf3d515718a18b41333fbdc96d0c8f56648a 100644 +index 54ccf79ce6a9ca6c7ad63adb8b1bc32c1b373800..98fc35c1da6bec0fd50d2a68cbd095aaca66d91f 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2422,7 +2422,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2423,7 +2423,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public String getLocale() { diff --git a/patches/server/0064-Disable-Scoreboards-for-non-players-by-default.patch b/patches/server/0064-Disable-Scoreboards-for-non-players-by-default.patch index fd8fbeaa15..ba39658f01 100644 --- a/patches/server/0064-Disable-Scoreboards-for-non-players-by-default.patch +++ b/patches/server/0064-Disable-Scoreboards-for-non-players-by-default.patch @@ -23,10 +23,10 @@ index d5f5864b7c1ad4c30f37b360b317b63c129e3a3f..82e57978b79b5275b98a1fa7731c6a23 } diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index bb5e2fd7b8d9b8bec71d8c945d266765c42d3927..6e2233785fae170efb4c9611a6507dbd072416e8 100644 +index 97ad63aad3c559feb1e762af1e00fd550aa5b251..ba194f42217f1176ac08123d3bb5cb24e1a6c119 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -847,6 +847,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -848,6 +848,7 @@ public abstract class LivingEntity extends Entity implements Attackable { String s = nbt.getString("Team"); Scoreboard scoreboard = this.level().getScoreboard(); PlayerTeam scoreboardteam = scoreboard.getPlayerTeam(s); diff --git a/patches/server/0067-Complete-resource-pack-API.patch b/patches/server/0067-Complete-resource-pack-API.patch index 28173364ee..4128d8d8d1 100644 --- a/patches/server/0067-Complete-resource-pack-API.patch +++ b/patches/server/0067-Complete-resource-pack-API.patch @@ -22,7 +22,7 @@ index 678f12679985c6fa9effe8beec306d95d5e0bdac..8520f0f2b4b4e758b2e2fae206b7fd81 } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index bbc8f648fc8287d84a8948947e1321a47417fefa..bb4bef4e2a13aebca543136d51aa8eefead8c329 100644 +index 699248ae7c8e2b018a279ac023a0175a8af10714..f0ec24cf686fa7e1a025c8f9c8c6722f77c29e14 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 { @@ -33,7 +33,7 @@ index bbc8f648fc8287d84a8948947e1321a47417fefa..bb4bef4e2a13aebca543136d51aa8eef public CraftPlayer(CraftServer server, ServerPlayer entity) { super(server, entity); -@@ -2093,6 +2094,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2094,6 +2095,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } // Paper end - adventure diff --git a/patches/server/0071-Handle-Item-Meta-Inconsistencies.patch b/patches/server/0071-Handle-Item-Meta-Inconsistencies.patch index 33c444cddb..2788e0342e 100644 --- a/patches/server/0071-Handle-Item-Meta-Inconsistencies.patch +++ b/patches/server/0071-Handle-Item-Meta-Inconsistencies.patch @@ -149,7 +149,7 @@ index 21ed720118073b14bc8b5d1d665b0e17a8bbc1d2..9fa993ac05092170794911394c994fca static Map<Enchantment, Integer> getEnchantments(net.minecraft.world.item.ItemStack item) { diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -index f13c703a0acafec7e6772f83ae4f5fda988cd15f..38596695282157e3ff0a53a1185d211268854c15 100644 +index 46e1fabf85cc0d92f79a7adf24e5724dc1dc08a9..69be26f8f47854f39cfed0559d944ef4f983c0f3 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java @@ -6,6 +6,7 @@ import com.google.common.collect.ImmutableList; @@ -239,7 +239,7 @@ index f13c703a0acafec7e6772f83ae4f5fda988cd15f..38596695282157e3ff0a53a1185d2112 } if (this.hasAttributeModifiers()) { clone.attributeModifiers = LinkedHashMultimap.create(this.attributeModifiers); -@@ -2029,4 +2031,22 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -2028,4 +2030,22 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { return (result != null) ? result : Optional.empty(); } diff --git a/patches/server/0074-Custom-replacement-for-eaten-items.patch b/patches/server/0074-Custom-replacement-for-eaten-items.patch index 5734dd9921..ad90d60cf5 100644 --- a/patches/server/0074-Custom-replacement-for-eaten-items.patch +++ b/patches/server/0074-Custom-replacement-for-eaten-items.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Custom replacement for eaten items diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 6e2233785fae170efb4c9611a6507dbd072416e8..13748a5a1b2bbb8ad1ebf3c3f3d1250d9df643ea 100644 +index ba194f42217f1176ac08123d3bb5cb24e1a6c119..e7b308ba4a253b270aebebd19e2671514c5357ca 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -3830,10 +3830,11 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3858,10 +3858,11 @@ public abstract class LivingEntity extends Entity implements Attackable { this.triggerItemUseEffects(this.useItem, 16); // CraftBukkit start - fire PlayerItemConsumeEvent ItemStack itemstack; @@ -21,7 +21,7 @@ index 6e2233785fae170efb4c9611a6507dbd072416e8..13748a5a1b2bbb8ad1ebf3c3f3d1250d this.level().getCraftServer().getPluginManager().callEvent(event); if (event.isCancelled()) { -@@ -3847,6 +3848,12 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3875,6 +3876,12 @@ public abstract class LivingEntity extends Entity implements Attackable { } else { itemstack = this.useItem.finishUsingItem(this.level(), this); } @@ -34,7 +34,7 @@ index 6e2233785fae170efb4c9611a6507dbd072416e8..13748a5a1b2bbb8ad1ebf3c3f3d1250d // CraftBukkit end if (itemstack != this.useItem) { -@@ -3854,6 +3861,11 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3882,6 +3889,11 @@ public abstract class LivingEntity extends Entity implements Attackable { } this.stopUsingItem(); diff --git a/patches/server/0075-handle-NaN-health-absorb-values-and-repair-bad-data.patch b/patches/server/0075-handle-NaN-health-absorb-values-and-repair-bad-data.patch index 18e8700307..90809277ff 100644 --- a/patches/server/0075-handle-NaN-health-absorb-values-and-repair-bad-data.patch +++ b/patches/server/0075-handle-NaN-health-absorb-values-and-repair-bad-data.patch @@ -5,10 +5,10 @@ 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 13748a5a1b2bbb8ad1ebf3c3f3d1250d9df643ea..7703a5a8af59a1ebfdad49da97fbd70f838409fd 100644 +index e7b308ba4a253b270aebebd19e2671514c5357ca..fae7c493c9be741f019fc49f45a59976e6b01ed7 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -807,7 +807,13 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -808,7 +808,13 @@ public abstract class LivingEntity extends Entity implements Attackable { @Override public void readAdditionalSaveData(CompoundTag nbt) { @@ -23,7 +23,7 @@ index 13748a5a1b2bbb8ad1ebf3c3f3d1250d9df643ea..7703a5a8af59a1ebfdad49da97fbd70f if (nbt.contains("attributes", 9) && this.level() != null && !this.level().isClientSide) { this.getAttributes().load(nbt.getList("attributes", 10)); } -@@ -1341,6 +1347,10 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -1342,6 +1348,10 @@ public abstract class LivingEntity extends Entity implements Attackable { } public void setHealth(float health) { @@ -34,7 +34,7 @@ index 13748a5a1b2bbb8ad1ebf3c3f3d1250d9df643ea..7703a5a8af59a1ebfdad49da97fbd70f // CraftBukkit start - Handle scaled health if (this instanceof ServerPlayer) { org.bukkit.craftbukkit.entity.CraftPlayer player = ((ServerPlayer) this).getBukkitEntity(); -@@ -3660,7 +3670,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3688,7 +3698,7 @@ public abstract class LivingEntity extends Entity implements Attackable { } public final void setAbsorptionAmount(float absorptionAmount) { @@ -44,10 +44,10 @@ index 13748a5a1b2bbb8ad1ebf3c3f3d1250d9df643ea..7703a5a8af59a1ebfdad49da97fbd70f 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 bb4bef4e2a13aebca543136d51aa8eefead8c329..a2c09546434ef8b8d8e304b83d902efd5fc36a70 100644 +index f0ec24cf686fa7e1a025c8f9c8c6722f77c29e14..8a30e4d7b6542de3e6bea37cc2a6cbabd2bb9555 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2337,6 +2337,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2338,6 +2338,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } public void setRealHealth(double health) { diff --git a/patches/server/0084-Add-PlayerUseUnknownEntityEvent.patch b/patches/server/0084-Add-PlayerUseUnknownEntityEvent.patch index fd655a0b9f..cde1e3ce52 100644 --- a/patches/server/0084-Add-PlayerUseUnknownEntityEvent.patch +++ b/patches/server/0084-Add-PlayerUseUnknownEntityEvent.patch @@ -59,10 +59,10 @@ index 64db7e017b41bffcaac202ee4ecfd7df46d69331..14a821bfc6b20475889d3138b8da9e6b @Override diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index a29dfbe7aa06113358a2078d927fc53662a5f91f..5ea0b9f215dcb457d9e34fe5e3b074843e034b0f 100644 +index 3595ff3db5eb0b1da100692702e514cb870220ee..9c0e38453e164ef394c8e1860fb92605cda71be5 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -1861,4 +1861,13 @@ public class CraftEventFactory { +@@ -1880,4 +1880,13 @@ public class CraftEventFactory { Bukkit.getPluginManager().callEvent(new EntityRemoveEvent(entity.getBukkitEntity(), cause)); } diff --git a/patches/server/0092-EntityRegainHealthEvent-isFastRegen-API.patch b/patches/server/0092-EntityRegainHealthEvent-isFastRegen-API.patch index 308c3d6d6a..bc89e73539 100644 --- a/patches/server/0092-EntityRegainHealthEvent-isFastRegen-API.patch +++ b/patches/server/0092-EntityRegainHealthEvent-isFastRegen-API.patch @@ -6,10 +6,10 @@ Subject: [PATCH] EntityRegainHealthEvent isFastRegen API Don't even get me started diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 7703a5a8af59a1ebfdad49da97fbd70f838409fd..369666bdbb3a68a223a75c3c519d6838bc658c40 100644 +index fae7c493c9be741f019fc49f45a59976e6b01ed7..16d611e09cbe56525cde0e0dced93b7f09c12158 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -1320,10 +1320,16 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -1321,10 +1321,16 @@ public abstract class LivingEntity extends Entity implements Attackable { } public void heal(float f, EntityRegainHealthEvent.RegainReason regainReason) { diff --git a/patches/server/0109-Add-EntityZapEvent.patch b/patches/server/0109-Add-EntityZapEvent.patch index c7a81aa78a..0e80811908 100644 --- a/patches/server/0109-Add-EntityZapEvent.patch +++ b/patches/server/0109-Add-EntityZapEvent.patch @@ -28,10 +28,10 @@ index 63c10be6eacd7108b8b4795d76bf624e0614440a..243eb1e54293c763a06febff551c0513 entitywitch.finalizeSpawn(world, world.getCurrentDifficultyAt(entitywitch.blockPosition()), MobSpawnType.CONVERSION, (SpawnGroupData) null); entitywitch.setNoAi(this.isNoAi()); diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 5ea0b9f215dcb457d9e34fe5e3b074843e034b0f..8071c04be18b67a9f12fb92154c0fd19769972ab 100644 +index 9c0e38453e164ef394c8e1860fb92605cda71be5..ba8dfea4a88cb9ba881cd90dfb5d41087498ae54 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -1198,6 +1198,14 @@ public class CraftEventFactory { +@@ -1202,6 +1202,14 @@ public class CraftEventFactory { return !event.isCancelled(); } diff --git a/patches/server/0113-Add-source-to-PlayerExpChangeEvent.patch b/patches/server/0113-Add-source-to-PlayerExpChangeEvent.patch index 45e4d30d6a..b739ee3351 100644 --- a/patches/server/0113-Add-source-to-PlayerExpChangeEvent.patch +++ b/patches/server/0113-Add-source-to-PlayerExpChangeEvent.patch @@ -18,10 +18,10 @@ index 56402312e44d12c859e2c4b39902d31b7cfd1573..25a45e680f9fdea90f43d59de87a3a50 --this.count; diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 8071c04be18b67a9f12fb92154c0fd19769972ab..ad799d1d0f46663d5bc850763629f430d00b58fe 100644 +index ba8dfea4a88cb9ba881cd90dfb5d41087498ae54..a3a63c5988eaa987a3718dfa79876e81d05e7fa6 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -1151,6 +1151,17 @@ public class CraftEventFactory { +@@ -1155,6 +1155,17 @@ public class CraftEventFactory { return event; } diff --git a/patches/server/0114-Add-ProjectileCollideEvent.patch b/patches/server/0114-Add-ProjectileCollideEvent.patch index 0ace0199a8..df432de74e 100644 --- a/patches/server/0114-Add-ProjectileCollideEvent.patch +++ b/patches/server/0114-Add-ProjectileCollideEvent.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Add ProjectileCollideEvent Deprecated now and replaced with ProjectileHitEvent diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index ad799d1d0f46663d5bc850763629f430d00b58fe..a4060019e30f6fc64e10494ed41d6613d1b894d7 100644 +index a3a63c5988eaa987a3718dfa79876e81d05e7fa6..0aa10b1709c195d766eb49e21d9bc19d7cecf760 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -1295,6 +1295,17 @@ public class CraftEventFactory { +@@ -1299,6 +1299,17 @@ public class CraftEventFactory { return CraftItemStack.asNMSCopy(bitem); } @@ -27,7 +27,7 @@ index ad799d1d0f46663d5bc850763629f430d00b58fe..a4060019e30f6fc64e10494ed41d6613 public static ProjectileLaunchEvent callProjectileLaunchEvent(Entity entity) { Projectile bukkitEntity = (Projectile) entity.getBukkitEntity(); ProjectileLaunchEvent event = new ProjectileLaunchEvent(bukkitEntity); -@@ -1319,8 +1330,15 @@ public class CraftEventFactory { +@@ -1323,8 +1334,15 @@ public class CraftEventFactory { if (position.getType() == HitResult.Type.ENTITY) { hitEntity = ((EntityHitResult) position).getEntity().getBukkitEntity(); } diff --git a/patches/server/0121-Properly-fix-item-duplication-bug.patch b/patches/server/0121-Properly-fix-item-duplication-bug.patch index 60bdf7de86..86782af8c7 100644 --- a/patches/server/0121-Properly-fix-item-duplication-bug.patch +++ b/patches/server/0121-Properly-fix-item-duplication-bug.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Properly fix item duplication bug Credit to prplz for figuring out the real issue diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 70f0f4daff27754aefcadb84387bb3054cc66a8e..dae729c39e5d3fefc8188069e81f33066746c4a6 100644 +index ac4b66a4aa9e2f186ed5ff3c7d41a01152a9d283..e7b39f06707a62d26af7e183413e0301501d2ce0 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -2623,7 +2623,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player { +@@ -2630,7 +2630,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player { @Override public boolean isImmobile() { diff --git a/patches/server/0126-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch b/patches/server/0126-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch index 8fc035b6bf..68a1c8b37a 100644 --- a/patches/server/0126-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch +++ b/patches/server/0126-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch @@ -127,10 +127,10 @@ index 25a45e680f9fdea90f43d59de87a3a500f4ee8c0..0330a62a6a0060d2a96de191db687745 @Override diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 369666bdbb3a68a223a75c3c519d6838bc658c40..cacada8cfbe171cdb10aa2a78483ef3b613b414a 100644 +index 16d611e09cbe56525cde0e0dced93b7f09c12158..b6a7c9ee6e6885e0cc44e2f2ff3ea7bba9cb8f3d 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -1788,7 +1788,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -1799,7 +1799,7 @@ public abstract class LivingEntity extends Entity implements Attackable { protected void dropExperience(@Nullable Entity attacker) { // CraftBukkit start - Update getExpReward() above if the removed if() changes! if (!(this instanceof net.minecraft.world.entity.boss.enderdragon.EnderDragon)) { // CraftBukkit - SPIGOT-2420: Special case ender dragon will drop the xp over time @@ -140,10 +140,10 @@ index 369666bdbb3a68a223a75c3c519d6838bc658c40..cacada8cfbe171cdb10aa2a78483ef3b } // CraftBukkit end diff --git a/src/main/java/net/minecraft/world/entity/animal/Animal.java b/src/main/java/net/minecraft/world/entity/animal/Animal.java -index 1af60680c512e0743920440215247d191f9a8385..370c444153d04fe7896952219604d83a19a996e2 100644 +index 48d0cbe7859c62bbf281a7b43ef9af658667cb7b..b46352b328178df2a48d1c9e895bed3fabd2c292 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Animal.java +++ b/src/main/java/net/minecraft/world/entity/animal/Animal.java -@@ -250,12 +250,14 @@ public abstract class Animal extends AgeableMob { +@@ -251,12 +251,14 @@ public abstract class Animal extends AgeableMob { public void finalizeSpawnChildFromBreeding(ServerLevel worldserver, Animal entityanimal, @Nullable AgeableMob entityageable, int experience) { // CraftBukkit end @@ -162,7 +162,7 @@ index 1af60680c512e0743920440215247d191f9a8385..370c444153d04fe7896952219604d83a this.setAge(6000); entityanimal.setAge(6000); this.resetLove(); -@@ -264,7 +266,7 @@ public abstract class Animal extends AgeableMob { +@@ -265,7 +267,7 @@ public abstract class Animal extends AgeableMob { if (worldserver.getGameRules().getBoolean(GameRules.RULE_DOMOBLOOT)) { // CraftBukkit start - use event experience if (experience > 0) { diff --git a/patches/server/0127-Cap-Entity-Collisions.patch b/patches/server/0127-Cap-Entity-Collisions.patch index 0c7b93037a..8feda191fe 100644 --- a/patches/server/0127-Cap-Entity-Collisions.patch +++ b/patches/server/0127-Cap-Entity-Collisions.patch @@ -24,10 +24,10 @@ index bd17157631a74f80e3b5ce50bb1f681abe1dd6a7..46a21ed2408a42aafd16647e17e55673 @javax.annotation.Nullable private org.bukkit.util.Vector origin; diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index cacada8cfbe171cdb10aa2a78483ef3b613b414a..51dadc6d3ea7f0b7b5eb5117b58df0e532c65eb9 100644 +index b6a7c9ee6e6885e0cc44e2f2ff3ea7bba9cb8f3d..f297b2227d0793f44cb5770aa24a474ec7283b15 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -3474,10 +3474,12 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3502,10 +3502,12 @@ public abstract class LivingEntity extends Entity implements Attackable { } Iterator iterator1 = list.iterator(); diff --git a/patches/server/0129-Properly-handle-async-calls-to-restart-the-server.patch b/patches/server/0129-Properly-handle-async-calls-to-restart-the-server.patch index 6bab23ed9e..37a92c3e71 100644 --- a/patches/server/0129-Properly-handle-async-calls-to-restart-the-server.patch +++ b/patches/server/0129-Properly-handle-async-calls-to-restart-the-server.patch @@ -84,7 +84,7 @@ index e17f4f3882ae77a67e8bfad04646f02c2bbb6669..d5f17d7e3b56ca87ec9070b69265ce09 } // CraftBukkit end diff --git a/src/main/java/org/spigotmc/RestartCommand.java b/src/main/java/org/spigotmc/RestartCommand.java -index c30f9899ec5529e49919367ab4e0ae797b429afa..9a1fffa0c07c24eed8bd6ea8f3cd26c9f926c54d 100644 +index de8c703803bcd074f765a44cabc7c635176b716d..824c4ad135ea5177f416687c7042639ed126b70b 100644 --- a/src/main/java/org/spigotmc/RestartCommand.java +++ b/src/main/java/org/spigotmc/RestartCommand.java @@ -46,86 +46,134 @@ public class RestartCommand extends Command @@ -119,7 +119,7 @@ index c30f9899ec5529e49919367ab4e0ae797b429afa..9a1fffa0c07c24eed8bd6ea8f3cd26c9 - // Kick all players - for ( ServerPlayer p : (List<ServerPlayer>) MinecraftServer.getServer().getPlayerList().players ) - { -- p.connection.disconnect( CraftChatMessage.fromStringOrEmpty( SpigotConfig.restartMessage ) ); +- p.connection.disconnect( CraftChatMessage.fromStringOrEmpty( SpigotConfig.restartMessage, true ) ); - } - // Give the socket a chance to send the packets - try @@ -138,7 +138,7 @@ index c30f9899ec5529e49919367ab4e0ae797b429afa..9a1fffa0c07c24eed8bd6ea8f3cd26c9 + // Kick all players + for ( ServerPlayer p : com.google.common.collect.ImmutableList.copyOf( MinecraftServer.getServer().getPlayerList().players ) ) + { -+ p.connection.disconnect( CraftChatMessage.fromStringOrEmpty( SpigotConfig.restartMessage ) ); ++ p.connection.disconnect( CraftChatMessage.fromStringOrEmpty( SpigotConfig.restartMessage, true ) ); + } + // Give the socket a chance to send the packets + try diff --git a/patches/server/0130-Add-option-to-make-parrots-stay-on-shoulders-despite.patch b/patches/server/0130-Add-option-to-make-parrots-stay-on-shoulders-despite.patch index 874f766d13..20b540764e 100644 --- a/patches/server/0130-Add-option-to-make-parrots-stay-on-shoulders-despite.patch +++ b/patches/server/0130-Add-option-to-make-parrots-stay-on-shoulders-despite.patch @@ -32,10 +32,10 @@ index 34aeb823950fac8eaef3f38b302c1585a45f7498..44cc60d92c6e83ecfa2c232b59986968 case RELEASE_SHIFT_KEY: this.player.setShiftKeyDown(false); diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java -index 0d1d8ad353ff2f2bd478cfdc2f6bebad5203e190..c9423872c23f3334afad34e662041c5f5d1ad1a2 100644 +index ba279ab6ec0ab41309607333b62a941e35dbf581..7995a4626b3ed68234d468418408b9a8e179b6f6 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java -@@ -592,6 +592,7 @@ public abstract class Player extends LivingEntity { +@@ -593,6 +593,7 @@ public abstract class Player extends LivingEntity { this.playShoulderEntityAmbientSound(this.getShoulderEntityLeft()); this.playShoulderEntityAmbientSound(this.getShoulderEntityRight()); if (!this.level().isClientSide && (this.fallDistance > 0.5F || this.isInWater()) || this.abilities.flying || this.isSleeping() || this.isInPowderSnow) { diff --git a/patches/server/0139-Shoulder-Entities-Release-API.patch b/patches/server/0139-Shoulder-Entities-Release-API.patch index 9facd3b0cf..b0762a4548 100644 --- a/patches/server/0139-Shoulder-Entities-Release-API.patch +++ b/patches/server/0139-Shoulder-Entities-Release-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Shoulder Entities Release API diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java -index c9423872c23f3334afad34e662041c5f5d1ad1a2..d603a7211c7e7eb2567881a530ae7bcbc8def5a6 100644 +index 7995a4626b3ed68234d468418408b9a8e179b6f6..362d75522aaa721e9fb1d12a149d0efec1ac17b1 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java -@@ -1992,20 +1992,45 @@ public abstract class Player extends LivingEntity { +@@ -1995,20 +1995,45 @@ public abstract class Player extends LivingEntity { } @@ -59,10 +59,10 @@ index c9423872c23f3334afad34e662041c5f5d1ad1a2..d603a7211c7e7eb2567881a530ae7bcb @Override public abstract boolean isSpectator(); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -index 1010ac55d91559bcb6ebadeea447f32c6aa89226..47350439f579ef2ab408bda0fc4b8976df3a5b92 100644 +index 0c94a1094a3af0232bb2957708fa997933db621b..9574d5e0ee9109155f16861d0c46e45ef4c1d1a8 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -@@ -511,6 +511,32 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { +@@ -512,6 +512,32 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { this.getHandle().getCooldowns().addCooldown(CraftItemType.bukkitToMinecraft(material), ticks); } diff --git a/patches/server/0147-Fix-this-stupid-bullshit.patch b/patches/server/0147-Fix-this-stupid-bullshit.patch index cc049a1a33..06f8ccc1c5 100644 --- a/patches/server/0147-Fix-this-stupid-bullshit.patch +++ b/patches/server/0147-Fix-this-stupid-bullshit.patch @@ -31,12 +31,12 @@ index 8f1992188f7fd9e735569e099b36a7eafed47aae..061c89b985dafc79c808dd5f0e296b9f Bootstrap.isBootstrapped = true; Instant instant = Instant.now(); diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index 9515a6f72b54bc8926f10182143b2aa9b684a341..faa228698c7dd60bde0f3767cc27957ece04b8be 100644 +index 75a3c7ed5500f0451c9c1efdfc3cb809445c8acf..8245b38d37b4cee6f4e7b61d7af40a18e54a3f43 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -260,10 +260,12 @@ public class Main { Calendar deadline = Calendar.getInstance(); - deadline.add(Calendar.DAY_OF_YEAR, -3); + deadline.add(Calendar.DAY_OF_YEAR, -7); if (buildDate.before(deadline.getTime())) { - System.err.println("*** Error, this build is outdated ***"); + // Paper start - This is some stupid bullshit diff --git a/patches/server/0156-Send-attack-SoundEffects-only-to-players-who-can-see.patch b/patches/server/0156-Send-attack-SoundEffects-only-to-players-who-can-see.patch index 94f8863d3b..f4f07b3245 100644 --- a/patches/server/0156-Send-attack-SoundEffects-only-to-players-who-can-see.patch +++ b/patches/server/0156-Send-attack-SoundEffects-only-to-players-who-can-see.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Send attack SoundEffects only to players who can see the diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java -index d603a7211c7e7eb2567881a530ae7bcbc8def5a6..b62f7ae1929513bd6da90bc91e3654c28c28a40a 100644 +index 362d75522aaa721e9fb1d12a149d0efec1ac17b1..34654395536ea022848db3d9f0291512081fc558 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java -@@ -1256,7 +1256,7 @@ public abstract class Player extends LivingEntity { +@@ -1257,7 +1257,7 @@ public abstract class Player extends LivingEntity { boolean flag1; if (this.isSprinting() && flag) { @@ -18,7 +18,7 @@ index d603a7211c7e7eb2567881a530ae7bcbc8def5a6..b62f7ae1929513bd6da90bc91e3654c2 flag1 = true; } else { flag1 = false; -@@ -1335,7 +1335,7 @@ public abstract class Player extends LivingEntity { +@@ -1338,7 +1338,7 @@ public abstract class Player extends LivingEntity { } } @@ -27,7 +27,7 @@ index d603a7211c7e7eb2567881a530ae7bcbc8def5a6..b62f7ae1929513bd6da90bc91e3654c2 this.sweepAttack(); } -@@ -1363,15 +1363,15 @@ public abstract class Player extends LivingEntity { +@@ -1366,15 +1366,15 @@ public abstract class Player extends LivingEntity { } if (flag2) { @@ -46,7 +46,7 @@ index d603a7211c7e7eb2567881a530ae7bcbc8def5a6..b62f7ae1929513bd6da90bc91e3654c2 } } -@@ -1427,7 +1427,7 @@ public abstract class Player extends LivingEntity { +@@ -1430,7 +1430,7 @@ public abstract class Player extends LivingEntity { this.causeFoodExhaustion(this.level().spigotConfig.combatExhaustion, EntityExhaustionEvent.ExhaustionReason.ATTACK); // CraftBukkit - EntityExhaustionEvent // Spigot - Change to use configurable value } else { @@ -55,7 +55,7 @@ index d603a7211c7e7eb2567881a530ae7bcbc8def5a6..b62f7ae1929513bd6da90bc91e3654c2 // CraftBukkit start - resync on cancelled event if (this instanceof ServerPlayer) { ((ServerPlayer) this).getBukkitEntity().updateInventory(); -@@ -1822,6 +1822,14 @@ public abstract class Player extends LivingEntity { +@@ -1825,6 +1825,14 @@ public abstract class Player extends LivingEntity { public int getXpNeededForNextLevel() { return this.experienceLevel >= 30 ? 112 + (this.experienceLevel - 30) * 9 : (this.experienceLevel >= 15 ? 37 + (this.experienceLevel - 15) * 5 : 7 + this.experienceLevel * 2); } diff --git a/patches/server/0157-Add-PlayerArmorChangeEvent.patch b/patches/server/0157-Add-PlayerArmorChangeEvent.patch index 8e7a7da4ed..d9478284f8 100644 --- a/patches/server/0157-Add-PlayerArmorChangeEvent.patch +++ b/patches/server/0157-Add-PlayerArmorChangeEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add PlayerArmorChangeEvent diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 51dadc6d3ea7f0b7b5eb5117b58df0e532c65eb9..71696a99a99573aa54c11ee9b490bb292d59f753 100644 +index f297b2227d0793f44cb5770aa24a474ec7283b15..21d00a73ad8287d61eda1ab91b88ea3264aff021 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -3140,6 +3140,13 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3168,6 +3168,13 @@ public abstract class LivingEntity extends Entity implements Attackable { ItemStack itemstack2 = this.getItemBySlot(enumitemslot); if (this.equipmentHasChanged(itemstack1, itemstack2)) { diff --git a/patches/server/0164-Ability-to-apply-mending-to-XP-API.patch b/patches/server/0164-Ability-to-apply-mending-to-XP-API.patch index fd8b647890..5b73d571fb 100644 --- a/patches/server/0164-Ability-to-apply-mending-to-XP-API.patch +++ b/patches/server/0164-Ability-to-apply-mending-to-XP-API.patch @@ -14,10 +14,10 @@ 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 9eddc3ac16645e0a01cc5c2decc8e53f08e7e3dc..aaef5693b044141d2aa8108b74b240903c64e6e6 100644 +index 8d2c795d8898cd32611366b972b35d132c22eca7..f85711a2ff57498f385da7da9b77ec130aff116b 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1637,7 +1637,41 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1638,7 +1638,41 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } @Override diff --git a/patches/server/0173-Toggleable-player-crits.patch b/patches/server/0173-Toggleable-player-crits.patch index 6e4e9c5ff2..03d3f5c4f1 100644 --- a/patches/server/0173-Toggleable-player-crits.patch +++ b/patches/server/0173-Toggleable-player-crits.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Toggleable player crits diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java -index b62f7ae1929513bd6da90bc91e3654c28c28a40a..d365fd0fa03a773b21b64f0a84a8b2d83a740845 100644 +index 34654395536ea022848db3d9f0291512081fc558..3f0425f6c1a8d5ad4df9d837490c09e175d0df4b 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java -@@ -1265,6 +1265,7 @@ public abstract class Player extends LivingEntity { +@@ -1266,6 +1266,7 @@ public abstract class Player extends LivingEntity { f += itemstack.getItem().getAttackDamageBonus(target, f, damagesource); boolean flag2 = flag && this.fallDistance > 0.0F && !this.onGround() && !this.onClimbable() && !this.isInWater() && !this.hasEffect(MobEffects.BLINDNESS) && !this.isPassenger() && target instanceof LivingEntity && !this.isSprinting(); diff --git a/patches/server/0177-Player.setPlayerProfile-API.patch b/patches/server/0177-Player.setPlayerProfile-API.patch index cec219427f..38ad4142e9 100644 --- a/patches/server/0177-Player.setPlayerProfile-API.patch +++ b/patches/server/0177-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 aaef5693b044141d2aa8108b74b240903c64e6e6..a6567aa9a3ec9dd17689e907131e5cca05da7c9d 100644 +index f85711a2ff57498f385da7da9b77ec130aff116b..f7534be64cdbf1342b523ef2ab0627f597983e0d 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -249,11 +249,6 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -92,7 +92,7 @@ index aaef5693b044141d2aa8108b74b240903c64e6e6..a6567aa9a3ec9dd17689e907131e5cca @Override public InetSocketAddress getAddress() { if (this.getHandle().connection.protocol() == null) return null; -@@ -1791,8 +1786,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1792,8 +1787,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { private void untrackAndHideEntity(org.bukkit.entity.Entity entity) { // Remove this entity from the hidden player's EntityTrackerEntry @@ -109,7 +109,7 @@ index aaef5693b044141d2aa8108b74b240903c64e6e6..a6567aa9a3ec9dd17689e907131e5cca ChunkMap.TrackedEntity entry = tracker.entityMap.get(other.getId()); if (entry != null) { entry.removePlayer(this.getHandle()); -@@ -1805,8 +1807,6 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1806,8 +1808,6 @@ public class CraftPlayer extends CraftHumanEntity implements Player { this.getHandle().connection.send(new ClientboundPlayerInfoRemovePacket(List.of(otherPlayer.getUUID()))); } } @@ -118,7 +118,7 @@ index aaef5693b044141d2aa8108b74b240903c64e6e6..a6567aa9a3ec9dd17689e907131e5cca } void resetAndHideEntity(org.bukkit.entity.Entity entity) { -@@ -1871,12 +1871,25 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1872,12 +1872,25 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } private void trackAndShowEntity(org.bukkit.entity.Entity entity) { @@ -144,7 +144,7 @@ index aaef5693b044141d2aa8108b74b240903c64e6e6..a6567aa9a3ec9dd17689e907131e5cca } ChunkMap.TrackedEntity entry = tracker.entityMap.get(other.getId()); -@@ -1886,6 +1899,39 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1887,6 +1900,39 @@ public class CraftPlayer extends CraftHumanEntity implements Player { this.server.getPluginManager().callEvent(new PlayerShowEntityEvent(this, entity)); } @@ -184,7 +184,7 @@ index aaef5693b044141d2aa8108b74b240903c64e6e6..a6567aa9a3ec9dd17689e907131e5cca void resetAndShowEntity(org.bukkit.entity.Entity entity) { // SPIGOT-7312: Can't show/hide self -@@ -1897,6 +1943,34 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1898,6 +1944,34 @@ public class CraftPlayer extends CraftHumanEntity implements Player { this.trackAndShowEntity(entity); } } @@ -220,10 +220,10 @@ index aaef5693b044141d2aa8108b74b240903c64e6e6..a6567aa9a3ec9dd17689e907131e5cca public void onEntityRemove(Entity entity) { this.invertedVisibilityEntities.remove(entity.getUUID()); diff --git a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java -index 8757d4de8a589355b83690d37d9e81ce3cc6ae32..93c0390aade242bc24f8d9a9ac99242d0f588d5e 100644 +index 0bde8fc63d892cb615638769ca84beba9da80ff2..a2b1197a26eed4df77d7f770e016f522832d8aa2 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java +++ b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java -@@ -394,6 +394,13 @@ public class Commodore { +@@ -404,6 +404,13 @@ public class Commodore { } // Paper end - Rewrite plugins diff --git a/patches/server/0182-Flag-to-disable-the-channel-limit.patch b/patches/server/0182-Flag-to-disable-the-channel-limit.patch index eb219a5de1..61d82fcade 100644 --- a/patches/server/0182-Flag-to-disable-the-channel-limit.patch +++ b/patches/server/0182-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 a6567aa9a3ec9dd17689e907131e5cca05da7c9d..27298cd0558b1ff2ab2ca341d62da2922507414b 100644 +index f7534be64cdbf1342b523ef2ab0627f597983e0d..24928a1e12ecedaaa634be0ab5425ee77b0f6556 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -209,6 +209,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -20,7 +20,7 @@ index a6567aa9a3ec9dd17689e907131e5cca05da7c9d..27298cd0558b1ff2ab2ca341d62da292 public CraftPlayer(CraftServer server, ServerPlayer entity) { super(server, entity); -@@ -2268,7 +2269,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2269,7 +2270,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } public void addChannel(String channel) { diff --git a/patches/server/0183-Add-openSign-method-to-HumanEntity.patch b/patches/server/0183-Add-openSign-method-to-HumanEntity.patch index 969c29ccc9..83658d2f8b 100644 --- a/patches/server/0183-Add-openSign-method-to-HumanEntity.patch +++ b/patches/server/0183-Add-openSign-method-to-HumanEntity.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add openSign method to HumanEntity diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -index 47350439f579ef2ab408bda0fc4b8976df3a5b92..dd3377a4f69e5ac10905e52d0eecc2427e72d856 100644 +index 9574d5e0ee9109155f16861d0c46e45ef4c1d1a8..2e02fc22a889c9c8010ae8bff1b59a13219ae014 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -@@ -621,6 +621,12 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { +@@ -622,6 +622,12 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { } } diff --git a/patches/server/0184-Configurable-sprint-interruption-on-attack.patch b/patches/server/0184-Configurable-sprint-interruption-on-attack.patch index 28d5c976c0..65dd42f5eb 100644 --- a/patches/server/0184-Configurable-sprint-interruption-on-attack.patch +++ b/patches/server/0184-Configurable-sprint-interruption-on-attack.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Configurable sprint interruption on attack If the sprint interruption is disabled players continue sprinting when they attack entities. diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java -index d365fd0fa03a773b21b64f0a84a8b2d83a740845..8977aaa75b287cbd13ed18a5ee5ba950fcd738e6 100644 +index 3f0425f6c1a8d5ad4df9d837490c09e175d0df4b..00fecf255214d87837867b8743cc8f161ebfcb4c 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java -@@ -1306,7 +1306,11 @@ public abstract class Player extends LivingEntity { +@@ -1307,7 +1307,11 @@ public abstract class Player extends LivingEntity { } this.setDeltaMovement(this.getDeltaMovement().multiply(0.6D, 1.0D, 0.6D)); diff --git a/patches/server/0193-WitchReadyPotionEvent.patch b/patches/server/0193-WitchReadyPotionEvent.patch index fbda7c03d7..6581d99e31 100644 --- a/patches/server/0193-WitchReadyPotionEvent.patch +++ b/patches/server/0193-WitchReadyPotionEvent.patch @@ -22,10 +22,10 @@ index a14e00d55930628333cc63b18727ea56dbdc4ee3..f6d01d21745391595d61b191832be4c2 this.setUsingItem(true); if (!this.isSilent()) { diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index a4060019e30f6fc64e10494ed41d6613d1b894d7..587437f995dd411c051f2125202f1a48cfc1bb1b 100644 +index 0aa10b1709c195d766eb49e21d9bc19d7cecf760..9c463d551fc402dbcbc81aad5251a9183596830a 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -1907,4 +1907,14 @@ public class CraftEventFactory { +@@ -1926,4 +1926,14 @@ public class CraftEventFactory { ).callEvent(); } // Paper end - PlayerUseUnknownEntityEvent diff --git a/patches/server/0200-Make-shield-blocking-delay-configurable.patch b/patches/server/0200-Make-shield-blocking-delay-configurable.patch index c072b62e7b..9468400c10 100644 --- a/patches/server/0200-Make-shield-blocking-delay-configurable.patch +++ b/patches/server/0200-Make-shield-blocking-delay-configurable.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Make shield blocking delay configurable diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 71696a99a99573aa54c11ee9b490bb292d59f753..a054aaa3713f911512358cbd63c202a8a7bb8236 100644 +index 21d00a73ad8287d61eda1ab91b88ea3264aff021..cccc60602360f25f0aeddbd16dad2bb63a1728a8 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -3938,12 +3938,24 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3966,12 +3966,24 @@ public abstract class LivingEntity extends Entity implements Attackable { if (this.isUsingItem() && !this.useItem.isEmpty()) { Item item = this.useItem.getItem(); diff --git a/patches/server/0202-PlayerReadyArrowEvent.patch b/patches/server/0202-PlayerReadyArrowEvent.patch index d6e29005bd..37f2fbca4e 100644 --- a/patches/server/0202-PlayerReadyArrowEvent.patch +++ b/patches/server/0202-PlayerReadyArrowEvent.patch @@ -7,10 +7,10 @@ Called when a player is firing a bow and the server is choosing an arrow to use. Plugins can skip selection of certain arrows and control which is used. diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java -index 8977aaa75b287cbd13ed18a5ee5ba950fcd738e6..f21d121418872f5ece763f33c15091e787991d7c 100644 +index 00fecf255214d87837867b8743cc8f161ebfcb4c..d6bbeaf3833a4c44ed05243445edd813e3f15dcb 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java -@@ -2229,18 +2229,29 @@ public abstract class Player extends LivingEntity { +@@ -2232,18 +2232,29 @@ public abstract class Player extends LivingEntity { return ImmutableList.of(Pose.STANDING, Pose.CROUCHING, Pose.SWIMMING); } diff --git a/patches/server/0203-Add-entity-knockback-events.patch b/patches/server/0203-Add-entity-knockback-events.patch index 2a626e60e9..c87dbadcd6 100644 --- a/patches/server/0203-Add-entity-knockback-events.patch +++ b/patches/server/0203-Add-entity-knockback-events.patch @@ -38,10 +38,10 @@ index d6017d9d71fb4b3a3df6eaa44da0ebda54c83da4..629942afb41f73ca7a7855cba58c81fd } diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index a054aaa3713f911512358cbd63c202a8a7bb8236..ebd81b34d1fbb31ce0f9c92593154fdb6b62bf52 100644 +index cccc60602360f25f0aeddbd16dad2bb63a1728a8..bf1b8ee85551ff1989369268edf8012758b86fd7 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -1517,7 +1517,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -1528,7 +1528,7 @@ public abstract class LivingEntity extends Entity implements Attackable { d1 = source.getSourcePosition().z() - this.getZ(); } @@ -50,7 +50,7 @@ index a054aaa3713f911512358cbd63c202a8a7bb8236..ebd81b34d1fbb31ce0f9c92593154fdb if (!flag) { this.indicateDamage(d0, d1); } -@@ -1570,7 +1570,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -1581,7 +1581,7 @@ public abstract class LivingEntity extends Entity implements Attackable { } protected void blockedByShield(LivingEntity target) { @@ -59,7 +59,7 @@ index a054aaa3713f911512358cbd63c202a8a7bb8236..ebd81b34d1fbb31ce0f9c92593154fdb } private boolean checkTotemDeathProtection(DamageSource source) { -@@ -1831,10 +1831,10 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -1842,10 +1842,10 @@ public abstract class LivingEntity extends Entity implements Attackable { public void knockback(double strength, double x, double z) { // CraftBukkit start - EntityKnockbackEvent @@ -72,7 +72,7 @@ index a054aaa3713f911512358cbd63c202a8a7bb8236..ebd81b34d1fbb31ce0f9c92593154fdb d0 *= 1.0D - this.getAttributeValue(Attributes.KNOCKBACK_RESISTANCE); if (true || d0 > 0.0D) { // CraftBukkit - Call event even when force is 0 //this.hasImpulse = true; // CraftBukkit - Move down -@@ -1847,13 +1847,17 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -1858,13 +1858,17 @@ public abstract class LivingEntity extends Entity implements Attackable { Vec3 vec3d1 = (new Vec3(d1, 0.0D, d2)).normalize().scale(d0); @@ -200,10 +200,10 @@ index a6c33abcbbfc0851c8fa979163de145a578f97a6..18389b3befe31b224010e55244fbcb7c } } diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java -index f21d121418872f5ece763f33c15091e787991d7c..3512f0b309c7822f7b9d9eacbcf4dd84d9c24896 100644 +index d6bbeaf3833a4c44ed05243445edd813e3f15dcb..1b13096da1f0bc49efe25677ec24e6abe7ff2879 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java -@@ -1300,9 +1300,9 @@ public abstract class Player extends LivingEntity { +@@ -1301,9 +1301,9 @@ public abstract class Player extends LivingEntity { if (target instanceof LivingEntity) { LivingEntity entityliving1 = (LivingEntity) target; @@ -215,15 +215,15 @@ index f21d121418872f5ece763f33c15091e787991d7c..3512f0b309c7822f7b9d9eacbcf4dd84 } this.setDeltaMovement(this.getDeltaMovement().multiply(0.6D, 1.0D, 0.6D)); -@@ -1327,7 +1327,7 @@ public abstract class Player extends LivingEntity { - - // CraftBukkit start - Only apply knockback if the damage hits - if (entityliving2.hurt(this.damageSources().playerAttack(this).sweep(), f7)) { -- entityliving2.knockback(0.4000000059604645D, (double) Mth.sin(this.getYRot() * 0.017453292F), (double) (-Mth.cos(this.getYRot() * 0.017453292F)), this, EntityKnockbackEvent.KnockbackCause.SWEEP_ATTACK); // CraftBukkit -+ entityliving2.knockback(0.4000000059604645D, (double) Mth.sin(this.getYRot() * 0.017453292F), (double) (-Mth.cos(this.getYRot() * 0.017453292F)), this, io.papermc.paper.event.entity.EntityKnockbackEvent.Cause.SWEEP_ATTACK); // CraftBukkit // Paper - knockback events +@@ -1331,7 +1331,7 @@ public abstract class Player extends LivingEntity { + continue; } // CraftBukkit end +- entityliving2.knockback(0.4000000059604645D, (double) Mth.sin(this.getYRot() * 0.017453292F), (double) (-Mth.cos(this.getYRot() * 0.017453292F))); ++ entityliving2.knockback(0.4000000059604645D, (double) Mth.sin(this.getYRot() * 0.017453292F), (double) (-Mth.cos(this.getYRot() * 0.017453292F)), this, io.papermc.paper.event.entity.EntityKnockbackEvent.Cause.SWEEP_ATTACK); // CraftBukkit // Paper - knockback events + // entityliving2.hurt(damagesource, f7); // CraftBukkit - moved up Level world = this.level(); + diff --git a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java index 230040bef7d2cf9a463cfd9cb3b1b1aa208a7119..6c79997ba46e641de5aa12ff8a3d790d04a5a475 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java @@ -273,10 +273,10 @@ index d93ed33d5ae72e9dd3e6cf044ef79e4b9689dc1c..512d79b66fed3d1bef645c3ecb59bda0 // CraftBukkit end entity.setDeltaMovement(entity.getDeltaMovement().add(vec3d1)); diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 587437f995dd411c051f2125202f1a48cfc1bb1b..86bddb9c39d8487f050d126dbb479315cb8a2818 100644 +index 9c463d551fc402dbcbc81aad5251a9183596830a..cf045e3ebe75046212755f18058bf4381bacacc1 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -1869,19 +1869,33 @@ public class CraftEventFactory { +@@ -1888,19 +1888,33 @@ public class CraftEventFactory { return event; } diff --git a/patches/server/0209-InventoryCloseEvent-Reason-API.patch b/patches/server/0209-InventoryCloseEvent-Reason-API.patch index 8337d0eb90..9a7d5952e6 100644 --- a/patches/server/0209-InventoryCloseEvent-Reason-API.patch +++ b/patches/server/0209-InventoryCloseEvent-Reason-API.patch @@ -29,7 +29,7 @@ index 5bf18ab5c397b32d880ea1827f62945d8d0e80ce..ce6be7aed7b392c3e0c851f3f6e1e216 } // Spigot End diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 809a4f403695240b507528fb8fa3f7d390f86349..622f890d2613acf948b68d6febe0834ceec23c80 100644 +index 2e66315859c9374ae77288c35aaddf56d60cf0a2..7c00c4244233cee313127c1e8c06ef9288d5b9b1 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -707,7 +707,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player { @@ -109,10 +109,10 @@ index 9019e25f61d4fdb7c5d12ea7630b0bc23827ab6e..38cf3cf1cc7ebae4b6ca8a89dc026b5b PlayerQuitEvent playerQuitEvent = new PlayerQuitEvent(entityplayer.getBukkitEntity(), net.kyori.adventure.text.Component.translatable("multiplayer.player.left", net.kyori.adventure.text.format.NamedTextColor.YELLOW, io.papermc.paper.configuration.GlobalConfiguration.get().messages.useDisplayNameInQuitMessage ? entityplayer.getBukkitEntity().displayName() : io.papermc.paper.adventure.PaperAdventure.asAdventure(entityplayer.getDisplayName()))); // Paper - Adventure diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java -index 3512f0b309c7822f7b9d9eacbcf4dd84d9c24896..e60da80cbc2d2dbb98287470e1741fa2a3f95335 100644 +index 1b13096da1f0bc49efe25677ec24e6abe7ff2879..b70fbc1a93271bbf28402afbe9c6e538a4b6e9aa 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java -@@ -278,7 +278,7 @@ public abstract class Player extends LivingEntity { +@@ -279,7 +279,7 @@ public abstract class Player extends LivingEntity { this.updateIsUnderwater(); super.tick(); if (!this.level().isClientSide && this.containerMenu != null && !this.containerMenu.stillValid(this)) { @@ -121,7 +121,7 @@ index 3512f0b309c7822f7b9d9eacbcf4dd84d9c24896..e60da80cbc2d2dbb98287470e1741fa2 this.containerMenu = this.inventoryMenu; } -@@ -496,6 +496,13 @@ public abstract class Player extends LivingEntity { +@@ -497,6 +497,13 @@ public abstract class Player extends LivingEntity { } @@ -136,10 +136,10 @@ index 3512f0b309c7822f7b9d9eacbcf4dd84d9c24896..e60da80cbc2d2dbb98287470e1741fa2 this.containerMenu = this.inventoryMenu; } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -index dd3377a4f69e5ac10905e52d0eecc2427e72d856..c79607a2f45b7a487a95cf98b9b0eb6b36501410 100644 +index 2e02fc22a889c9c8010ae8bff1b59a13219ae014..703bb1bb42b1668c04824489fd2f349052025979 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -@@ -377,7 +377,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { +@@ -378,7 +378,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { if (((ServerPlayer) this.getHandle()).connection == null) return; if (this.getHandle().containerMenu != this.getHandle().inventoryMenu) { // fire INVENTORY_CLOSE if one already open @@ -148,7 +148,7 @@ index dd3377a4f69e5ac10905e52d0eecc2427e72d856..c79607a2f45b7a487a95cf98b9b0eb6b } ServerPlayer player = (ServerPlayer) this.getHandle(); AbstractContainerMenu container; -@@ -447,8 +447,14 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { +@@ -448,8 +448,14 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { @Override public void closeInventory() { @@ -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 27298cd0558b1ff2ab2ca341d62da2922507414b..38bc1747d2010b9233c64de81eb1c042bd1357b5 100644 +index 24928a1e12ecedaaa634be0ab5425ee77b0f6556..62c9f17fc4eeb5d26bfbeabad53016d959198393 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -1273,7 +1273,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -178,10 +178,10 @@ index 27298cd0558b1ff2ab2ca341d62da2922507414b..38bc1747d2010b9233c64de81eb1c042 // Check if the fromWorld and toWorld are the same. diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 86bddb9c39d8487f050d126dbb479315cb8a2818..8d86649579cb7eb90e3866ed81f2ba4f342f8b1c 100644 +index cf045e3ebe75046212755f18058bf4381bacacc1..836eba2f7b4260e5f882b202ef5923bb9bcfcd58 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -1264,7 +1264,7 @@ public class CraftEventFactory { +@@ -1268,7 +1268,7 @@ public class CraftEventFactory { public static AbstractContainerMenu callInventoryOpenEvent(ServerPlayer player, AbstractContainerMenu container, boolean cancelled) { if (player.containerMenu != player.inventoryMenu) { // fire INVENTORY_CLOSE if one already open @@ -190,7 +190,7 @@ index 86bddb9c39d8487f050d126dbb479315cb8a2818..8d86649579cb7eb90e3866ed81f2ba4f } CraftServer server = player.level().getCraftServer(); -@@ -1451,8 +1451,18 @@ public class CraftEventFactory { +@@ -1455,8 +1455,18 @@ public class CraftEventFactory { return event; } diff --git a/patches/server/0218-Vanished-players-don-t-have-rights.patch b/patches/server/0218-Vanished-players-don-t-have-rights.patch index bad792a73b..fc55caf3e7 100644 --- a/patches/server/0218-Vanished-players-don-t-have-rights.patch +++ b/patches/server/0218-Vanished-players-don-t-have-rights.patch @@ -89,10 +89,10 @@ index 16c244f56813479b2e51f1d883ff739949fc86e3..c0b0a9328faf93b85ceaf6cc9989f1a5 public boolean isClientSide() { return this.isClientSide; diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 8d86649579cb7eb90e3866ed81f2ba4f342f8b1c..635982e7c9bb650f72a987e2f866d6f91b75efcf 100644 +index 836eba2f7b4260e5f882b202ef5923bb9bcfcd58..1d2e9f3e5e232faca8de4760d3574fae6200b2b2 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -1301,6 +1301,14 @@ public class CraftEventFactory { +@@ -1305,6 +1305,14 @@ public class CraftEventFactory { Projectile projectile = (Projectile) entity.getBukkitEntity(); org.bukkit.entity.Entity collided = position.getEntity().getBukkitEntity(); com.destroystokyo.paper.event.entity.ProjectileCollideEvent event = new com.destroystokyo.paper.event.entity.ProjectileCollideEvent(projectile, collided); diff --git a/patches/server/0239-Add-More-Creeper-API.patch b/patches/server/0239-Add-More-Creeper-API.patch index 9f68dfd41a..931f2b6158 100644 --- a/patches/server/0239-Add-More-Creeper-API.patch +++ b/patches/server/0239-Add-More-Creeper-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add More Creeper API diff --git a/src/main/java/net/minecraft/world/entity/monster/Creeper.java b/src/main/java/net/minecraft/world/entity/monster/Creeper.java -index c3f59f4a2190327340df71c1283be490557a0a58..2c01fbea62812f795111060d260f871cdf85e8bf 100644 +index 95df4ac539ec284654c53d39955870a46478c27d..9bf11a8b44e696b6587bc775904a836d390e437b 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Creeper.java +++ b/src/main/java/net/minecraft/world/entity/monster/Creeper.java @@ -134,7 +134,7 @@ public class Creeper extends Monster implements PowerableMob { @@ -38,10 +38,10 @@ index c3f59f4a2190327340df71c1283be490557a0a58..2c01fbea62812f795111060d260f871c public boolean canDropMobsSkull() { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftCreeper.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftCreeper.java -index 127e65c5780c6727fde1ea3e597b116a475a666a..4191845bfe05d8691e50143c42090566522f7e74 100644 +index 15bd44f8bd08b55b4da7fbbfdddc7ec3db454d89..42dd26b9170f7d217d73f725a6b8440b45ac2190 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftCreeper.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftCreeper.java -@@ -88,4 +88,16 @@ public class CraftCreeper extends CraftMonster implements Creeper { +@@ -101,4 +101,16 @@ public class CraftCreeper extends CraftMonster implements Creeper { public String toString() { return "CraftCreeper"; } diff --git a/patches/server/0242-Add-ray-tracing-methods-to-LivingEntity.patch b/patches/server/0242-Add-ray-tracing-methods-to-LivingEntity.patch index 156b2c1079..f490695366 100644 --- a/patches/server/0242-Add-ray-tracing-methods-to-LivingEntity.patch +++ b/patches/server/0242-Add-ray-tracing-methods-to-LivingEntity.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add ray tracing methods to LivingEntity diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index ebd81b34d1fbb31ce0f9c92593154fdb6b62bf52..4bf729db65070ac34f7dd84cf16a9475db2ff7c0 100644 +index bf1b8ee85551ff1989369268edf8012758b86fd7..f7a77b31dc196823510f96bd3b2344058e20feac 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -3949,6 +3949,19 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3977,6 +3977,19 @@ public abstract class LivingEntity extends Entity implements Attackable { } // Paper start - Make shield blocking delay configurable diff --git a/patches/server/0243-Expose-attack-cooldown-methods-for-Player.patch b/patches/server/0243-Expose-attack-cooldown-methods-for-Player.patch index 36c48b1dd1..aa32d93194 100644 --- a/patches/server/0243-Expose-attack-cooldown-methods-for-Player.patch +++ b/patches/server/0243-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 38bc1747d2010b9233c64de81eb1c042bd1357b5..c0b92358c03d1724e8c134563f9ca98e69081c6a 100644 +index 62c9f17fc4eeb5d26bfbeabad53016d959198393..e55a8171ba65e1ca499ba3c6aaab9a63702fc298 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2979,6 +2979,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2980,6 +2980,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player { return this.adventure$pointers; } diff --git a/patches/server/0244-Improve-death-events.patch b/patches/server/0244-Improve-death-events.patch index b4abf99a98..b4d51a0bb0 100644 --- a/patches/server/0244-Improve-death-events.patch +++ b/patches/server/0244-Improve-death-events.patch @@ -19,7 +19,7 @@ public net.minecraft.world.entity.LivingEntity getDeathSound()Lnet/minecraft/sou public net.minecraft.world.entity.LivingEntity getSoundVolume()F diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 622f890d2613acf948b68d6febe0834ceec23c80..5bf3f2faac0af6bddfd2ecb423a13cdf0dd1af1b 100644 +index 7c00c4244233cee313127c1e8c06ef9288d5b9b1..91cc0488c37f60035d99aa310d99d5b8377dbafe 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -268,6 +268,10 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player { @@ -80,7 +80,7 @@ index 622f890d2613acf948b68d6febe0834ceec23c80..5bf3f2faac0af6bddfd2ecb423a13cdf } } diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 4bf729db65070ac34f7dd84cf16a9475db2ff7c0..2c426a68f72b1ed234529b02d2e1d2c18563414b 100644 +index f7a77b31dc196823510f96bd3b2344058e20feac..279fa00fd9043e1995f22c79f47d0b41c27bd933 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java @@ -283,6 +283,7 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -91,7 +91,7 @@ index 4bf729db65070ac34f7dd84cf16a9475db2ff7c0..2c426a68f72b1ed234529b02d2e1d2c1 @Override public float getBukkitYaw() { -@@ -1526,11 +1527,12 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -1537,11 +1538,12 @@ public abstract class LivingEntity extends Entity implements Attackable { if (this.isDeadOrDying()) { if (!this.checkTotemDeathProtection(source)) { @@ -107,7 +107,7 @@ index 4bf729db65070ac34f7dd84cf16a9475db2ff7c0..2c426a68f72b1ed234529b02d2e1d2c1 } } else if (flag1) { this.playHurtSound(source); -@@ -1689,6 +1691,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -1700,6 +1702,7 @@ public abstract class LivingEntity extends Entity implements Attackable { Entity entity = damageSource.getEntity(); LivingEntity entityliving = this.getKillCredit(); @@ -115,7 +115,7 @@ index 4bf729db65070ac34f7dd84cf16a9475db2ff7c0..2c426a68f72b1ed234529b02d2e1d2c1 if (this.deathScore >= 0 && entityliving != null) { entityliving.awardKillScore(this, this.deathScore, damageSource); } -@@ -1700,24 +1703,59 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -1711,24 +1714,59 @@ public abstract class LivingEntity extends Entity implements Attackable { if (!this.level().isClientSide && this.hasCustomName()) { if (org.spigotmc.SpigotConfig.logNamedDeaths) LivingEntity.LOGGER.info("Named entity {} died: {}", this, this.getCombatTracker().getDeathMessage().getString()); // Spigot } @@ -179,7 +179,7 @@ index 4bf729db65070ac34f7dd84cf16a9475db2ff7c0..2c426a68f72b1ed234529b02d2e1d2c1 } } -@@ -1725,7 +1763,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -1736,7 +1774,7 @@ public abstract class LivingEntity extends Entity implements Attackable { if (!this.level().isClientSide) { boolean flag = false; @@ -188,7 +188,7 @@ index 4bf729db65070ac34f7dd84cf16a9475db2ff7c0..2c426a68f72b1ed234529b02d2e1d2c1 if (this.level().getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) { BlockPos blockposition = this.blockPosition(); BlockState iblockdata = Blocks.WITHER_ROSE.defaultBlockState(); -@@ -1754,24 +1792,37 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -1765,24 +1803,37 @@ public abstract class LivingEntity extends Entity implements Attackable { } } @@ -423,10 +423,10 @@ index ee3902cbada46ffb78c42dbf6f00c859546c76e1..92bb0c63330ad3a4cb13b2dc65502071 // CraftBukkit end 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 c0b92358c03d1724e8c134563f9ca98e69081c6a..a33fc9288165ec013cef6b90d72871f0058c0857 100644 +index e55a8171ba65e1ca499ba3c6aaab9a63702fc298..ebb465cbc60d09d0087d2545ebd3b455bf5216de 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2516,7 +2516,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2517,7 +2517,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public void sendHealthUpdate() { FoodData foodData = this.getHandle().getFoodData(); @@ -443,10 +443,10 @@ index c0b92358c03d1724e8c134563f9ca98e69081c6a..a33fc9288165ec013cef6b90d72871f0 public void injectScaledMaxHealth(Collection<AttributeInstance> collection, boolean force) { diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 635982e7c9bb650f72a987e2f866d6f91b75efcf..5254a97f94d24717bdbba1768fffc3d8d292f0fe 100644 +index 1d2e9f3e5e232faca8de4760d3574fae6200b2b2..e7ba5b503e821d18467c2300f780ef37f996b34d 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -893,9 +893,16 @@ public class CraftEventFactory { +@@ -894,9 +894,16 @@ public class CraftEventFactory { CraftLivingEntity entity = (CraftLivingEntity) victim.getBukkitEntity(); CraftDamageSource bukkitDamageSource = new CraftDamageSource(damageSource); EntityDeathEvent event = new EntityDeathEvent(entity, bukkitDamageSource, drops, victim.getExpReward(damageSource.getEntity())); @@ -463,12 +463,11 @@ index 635982e7c9bb650f72a987e2f866d6f91b75efcf..5254a97f94d24717bdbba1768fffc3d8 victim.expToDrop = event.getDroppedExp(); for (org.bukkit.inventory.ItemStack stack : event.getDrops()) { -@@ -913,8 +920,15 @@ public class CraftEventFactory { +@@ -914,7 +921,14 @@ public class CraftEventFactory { PlayerDeathEvent event = new PlayerDeathEvent(entity, bukkitDamageSource, drops, victim.getExpReward(damageSource.getEntity()), 0, deathMessage); event.setKeepInventory(keepInventory); event.setKeepLevel(victim.keepLevel); // SPIGOT-2222: pre-set keepLevel + populateFields(victim, event); // Paper - make cancellable - org.bukkit.World world = entity.getWorld(); Bukkit.getServer().getPluginManager().callEvent(event); + // Paper start - make cancellable + if (event.isCancelled()) { diff --git a/patches/server/0254-Add-LivingEntity-getTargetEntity.patch b/patches/server/0254-Add-LivingEntity-getTargetEntity.patch index d1ac377090..f75a1b66aa 100644 --- a/patches/server/0254-Add-LivingEntity-getTargetEntity.patch +++ b/patches/server/0254-Add-LivingEntity-getTargetEntity.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add LivingEntity#getTargetEntity diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 2c426a68f72b1ed234529b02d2e1d2c18563414b..314fcbeffe3b0adcfbd59b744001b520d6d64a0c 100644 +index 279fa00fd9043e1995f22c79f47d0b41c27bd933..43eddcd8496ff2f089119f6632acfe1b56466c3d 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java @@ -127,6 +127,7 @@ import net.minecraft.world.level.storage.loot.LootTable; @@ -16,7 +16,7 @@ index 2c426a68f72b1ed234529b02d2e1d2c18563414b..314fcbeffe3b0adcfbd59b744001b520 import net.minecraft.world.phys.HitResult; import net.minecraft.world.phys.Vec3; import net.minecraft.world.scores.PlayerTeam; -@@ -4013,6 +4014,38 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -4041,6 +4042,38 @@ public abstract class LivingEntity extends Entity implements Attackable { return this.level().clip(raytrace); } diff --git a/patches/server/0261-Reset-players-airTicks-on-respawn.patch b/patches/server/0261-Reset-players-airTicks-on-respawn.patch index 4a7eda111a..c7bda44c48 100644 --- a/patches/server/0261-Reset-players-airTicks-on-respawn.patch +++ b/patches/server/0261-Reset-players-airTicks-on-respawn.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Reset players airTicks on respawn diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 2fd93f715bd69fb0217939c87f7872720a9adb7c..b4240bdd2d2baf91f52458602e0063f746dcfb6d 100644 +index 099e740df4966be29a52ea1398bfc7f531d4fb9d..1056286007e1c16c6fce3df7918a082a545f92b5 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -2699,6 +2699,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player { +@@ -2706,6 +2706,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player { this.setHealth(this.getMaxHealth()); this.stopUsingItem(); // CraftBukkit - SPIGOT-6682: Clear active item on reset diff --git a/patches/server/0269-force-entity-dismount-during-teleportation.patch b/patches/server/0269-force-entity-dismount-during-teleportation.patch index 3889b960f3..4c2464296c 100644 --- a/patches/server/0269-force-entity-dismount-during-teleportation.patch +++ b/patches/server/0269-force-entity-dismount-during-teleportation.patch @@ -20,10 +20,10 @@ this is going to be the best soultion all around. Improvements/suggestions welcome! diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index b4240bdd2d2baf91f52458602e0063f746dcfb6d..39504d27b8e0bae74c41e89ebabced1c25d30a7b 100644 +index 1056286007e1c16c6fce3df7918a082a545f92b5..8f3980afc38caf2eda927440957f3e0bb0f2ef66 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -2518,9 +2518,15 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player { +@@ -2525,9 +2525,15 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player { @Override public void stopRiding() { @@ -106,10 +106,10 @@ index 131eda47e7a9f90a4057607870acbcb8fecfbf0b..2e376b0b2bf2d49ad0669b6e6fd28762 if (this.valid) { Bukkit.getPluginManager().callEvent(event); diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 314fcbeffe3b0adcfbd59b744001b520d6d64a0c..1ac5e457257748261088f582ed26b94e0e18eced 100644 +index 43eddcd8496ff2f089119f6632acfe1b56466c3d..e047911c7faa3cdcd3df8899857fcadf3eec3d89 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -3591,9 +3591,15 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3619,9 +3619,15 @@ public abstract class LivingEntity extends Entity implements Attackable { @Override public void stopRiding() { @@ -146,10 +146,10 @@ index 882236c8ebad90ed2adc873de4dda3b7f3f869d9..632b74e84d6ee58da8806e30b75e16fb this.clientOldAttachPosition = this.blockPosition(); } diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java -index e60da80cbc2d2dbb98287470e1741fa2a3f95335..e7fc0f6d1a50e82c4c9fc75ca9190f63c5964f3b 100644 +index b70fbc1a93271bbf28402afbe9c6e538a4b6e9aa..fa906334a1c569748d3f2dc073ec03a85bd09d3b 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java -@@ -1160,7 +1160,13 @@ public abstract class Player extends LivingEntity { +@@ -1161,7 +1161,13 @@ public abstract class Player extends LivingEntity { @Override public void removeVehicle() { diff --git a/patches/server/0273-Replace-OfflinePlayer-getLastPlayed.patch b/patches/server/0273-Replace-OfflinePlayer-getLastPlayed.patch index dc94c698a3..e3974e72e1 100644 --- a/patches/server/0273-Replace-OfflinePlayer-getLastPlayed.patch +++ b/patches/server/0273-Replace-OfflinePlayer-getLastPlayed.patch @@ -16,7 +16,7 @@ intent to remove) and replace it with two new methods, clearly named and documented as to their purpose. diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 39504d27b8e0bae74c41e89ebabced1c25d30a7b..c75fed2aafc91fbfaed91f5337a5189a1dbb5341 100644 +index 8f3980afc38caf2eda927440957f3e0bb0f2ef66..4e8ef3dfde97f40d2c2163e2e811b2ae77bae14e 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -268,6 +268,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player { @@ -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 a33fc9288165ec013cef6b90d72871f0058c0857..d649fd886faf0d4d989362c4ef0e9c50247c280f 100644 +index ebb465cbc60d09d0087d2545ebd3b455bf5216de..3ca09d5eb1e97cbd11cab34aa8600b2c92237517 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -210,6 +210,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -117,7 +117,7 @@ index a33fc9288165ec013cef6b90d72871f0058c0857..d649fd886faf0d4d989362c4ef0e9c50 public CraftPlayer(CraftServer server, ServerPlayer entity) { super(server, entity); -@@ -2048,6 +2049,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2049,6 +2050,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player { this.firstPlayed = firstPlayed; } @@ -136,7 +136,7 @@ index a33fc9288165ec013cef6b90d72871f0058c0857..d649fd886faf0d4d989362c4ef0e9c50 public void readExtraData(CompoundTag nbttagcompound) { this.hasPlayedBefore = true; if (nbttagcompound.contains("bukkit")) { -@@ -2070,6 +2083,8 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2071,6 +2084,8 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } public void setExtraData(CompoundTag nbttagcompound) { @@ -145,7 +145,7 @@ index a33fc9288165ec013cef6b90d72871f0058c0857..d649fd886faf0d4d989362c4ef0e9c50 if (!nbttagcompound.contains("bukkit")) { nbttagcompound.put("bukkit", new CompoundTag()); } -@@ -2084,6 +2099,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2085,6 +2100,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/0289-Mob-Spawner-API-Enhancements.patch b/patches/server/0289-Mob-Spawner-API-Enhancements.patch index dc419af692..9f35b91c5a 100644 --- a/patches/server/0289-Mob-Spawner-API-Enhancements.patch +++ b/patches/server/0289-Mob-Spawner-API-Enhancements.patch @@ -69,43 +69,151 @@ index 1d0964a7f544735a0213d5c7832c71f53db139a9..b90127f9f805fdb5bb43a4b8ad2b1049 nbt.putShort("MaxNearbyEntities", (short) this.maxNearbyEntities); nbt.putShort("RequiredPlayerRange", (short) this.requiredPlayerRange); diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftCreatureSpawner.java b/src/main/java/org/bukkit/craftbukkit/block/CraftCreatureSpawner.java -index 33718f8861b46452ef9977ac0cbd7624a86edb30..4659f11c3aadda2617951f9d98b4858efe1400d7 100644 +index 9b2b6697d0b64da2bc99dc646f552c2689d5a1fc..146dde200845abcbe11015dda2c826a1aa711e42 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftCreatureSpawner.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftCreatureSpawner.java -@@ -256,4 +256,36 @@ public class CraftCreatureSpawner extends CraftBlockEntityState<SpawnerBlockEnti +@@ -29,7 +29,7 @@ import org.bukkit.craftbukkit.entity.CraftEntityType; + import org.bukkit.entity.EntitySnapshot; + import org.bukkit.entity.EntityType; + +-public class CraftCreatureSpawner extends CraftBlockEntityState<SpawnerBlockEntity> implements CreatureSpawner { ++public class CraftCreatureSpawner extends CraftBlockEntityState<SpawnerBlockEntity> implements CreatureSpawner, org.bukkit.craftbukkit.spawner.PaperSharedSpawnerLogic { // Paper - more spawner API + + public CraftCreatureSpawner(World world, SpawnerBlockEntity tileEntity) { + super(world, tileEntity); +@@ -291,4 +291,38 @@ public class CraftCreatureSpawner extends CraftBlockEntityState<SpawnerBlockEnti new HashMap<>(nms.slotDropChances().entrySet().stream().collect(Collectors.toMap((entry) -> CraftEquipmentSlot.getSlot(entry.getKey()), Map.Entry::getValue))) )).orElse(null); } + -+ // Paper start ++ // Paper start - more spawner API + @Override + public boolean isActivated() { -+ this.requirePlaced(); -+ return this.getSnapshot().getSpawner().isNearPlayer(this.world.getHandle(), this.getPosition()); ++ requirePlaced(); ++ return org.bukkit.craftbukkit.spawner.PaperSharedSpawnerLogic.super.isActivated(); + } + + @Override + public void resetTimer() { -+ this.requirePlaced(); -+ this.getSnapshot().getSpawner().delay(this.world.getHandle(), this.getPosition()); ++ requirePlaced(); ++ org.bukkit.craftbukkit.spawner.PaperSharedSpawnerLogic.super.resetTimer(); ++ } ++ ++ @Override ++ public void setNextSpawnData(final SpawnData spawnData) { ++ this.getSpawner().setNextSpawnData(this.isPlaced() ? this.getInternalWorld() : null, this.getInternalPosition(), spawnData); ++ } ++ ++ @Override ++ public BaseSpawner getSpawner() { ++ return this.getSnapshot().getSpawner(); ++ } ++ ++ @Override ++ public net.minecraft.core.BlockPos getInternalPosition() { ++ return this.getPosition(); ++ } ++ ++ @Override ++ public net.minecraft.world.level.Level getInternalWorld() { ++ return this.world.getHandle(); ++ } ++ // Paper end - more spawner API + } +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartMobSpawner.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartMobSpawner.java +index 72e34dbfadcebb26a0707ce095b0d270f4d1d97c..e8ece01669373ecf6552d33b2ed72668524e2650 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartMobSpawner.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartMobSpawner.java +@@ -16,7 +16,7 @@ import org.bukkit.entity.EntitySnapshot; + import org.bukkit.entity.EntityType; + import org.bukkit.entity.minecart.SpawnerMinecart; + +-final class CraftMinecartMobSpawner extends CraftMinecart implements SpawnerMinecart { ++final class CraftMinecartMobSpawner extends CraftMinecart implements SpawnerMinecart, org.bukkit.craftbukkit.spawner.PaperSharedSpawnerLogic { // Paper - more spawner API + CraftMinecartMobSpawner(CraftServer server, MinecartSpawner entity) { + super(server, entity); + } +@@ -171,4 +171,21 @@ final class CraftMinecartMobSpawner extends CraftMinecart implements SpawnerMine + public String toString() { + return "CraftMinecartMobSpawner"; + } ++ ++ // Paper start - more spawner API ++ @Override ++ public net.minecraft.world.level.BaseSpawner getSpawner() { ++ return this.getHandle().getSpawner(); + } + + @Override -+ public void setSpawnedItem(org.bukkit.inventory.ItemStack itemStack) { ++ public net.minecraft.world.level.Level getInternalWorld() { ++ return this.getHandle().level(); ++ } ++ ++ @Override ++ public net.minecraft.core.BlockPos getInternalPosition() { ++ return this.getHandle().blockPosition(); ++ } ++ // Paper end - more spawner API + } +diff --git a/src/main/java/org/bukkit/craftbukkit/spawner/PaperSharedSpawnerLogic.java b/src/main/java/org/bukkit/craftbukkit/spawner/PaperSharedSpawnerLogic.java +new file mode 100644 +index 0000000000000000000000000000000000000000..b1d08dc4c4257a6f5cd70dfdddade58ff7eedb4b +--- /dev/null ++++ b/src/main/java/org/bukkit/craftbukkit/spawner/PaperSharedSpawnerLogic.java +@@ -0,0 +1,56 @@ ++package org.bukkit.craftbukkit.spawner; ++ ++import com.google.common.base.Preconditions; ++import java.util.Optional; ++import net.minecraft.core.BlockPos; ++import net.minecraft.core.registries.BuiltInRegistries; ++import net.minecraft.nbt.CompoundTag; ++import net.minecraft.world.entity.Entity; ++import net.minecraft.world.entity.EntityType; ++import net.minecraft.world.level.BaseSpawner; ++import net.minecraft.world.level.Level; ++import net.minecraft.world.level.SpawnData; ++import org.bukkit.craftbukkit.inventory.CraftItemStack; ++import org.bukkit.inventory.ItemStack; ++import org.bukkit.spawner.Spawner; ++ ++/** ++ * A common parent interface for both the {@link org.bukkit.craftbukkit.block.CraftCreatureSpawner} and minecart mob spawner. ++ */ ++public interface PaperSharedSpawnerLogic extends Spawner { ++ ++ BaseSpawner getSpawner(); ++ ++ Level getInternalWorld(); ++ ++ BlockPos getInternalPosition(); ++ ++ default boolean isActivated() { ++ return this.getSpawner().isNearPlayer(this.getInternalWorld(), this.getInternalPosition()); ++ } ++ ++ default void resetTimer() { ++ this.getSpawner().delay(this.getInternalWorld(), this.getInternalPosition()); ++ } ++ ++ default void setNextSpawnData(SpawnData spawnData) { ++ this.getSpawner().setNextSpawnData(this.getInternalWorld(), this.getInternalPosition(), spawnData); ++ } ++ ++ default void setSpawnedItem(final ItemStack itemStack) { + Preconditions.checkArgument(itemStack != null && !itemStack.getType().isAir(), "spawners cannot spawn air"); -+ net.minecraft.world.item.ItemStack item = org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(itemStack); -+ net.minecraft.nbt.CompoundTag entity = new net.minecraft.nbt.CompoundTag(); -+ entity.putString("id", net.minecraft.core.registries.BuiltInRegistries.ENTITY_TYPE.getKey(net.minecraft.world.entity.EntityType.ITEM).toString()); -+ entity.put("Item", item.save(this.world.getHandle().registryAccess())); -+ this.getSnapshot().getSpawner().setNextSpawnData( -+ this.isPlaced() ? this.world.getHandle() : null, -+ this.getPosition(), ++ ++ final net.minecraft.world.item.ItemStack item = CraftItemStack.asNMSCopy(itemStack); ++ final CompoundTag entity = new CompoundTag(); ++ entity.putString(Entity.ID_TAG, BuiltInRegistries.ENTITY_TYPE.getKey(EntityType.ITEM).toString()); ++ entity.put("Item", item.save(this.getInternalWorld().registryAccess())); ++ ++ this.setNextSpawnData( + new net.minecraft.world.level.SpawnData( + entity, + java.util.Optional.empty(), -+ Optional.ofNullable(this.getSnapshot().getSpawner().nextSpawnData).flatMap(SpawnData::equipment) ++ Optional.ofNullable(this.getSpawner().nextSpawnData).flatMap(SpawnData::equipment) + ) + ); + } -+ // Paper end - } ++} diff --git a/patches/server/0298-Prevent-consuming-the-wrong-itemstack.patch b/patches/server/0298-Prevent-consuming-the-wrong-itemstack.patch index de0a5f77d5..cb2edff807 100644 --- a/patches/server/0298-Prevent-consuming-the-wrong-itemstack.patch +++ b/patches/server/0298-Prevent-consuming-the-wrong-itemstack.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Prevent consuming the wrong itemstack diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 1ac5e457257748261088f582ed26b94e0e18eced..94492da51fe2a6343ab3c41d26ca2a195e14bc62 100644 +index e047911c7faa3cdcd3df8899857fcadf3eec3d89..f13fb8d408e02e3c561e8f2b9c823c13033b4f94 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -3827,9 +3827,14 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3855,9 +3855,14 @@ public abstract class LivingEntity extends Entity implements Attackable { } public void startUsingItem(InteractionHand hand) { @@ -24,7 +24,7 @@ index 1ac5e457257748261088f582ed26b94e0e18eced..94492da51fe2a6343ab3c41d26ca2a19 this.useItem = itemstack; this.useItemRemaining = itemstack.getUseDuration(this); if (!this.level().isClientSide) { -@@ -3914,6 +3919,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3942,6 +3947,7 @@ public abstract class LivingEntity extends Entity implements Attackable { this.releaseUsingItem(); } else { if (!this.useItem.isEmpty() && this.isUsingItem()) { @@ -32,7 +32,7 @@ index 1ac5e457257748261088f582ed26b94e0e18eced..94492da51fe2a6343ab3c41d26ca2a19 this.triggerItemUseEffects(this.useItem, 16); // CraftBukkit start - fire PlayerItemConsumeEvent ItemStack itemstack; -@@ -3948,8 +3954,8 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3976,8 +3982,8 @@ public abstract class LivingEntity extends Entity implements Attackable { } this.stopUsingItem(); diff --git a/patches/server/0319-Entity-Jump-API.patch b/patches/server/0319-Entity-Jump-API.patch index 9d3bf218cf..20e546b1d6 100644 --- a/patches/server/0319-Entity-Jump-API.patch +++ b/patches/server/0319-Entity-Jump-API.patch @@ -7,10 +7,10 @@ Subject: [PATCH] Entity Jump API public net.minecraft.world.entity.LivingEntity jumping diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 94492da51fe2a6343ab3c41d26ca2a195e14bc62..9d924c48dedf9a61f555bf7c9d658e925169ccd2 100644 +index f13fb8d408e02e3c561e8f2b9c823c13033b4f94..f4ba1c72ec470cc79e40d7427e08185d5944d373 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -3405,8 +3405,10 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3433,8 +3433,10 @@ public abstract class LivingEntity extends Entity implements Attackable { } else if (this.isInLava() && (!this.onGround() || d3 > d4)) { this.jumpInLiquid(FluidTags.LAVA); } else if ((this.onGround() || flag && d3 <= d4) && this.noJumpDelay == 0) { diff --git a/patches/server/0322-add-hand-to-BlockMultiPlaceEvent.patch b/patches/server/0322-add-hand-to-BlockMultiPlaceEvent.patch index 3a4d8cf5a7..3247f38cb9 100644 --- a/patches/server/0322-add-hand-to-BlockMultiPlaceEvent.patch +++ b/patches/server/0322-add-hand-to-BlockMultiPlaceEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] add hand to BlockMultiPlaceEvent diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 5254a97f94d24717bdbba1768fffc3d8d292f0fe..6e9f0fdbfffe7a08185a125e2ad0f2227d25cc07 100644 +index e7ba5b503e821d18467c2300f780ef37f996b34d..f670ddd3633bf36b653bdf994f459e84e09bfbff 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -402,13 +402,18 @@ public class CraftEventFactory { +@@ -403,13 +403,18 @@ public class CraftEventFactory { } org.bukkit.inventory.ItemStack item; diff --git a/patches/server/0330-Add-Raw-Byte-ItemStack-Serialization.patch b/patches/server/0330-Add-Raw-Byte-ItemStack-Serialization.patch index 5862ff1c75..800948f497 100644 --- a/patches/server/0330-Add-Raw-Byte-ItemStack-Serialization.patch +++ b/patches/server/0330-Add-Raw-Byte-ItemStack-Serialization.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Add Raw Byte ItemStack Serialization Serializes using NBT which is safer for server data migrations than bukkits format. diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 7800e0a5aa381181d6a19d55f90490154de05c04..890beb473c240c084c4dd12c5dd792895117358e 100644 +index e85faddc157869824e30426a7ca2c577552aea9c..03a72e19e060cdb0dd8fcf52742da27dcfcd1356 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -483,6 +483,53 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -469,6 +469,53 @@ public final class CraftMagicNumbers implements UnsafeValues { public com.destroystokyo.paper.util.VersionFetcher getVersionFetcher() { return new com.destroystokyo.paper.PaperVersionFetcher(); } diff --git a/patches/server/0336-Dead-Player-s-shouldn-t-be-able-to-move.patch b/patches/server/0336-Dead-Player-s-shouldn-t-be-able-to-move.patch index 6666c9a721..d10a5a50c4 100644 --- a/patches/server/0336-Dead-Player-s-shouldn-t-be-able-to-move.patch +++ b/patches/server/0336-Dead-Player-s-shouldn-t-be-able-to-move.patch @@ -7,10 +7,10 @@ This fixes a lot of game state issues where packets were delayed for processing due to 1.15's new queue but processed while dead. diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java -index e7fc0f6d1a50e82c4c9fc75ca9190f63c5964f3b..acb2ccc8a940ea0ccd3d1f6d69c926d513f42872 100644 +index fa906334a1c569748d3f2dc073ec03a85bd09d3b..cb89b020d93ac838843ec2cbad562326a1e4257b 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java -@@ -1172,7 +1172,7 @@ public abstract class Player extends LivingEntity { +@@ -1173,7 +1173,7 @@ public abstract class Player extends LivingEntity { @Override protected boolean isImmobile() { diff --git a/patches/server/0341-Prevent-opening-inventories-when-frozen.patch b/patches/server/0341-Prevent-opening-inventories-when-frozen.patch index db9bb38d46..5969f96e51 100644 --- a/patches/server/0341-Prevent-opening-inventories-when-frozen.patch +++ b/patches/server/0341-Prevent-opening-inventories-when-frozen.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Prevent opening inventories when frozen diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 8dff4fb382639e4db9c80bbdfbc69167aa7996a1..1e780b73fac4d686444ff3a009cf33318068d8d1 100644 +index fb72ce049aeb49ee59cd07e074e61bb31591c252..b4089878f7f8cd32cea7741b72be5bb5218f3032 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -712,7 +712,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player { @@ -27,7 +27,7 @@ index 8dff4fb382639e4db9c80bbdfbc69167aa7996a1..1e780b73fac4d686444ff3a009cf3331 this.initMenu(container); return OptionalInt.of(this.containerCounter); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -index c79607a2f45b7a487a95cf98b9b0eb6b36501410..eb2d39d408e7f46a8f047a2b0d76981f24e1320a 100644 +index 703bb1bb42b1668c04824489fd2f349052025979..b55919a0e61a36697c95599dba17dbe2b788fd2a 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java @@ -326,7 +326,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { @@ -39,7 +39,7 @@ index c79607a2f45b7a487a95cf98b9b0eb6b36501410..eb2d39d408e7f46a8f047a2b0d76981f player.containerMenu = container; player.initMenu(container); } -@@ -400,7 +400,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { +@@ -401,7 +401,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { net.kyori.adventure.text.Component adventure$title = inventory.title(); // Paper if (adventure$title == null) adventure$title = net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(inventory.getTitle()); // Paper //player.connection.send(new ClientboundOpenScreenPacket(container.containerId, windowType, CraftChatMessage.fromString(title)[0])); // Paper - comment diff --git a/patches/server/0342-Don-t-run-entity-collision-code-if-not-needed.patch b/patches/server/0342-Don-t-run-entity-collision-code-if-not-needed.patch index 6495c29c30..ce9cc70a02 100644 --- a/patches/server/0342-Don-t-run-entity-collision-code-if-not-needed.patch +++ b/patches/server/0342-Don-t-run-entity-collision-code-if-not-needed.patch @@ -12,10 +12,10 @@ The entity's current team collision rule causes them to NEVER collide. Co-authored-by: Owen1212055 <[email protected]> diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 9d924c48dedf9a61f555bf7c9d658e925169ccd2..24ec68cecd11b8faa8bff11989b64985c26707cc 100644 +index f4ba1c72ec470cc79e40d7427e08185d5944d373..57528fce99102da6b3d0c3d9dbf9d2cd71375ff8 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -3516,10 +3516,24 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3544,10 +3544,24 @@ public abstract class LivingEntity extends Entity implements Attackable { if (this.level().isClientSide()) { this.level().getEntities(EntityTypeTest.forClass(net.minecraft.world.entity.player.Player.class), this.getBoundingBox(), EntitySelector.pushableBy(this)).forEach(this::doPush); } else { diff --git a/patches/server/0347-Add-PlayerAttackEntityCooldownResetEvent.patch b/patches/server/0347-Add-PlayerAttackEntityCooldownResetEvent.patch index 90c43e9e4d..be9e57b2e3 100644 --- a/patches/server/0347-Add-PlayerAttackEntityCooldownResetEvent.patch +++ b/patches/server/0347-Add-PlayerAttackEntityCooldownResetEvent.patch @@ -5,15 +5,16 @@ Subject: [PATCH] Add PlayerAttackEntityCooldownResetEvent diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 24ec68cecd11b8faa8bff11989b64985c26707cc..045cfadc67c597f4607ed3ba6a5c9b06e95814ba 100644 +index 57528fce99102da6b3d0c3d9dbf9d2cd71375ff8..f2e66b50b32d197f9a8d4a9672ebf1413e66d59b 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -2248,7 +2248,16 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -2277,7 +2277,17 @@ public abstract class LivingEntity extends Entity implements Attackable { + } - EntityDamageEvent event = CraftEventFactory.handleLivingEntityDamageEvent(this, damagesource, originalDamage, hardHatModifier, blockingModifier, armorModifier, resistanceModifier, magicModifier, absorptionModifier, hardHat, blocking, armor, resistance, magic, absorption); if (damagesource.getEntity() instanceof net.minecraft.world.entity.player.Player) { - ((net.minecraft.world.entity.player.Player) damagesource.getEntity()).resetAttackStrengthTicker(); // Moved from EntityHuman in order to make the cooldown reset get called after the damage event is fired + // Paper start - PlayerAttackEntityCooldownResetEvent ++ //((net.minecraft.world.entity.player.Player) damagesource.getEntity()).resetAttackStrengthTicker(); // Moved from EntityHuman in order to make the cooldown reset get called after the damage event is fired + if (damagesource.getEntity() instanceof ServerPlayer) { + ServerPlayer player = (ServerPlayer) damagesource.getEntity(); + if (new com.destroystokyo.paper.event.player.PlayerAttackEntityCooldownResetEvent(player.getBukkitEntity(), this.getBukkitEntity(), player.getAttackStrengthScale(0F)).callEvent()) { @@ -24,5 +25,5 @@ index 24ec68cecd11b8faa8bff11989b64985c26707cc..045cfadc67c597f4607ed3ba6a5c9b06 + } + // Paper end - PlayerAttackEntityCooldownResetEvent } - if (event.isCancelled()) { - return false; + + // Resistance diff --git a/patches/server/0350-Fix-item-duplication-and-teleport-issues.patch b/patches/server/0350-Fix-item-duplication-and-teleport-issues.patch index c3d180d8c1..5c2cede8f5 100644 --- a/patches/server/0350-Fix-item-duplication-and-teleport-issues.patch +++ b/patches/server/0350-Fix-item-duplication-and-teleport-issues.patch @@ -69,10 +69,10 @@ index 61ae5553a22adc84acbe2962632b8f564ed80d88..2c21ef3f9096d1282091a7ec34e57fd7 public float getBlockExplosionResistance(Explosion explosion, BlockGetter world, BlockPos pos, BlockState blockState, FluidState fluidState, float max) { diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 045cfadc67c597f4607ed3ba6a5c9b06e95814ba..2fb30b4841cbbbe388c28477e13d882446ff73e7 100644 +index f2e66b50b32d197f9a8d4a9672ebf1413e66d59b..fe73a6728de0fad50451d3090002b6c0421d4c43 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -1717,9 +1717,9 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -1728,9 +1728,9 @@ public abstract class LivingEntity extends Entity implements Attackable { // Paper start org.bukkit.event.entity.EntityDeathEvent deathEvent = this.dropAllDeathLoot(worldserver, damageSource); if (deathEvent == null || !deathEvent.isCancelled()) { @@ -85,7 +85,7 @@ index 045cfadc67c597f4607ed3ba6a5c9b06e95814ba..2fb30b4841cbbbe388c28477e13d8824 // Paper start - clear equipment if event is not cancelled if (this instanceof Mob) { for (EquipmentSlot slot : this.clearedEquipmentSlots) { -@@ -1811,8 +1811,13 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -1822,8 +1822,13 @@ public abstract class LivingEntity extends Entity implements Attackable { this.dropCustomDeathLoot(world, damageSource, flag); this.clearEquipmentSlots = prev; // Paper } @@ -124,10 +124,10 @@ index 92bb0c63330ad3a4cb13b2dc655020714e9b1ffd..cc1189c2d7dc57ba8f29aad4ba5d2a07 } } diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 6e9f0fdbfffe7a08185a125e2ad0f2227d25cc07..720ea811407b4288b9923cf7db0ac44ad1a086e0 100644 +index f670ddd3633bf36b653bdf994f459e84e09bfbff..01c16286cf210a366decf7046a6a6b94284f9934 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -895,6 +895,11 @@ public class CraftEventFactory { +@@ -896,6 +896,11 @@ public class CraftEventFactory { } public static EntityDeathEvent callEntityDeathEvent(net.minecraft.world.entity.LivingEntity victim, DamageSource damageSource, List<org.bukkit.inventory.ItemStack> drops) { @@ -139,7 +139,7 @@ index 6e9f0fdbfffe7a08185a125e2ad0f2227d25cc07..720ea811407b4288b9923cf7db0ac44a CraftLivingEntity entity = (CraftLivingEntity) victim.getBukkitEntity(); CraftDamageSource bukkitDamageSource = new CraftDamageSource(damageSource); EntityDeathEvent event = new EntityDeathEvent(entity, bukkitDamageSource, drops, victim.getExpReward(damageSource.getEntity())); -@@ -909,11 +914,13 @@ public class CraftEventFactory { +@@ -910,11 +915,13 @@ public class CraftEventFactory { playDeathSound(victim, event); // Paper end victim.expToDrop = event.getDroppedExp(); diff --git a/patches/server/0358-ExperienceOrb-merging-stacking-API-and-fixes.patch b/patches/server/0358-ExperienceOrb-merging-stacking-API-and-fixes.patch index fb7613e2f0..4686e1475f 100644 --- a/patches/server/0358-ExperienceOrb-merging-stacking-API-and-fixes.patch +++ b/patches/server/0358-ExperienceOrb-merging-stacking-API-and-fixes.patch @@ -77,10 +77,10 @@ index 5a7d314ec0562e472f5dc45924a7b24841cff126..650e4a01cecc4cc08e7ff9ebcc4c3670 public java.util.UUID getTriggerEntityId() { return getHandle().triggerEntityId; diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 720ea811407b4288b9923cf7db0ac44ad1a086e0..82f7a36e71ed17d44ad0e5be99f8f6fc450d0732 100644 +index 01c16286cf210a366decf7046a6a6b94284f9934..baf282b200a14733cf2148f237d972224d60a266 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -704,15 +704,29 @@ public class CraftEventFactory { +@@ -705,15 +705,29 @@ public class CraftEventFactory { if (entity instanceof net.minecraft.world.entity.ExperienceOrb xp) { double radius = world.spigotConfig.expMerge; if (radius > 0) { diff --git a/patches/server/0383-Improve-fix-EntityTargetLivingEntityEvent.patch b/patches/server/0383-Improve-fix-EntityTargetLivingEntityEvent.patch index 513faeb27d..29703174a1 100644 --- a/patches/server/0383-Improve-fix-EntityTargetLivingEntityEvent.patch +++ b/patches/server/0383-Improve-fix-EntityTargetLivingEntityEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Improve/fix EntityTargetLivingEntityEvent diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/StopAttackingIfTargetInvalid.java b/src/main/java/net/minecraft/world/entity/ai/behavior/StopAttackingIfTargetInvalid.java -index 5aeef564cdaabeed88a52635e56073cca3a9d1f1..fe635e46569c67dac1d3581ee930d1bfa8b4030e 100644 +index cc7d161b53a2295fa1745254eafb8a70c7b6c7b2..508d4f391fe563453d7bf6782b3082741c358006 100644 --- a/src/main/java/net/minecraft/world/entity/ai/behavior/StopAttackingIfTargetInvalid.java +++ b/src/main/java/net/minecraft/world/entity/ai/behavior/StopAttackingIfTargetInvalid.java -@@ -47,17 +47,30 @@ public class StopAttackingIfTargetInvalid { +@@ -47,9 +47,22 @@ public class StopAttackingIfTargetInvalid { if (entityinsentient.canAttack(entityliving) && (!shouldForgetIfTargetUnreachable || !StopAttackingIfTargetInvalid.isTiredOfTryingToReachTarget(entityinsentient, behaviorbuilder_b.tryGet(memoryaccessor1))) && entityliving.isAlive() && entityliving.level() == entityinsentient.level() && !alternativeCondition.test(entityliving)) { return true; } else { @@ -33,16 +33,3 @@ index 5aeef564cdaabeed88a52635e56073cca3a9d1f1..fe635e46569c67dac1d3581ee930d1bf if (event.isCancelled()) { return false; } -- if (event.getTarget() == null) { -- memoryaccessor.erase(); -- return true; -- } -- entityliving = ((CraftLivingEntity) event.getTarget()).getHandle(); -+ // if (event.getTarget() == null) { // Paper - this is wrong, you are skipping the forgetCallback -+ // memoryaccessor.erase(); -+ // return true; -+ // } -+ // entityliving = ((CraftLivingEntity) event.getTarget()).getHandle(); - // CraftBukkit end - forgetCallback.accept(entityinsentient, entityliving); - memoryaccessor.erase(); diff --git a/patches/server/0385-Add-PrepareResultEvent.patch b/patches/server/0385-Add-PrepareResultEvent.patch index e49f683638..962fe95587 100644 --- a/patches/server/0385-Add-PrepareResultEvent.patch +++ b/patches/server/0385-Add-PrepareResultEvent.patch @@ -94,10 +94,10 @@ index 04d9793a83c724350f74616558f650082f9805d9..bb29107cb15e2ec644a14cabb3cf91f4 private static SingleRecipeInput createRecipeInput(Container inventory) { diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 82f7a36e71ed17d44ad0e5be99f8f6fc450d0732..679098ee1e0117c5786ddcf10540f09ae4ca3946 100644 +index baf282b200a14733cf2148f237d972224d60a266..cd3c0f9672aca19e28aa3e04e0060bf250f122ce 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -1653,6 +1653,12 @@ public class CraftEventFactory { +@@ -1657,6 +1657,12 @@ public class CraftEventFactory { } public static PrepareAnvilEvent callPrepareAnvilEvent(InventoryView view, ItemStack item) { @@ -110,7 +110,7 @@ index 82f7a36e71ed17d44ad0e5be99f8f6fc450d0732..679098ee1e0117c5786ddcf10540f09a PrepareAnvilEvent event = new PrepareAnvilEvent(view, CraftItemStack.asCraftMirror(item).clone()); event.getView().getPlayer().getServer().getPluginManager().callEvent(event); event.getInventory().setItem(2, event.getResult()); -@@ -1660,6 +1666,12 @@ public class CraftEventFactory { +@@ -1664,6 +1670,12 @@ public class CraftEventFactory { } public static PrepareGrindstoneEvent callPrepareGrindstoneEvent(InventoryView view, ItemStack item) { @@ -123,7 +123,7 @@ index 82f7a36e71ed17d44ad0e5be99f8f6fc450d0732..679098ee1e0117c5786ddcf10540f09a PrepareGrindstoneEvent event = new PrepareGrindstoneEvent(view, CraftItemStack.asCraftMirror(item).clone()); event.getView().getPlayer().getServer().getPluginManager().callEvent(event); event.getInventory().setItem(2, event.getResult()); -@@ -1667,12 +1679,39 @@ public class CraftEventFactory { +@@ -1671,12 +1683,39 @@ public class CraftEventFactory { } public static PrepareSmithingEvent callPrepareSmithingEvent(InventoryView view, ItemStack item) { diff --git a/patches/server/0386-Don-t-check-chunk-for-portal-on-world-gen-entity-add.patch b/patches/server/0386-Don-t-check-chunk-for-portal-on-world-gen-entity-add.patch index 5be503cd7d..0603020790 100644 --- a/patches/server/0386-Don-t-check-chunk-for-portal-on-world-gen-entity-add.patch +++ b/patches/server/0386-Don-t-check-chunk-for-portal-on-world-gen-entity-add.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Don't check chunk for portal on world gen entity add diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 2fb30b4841cbbbe388c28477e13d882446ff73e7..2ca4bb4784e3ef6760e1f2e1eab93cfbc5b27a0f 100644 +index fe73a6728de0fad50451d3090002b6c0421d4c43..ef2240b476cc994618ea002b302b537a5d70c799 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -3630,7 +3630,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3659,7 +3659,7 @@ public abstract class LivingEntity extends Entity implements Attackable { Entity entity = this.getVehicle(); super.stopRiding(suppressCancellation); // Paper - Force entity dismount during teleportation diff --git a/patches/server/0395-Brand-support.patch b/patches/server/0395-Brand-support.patch index 0e14f01ddc..24c2290fe4 100644 --- a/patches/server/0395-Brand-support.patch +++ b/patches/server/0395-Brand-support.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Brand support diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 9cba3ac95318f1a4b680b541ce5d825fc5c4ad02..4998643920b8314737832ad15431b794e1aa6df0 100644 +index d4e933b8d0f2352ac035b99fc386e6fe6d7f6651..4e76d4cacf688bce9d00eaff5ea601dbf16493e9 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -294,6 +294,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player { @@ -57,10 +57,10 @@ index 2d1fad00ee084841618f0da8113c7aac8c0e2b0d..a3c67bdc2c08b3550534f37d15b0db90 } 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 8865dabc729af78fcc306d48e754c54f80dfb2e4..74e40e74f95d366b508d6e746f3ed2710ab0613a 100644 +index aa549021a1676d0aa0aa7c9f1b0bf0bb800385a4..1febe581fbbc3accbf8fdbf086fba427cefdd3e9 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -3138,6 +3138,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -3139,6 +3139,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { // Paper end }; diff --git a/patches/server/0402-Add-BellRingEvent.patch b/patches/server/0402-Add-BellRingEvent.patch index 9ac85f17e9..6b974f5db0 100644 --- a/patches/server/0402-Add-BellRingEvent.patch +++ b/patches/server/0402-Add-BellRingEvent.patch @@ -7,10 +7,10 @@ Add a new event, BellRingEvent, to trigger whenever a player rings a village bell. Passes along the bell block and the player who rang it. diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 679098ee1e0117c5786ddcf10540f09ae4ca3946..4679e1399288db68ae0325cf62ea1a8fb6d6c80b 100644 +index cd3c0f9672aca19e28aa3e04e0060bf250f122ce..dc7c73f36b7df05ee34e9686c99c44a24acecdcb 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -368,10 +368,11 @@ public class CraftEventFactory { +@@ -369,10 +369,11 @@ public class CraftEventFactory { return tradeSelectEvent; } diff --git a/patches/server/0408-Add-methods-to-get-translation-keys.patch b/patches/server/0408-Add-methods-to-get-translation-keys.patch index 7bc6ab009f..cae11912b6 100644 --- a/patches/server/0408-Add-methods-to-get-translation-keys.patch +++ b/patches/server/0408-Add-methods-to-get-translation-keys.patch @@ -42,10 +42,10 @@ index f6ffb81b68e0cf3afebe901a5ba8e305bb94b77a..f2f62667ddf082796011ad7dd025e885 + // Paper end - add Translatable } diff --git a/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java b/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java -index 97a7dc31fe7a2defed2202ccc518c66b7ff4b0da..3ea6e6678432957c5caaff15ba20f8a8ddb393c9 100644 +index f73017bff613bd62b86c974b29576e241c24c927..fc6606e1bf2e2c35cb6c84af78859c3441775907 100644 --- a/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java +++ b/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java -@@ -171,6 +171,11 @@ public class CraftEnchantment extends Enchantment implements Handleable<net.mine +@@ -150,6 +150,11 @@ public class CraftEnchantment extends Enchantment implements Handleable<net.mine public net.kyori.adventure.text.Component displayName(int level) { return io.papermc.paper.adventure.PaperAdventure.asAdventure(getHandle().getFullname(level)); } @@ -58,10 +58,10 @@ index 97a7dc31fe7a2defed2202ccc518c66b7ff4b0da..3ea6e6678432957c5caaff15ba20f8a8 @Override diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemType.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemType.java -index 47b5a4aeb3e67e7009962c610f8f45a496671b89..3ad2d93fa4b5174531349e9dfce4f48944ee8cc5 100644 +index d20fdd4f06faa09c7d9f9e04f379cf0fa68db9bb..66d773cadb74f9176e6cf68a565568034f52ec63 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemType.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemType.java -@@ -236,4 +236,11 @@ public class CraftItemType<M extends ItemMeta> implements ItemType.Typed<M>, Han +@@ -240,4 +240,11 @@ public class CraftItemType<M extends ItemMeta> implements ItemType.Typed<M>, Han public Material asMaterial() { return Registry.MATERIAL.get(this.key); } @@ -74,7 +74,7 @@ index 47b5a4aeb3e67e7009962c610f8f45a496671b89..3ad2d93fa4b5174531349e9dfce4f489 + // Paper end - add Translatable } diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaFirework.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaFirework.java -index 11960a5433675c25d7ba061be753815746dd0142..f2cecd01f7f214a023e1bdeecc14359f696fb9d4 100644 +index 305eac6845119c36d041bf75930eb0909405911c..8c1d2d0521da52f9a1262f5433da21700b9b0454 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaFirework.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaFirework.java @@ -110,7 +110,7 @@ class CraftMetaFirework extends CraftMetaItem implements FireworkMeta { diff --git a/patches/server/0412-Add-additional-open-container-api-to-HumanEntity.patch b/patches/server/0412-Add-additional-open-container-api-to-HumanEntity.patch index 47aa453acf..be29dd6b1c 100644 --- a/patches/server/0412-Add-additional-open-container-api-to-HumanEntity.patch +++ b/patches/server/0412-Add-additional-open-container-api-to-HumanEntity.patch @@ -7,10 +7,10 @@ Subject: [PATCH] Add additional open container api to HumanEntity public net/minecraft/world/level/block/state/BlockBehaviour getMenuProvider(Lnet/minecraft/world/level/block/state/BlockState;Lnet/minecraft/world/level/Level;Lnet/minecraft/core/BlockPos;)Lnet/minecraft/world/MenuProvider; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -index bbd3f0981eb95348ef12c9af8fa1712c022ed869..9393e9d21fcc41cb0f20b98d9f28c95b0e523f62 100644 +index 084938fa2ffa7ee462766bf03f8e2b4c0fd4bf6b..8f4c4fed41676157b717c20a5ccbfe6ad4bdb3c4 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -@@ -462,6 +462,70 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { +@@ -463,6 +463,70 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { return this.getHandle().containerMenu.getBukkitView(); } diff --git a/patches/server/0415-Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch b/patches/server/0415-Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch index 1be83ad335..31a4396f92 100644 --- a/patches/server/0415-Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch +++ b/patches/server/0415-Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch @@ -21,10 +21,10 @@ index 335962dfe50d8d691a2a1fc6224950641e2b5a2b..203aacc9e116c1335bde1cff4d59674b + // Paper end - Expose entity id counter } diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 890beb473c240c084c4dd12c5dd792895117358e..5eeb2a46cb093d21ce7276373a838041be7a47b3 100644 +index 03a72e19e060cdb0dd8fcf52742da27dcfcd1356..94ec28a4f9d12873dff6700a12fb66e29820d3d9 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -530,6 +530,11 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -516,6 +516,11 @@ public final class CraftMagicNumbers implements UnsafeValues { Preconditions.checkArgument(dataVersion <= getDataVersion(), "Newer version! Server downgrades are not supported!"); return compound; } diff --git a/patches/server/0431-Fix-client-lag-on-advancement-loading.patch b/patches/server/0431-Fix-client-lag-on-advancement-loading.patch index b21d181e44..ded2b5101b 100644 --- a/patches/server/0431-Fix-client-lag-on-advancement-loading.patch +++ b/patches/server/0431-Fix-client-lag-on-advancement-loading.patch @@ -15,10 +15,10 @@ manually reload the advancement data for all players, which normally takes place as a part of the datapack reloading. diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 5eeb2a46cb093d21ce7276373a838041be7a47b3..50322927460ec9464363617e3f7fe5ff8faa1f6f 100644 +index 94ec28a4f9d12873dff6700a12fb66e29820d3d9..7427a81a779b82f96d34a3de228c9d59ee77fea7 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -337,7 +337,13 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -333,7 +333,13 @@ public final class CraftMagicNumbers implements UnsafeValues { Bukkit.getLogger().log(Level.SEVERE, "Error saving advancement " + key, ex); } diff --git a/patches/server/0437-Fix-Player-spawnParticle-x-y-z-precision-loss.patch b/patches/server/0437-Fix-Player-spawnParticle-x-y-z-precision-loss.patch index bb0bf54468..83724b282d 100644 --- a/patches/server/0437-Fix-Player-spawnParticle-x-y-z-precision-loss.patch +++ b/patches/server/0437-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 74e40e74f95d366b508d6e746f3ed2710ab0613a..803a1d9350276c44eef622436cc4026460436ae7 100644 +index 1febe581fbbc3accbf8fdbf086fba427cefdd3e9..533bb2da5ed226a31f0534f17048afa2d99e36ee 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2706,7 +2706,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2707,7 +2707,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public <T> void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data, boolean force) { diff --git a/patches/server/0442-Climbing-should-not-bypass-cramming-gamerule.patch b/patches/server/0442-Climbing-should-not-bypass-cramming-gamerule.patch index 7ee5e8ee65..db770d8d73 100644 --- a/patches/server/0442-Climbing-should-not-bypass-cramming-gamerule.patch +++ b/patches/server/0442-Climbing-should-not-bypass-cramming-gamerule.patch @@ -44,10 +44,10 @@ index ee4495b67c46cf1282cdd6ad15b224b0b7b10bfb..e382a29b441b656f35bc24cb90f95cb4 } else if (entity.level().isClientSide && (!(entity1 instanceof Player) || !((Player) entity1).isLocalPlayer())) { return false; diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 2ca4bb4784e3ef6760e1f2e1eab93cfbc5b27a0f..536625307d7b820bd5293e70274e4d3885b04cba 100644 +index ef2240b476cc994618ea002b302b537a5d70c799..c7ead86c5048381c97d01a09ac8a5a84cd93c5db 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -3544,7 +3544,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3573,7 +3573,7 @@ public abstract class LivingEntity extends Entity implements Attackable { return; } // Paper end - don't run getEntities if we're not going to use its result @@ -56,7 +56,7 @@ index 2ca4bb4784e3ef6760e1f2e1eab93cfbc5b27a0f..536625307d7b820bd5293e70274e4d38 if (!list.isEmpty()) { // Paper - don't run getEntities if we're not going to use its result; moved up -@@ -3736,9 +3736,16 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3765,9 +3765,16 @@ public abstract class LivingEntity extends Entity implements Attackable { return !this.isRemoved() && this.collides; // CraftBukkit } diff --git a/patches/server/0449-Expose-LivingEntity-hurt-direction.patch b/patches/server/0449-Expose-LivingEntity-hurt-direction.patch index ccb9fb6c2d..f43a7b04aa 100644 --- a/patches/server/0449-Expose-LivingEntity-hurt-direction.patch +++ b/patches/server/0449-Expose-LivingEntity-hurt-direction.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Expose LivingEntity hurt direction diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java -index acb2ccc8a940ea0ccd3d1f6d69c926d513f42872..80426e943b38e1cbde6ce80b3964df4d5ae23c94 100644 +index cb89b020d93ac838843ec2cbad562326a1e4257b..513e6505706e64f9410fa190014976dc469793af 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java -@@ -187,7 +187,7 @@ public abstract class Player extends LivingEntity { +@@ -188,7 +188,7 @@ public abstract class Player extends LivingEntity { private Optional<GlobalPos> lastDeathLocation; @Nullable public FishingHook fishing; @@ -18,7 +18,7 @@ index acb2ccc8a940ea0ccd3d1f6d69c926d513f42872..80426e943b38e1cbde6ce80b3964df4d public Vec3 currentImpulseImpactPos; @Nullable diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -index 9393e9d21fcc41cb0f20b98d9f28c95b0e523f62..796945fb1a8b43987ed9f01375113b2c13ff67c0 100644 +index 8f4c4fed41676157b717c20a5ccbfe6ad4bdb3c4..87d067c3a83283931bc16dccf6a304142848cd6a 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java @@ -125,6 +125,13 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { diff --git a/patches/server/0450-Add-OBSTRUCTED-reason-to-BedEnterResult.patch b/patches/server/0450-Add-OBSTRUCTED-reason-to-BedEnterResult.patch index c72796ff26..decc5ee07c 100644 --- a/patches/server/0450-Add-OBSTRUCTED-reason-to-BedEnterResult.patch +++ b/patches/server/0450-Add-OBSTRUCTED-reason-to-BedEnterResult.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add OBSTRUCTED reason to BedEnterResult diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 4679e1399288db68ae0325cf62ea1a8fb6d6c80b..57e25bf61b2d25d736a97e9aadc8cfaddf29ea58 100644 +index dc7c73f36b7df05ee34e9686c99c44a24acecdcb..22bfea79a98963d4f1a7ac61fac7b194e929a4f6 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -303,6 +303,10 @@ public class CraftEventFactory { +@@ -304,6 +304,10 @@ public class CraftEventFactory { return BedEnterResult.TOO_FAR_AWAY; case NOT_SAFE: return BedEnterResult.NOT_SAFE; diff --git a/patches/server/0467-Add-BlockFailedDispenseEvent.patch b/patches/server/0467-Add-BlockFailedDispenseEvent.patch index 4d96419af9..9558081db4 100644 --- a/patches/server/0467-Add-BlockFailedDispenseEvent.patch +++ b/patches/server/0467-Add-BlockFailedDispenseEvent.patch @@ -32,10 +32,10 @@ index a1599eae0d8e9f0298fc6996ad03b0d6ba78f04f..083ddfb8fffa04dad6eeca2274f290a0 } else { ItemStack itemstack = tileentitydispenser.getItem(i); diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 57e25bf61b2d25d736a97e9aadc8cfaddf29ea58..b6456c7fdd97925a8b68bdb80ff53c441f7996c7 100644 +index 22bfea79a98963d4f1a7ac61fac7b194e929a4f6..3ae196422395302a198b507c16347e7051ff5fd1 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -2058,4 +2058,12 @@ public class CraftEventFactory { +@@ -2077,4 +2077,12 @@ public class CraftEventFactory { return org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(event.getPotion()); } // Paper end - WitchReadyPotionEvent diff --git a/patches/server/0482-Add-BlockPreDispenseEvent.patch b/patches/server/0482-Add-BlockPreDispenseEvent.patch index 76ee7d959e..c177a17c48 100644 --- a/patches/server/0482-Add-BlockPreDispenseEvent.patch +++ b/patches/server/0482-Add-BlockPreDispenseEvent.patch @@ -29,10 +29,10 @@ index 083ddfb8fffa04dad6eeca2274f290a08e62b5eb..45fafee2cf1893dccf477939dad05e9e } else { // CraftBukkit start - Fire event when pushing items into other inventories diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index b6456c7fdd97925a8b68bdb80ff53c441f7996c7..fd889f0af29703c85a78b8189881516d54d147a6 100644 +index 3ae196422395302a198b507c16347e7051ff5fd1..4be2bbf2c7001c8f716c1cd11b7624e9f3cbe79a 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -2065,5 +2065,11 @@ public class CraftEventFactory { +@@ -2084,5 +2084,11 @@ public class CraftEventFactory { io.papermc.paper.event.block.BlockFailedDispenseEvent event = new io.papermc.paper.event.block.BlockFailedDispenseEvent(block); return event.callEvent(); } diff --git a/patches/server/0486-Expand-EntityUnleashEvent.patch b/patches/server/0486-Expand-EntityUnleashEvent.patch index db29f0fdcd..02e8ed7290 100644 --- a/patches/server/0486-Expand-EntityUnleashEvent.patch +++ b/patches/server/0486-Expand-EntityUnleashEvent.patch @@ -121,10 +121,10 @@ index 3c0af74ed65610b1d5e3b72fdcf28c5a3423f0da..01173fc7177d78588978e087e63efda0 flag1 = true; } diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index fd889f0af29703c85a78b8189881516d54d147a6..7310d8011fc27b17360887c048cb6eb79e2c0b1f 100644 +index 4be2bbf2c7001c8f716c1cd11b7624e9f3cbe79a..87c90c401c965ac65fcbe88bf2e1ef85bfd46755 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -1570,8 +1570,10 @@ public class CraftEventFactory { +@@ -1574,8 +1574,10 @@ public class CraftEventFactory { Bukkit.getPluginManager().callEvent(new PlayerRecipeBookSettingsChangeEvent(player.getBukkitEntity(), bukkitType, open, filter)); } diff --git a/patches/server/0489-Add-EntityMoveEvent.patch b/patches/server/0489-Add-EntityMoveEvent.patch index 724779feec..983c902724 100644 --- a/patches/server/0489-Add-EntityMoveEvent.patch +++ b/patches/server/0489-Add-EntityMoveEvent.patch @@ -29,10 +29,10 @@ index deabbf30a550ff1835530257177b8f47e4710414..6b2d00878a373680bc3d59e19ae11a2d public LevelChunk getChunkIfLoaded(int x, int z) { return this.chunkSource.getChunk(x, z, false); diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 536625307d7b820bd5293e70274e4d3885b04cba..9153119e21c75b3d523e10897935d931f633f1a5 100644 +index c7ead86c5048381c97d01a09ac8a5a84cd93c5db..7e4f3f88cbd79a497aeaa65b5fb0997d27d4ee0f 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -3481,6 +3481,20 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3510,6 +3510,20 @@ public abstract class LivingEntity extends Entity implements Attackable { this.pushEntities(); this.level().getProfiler().pop(); diff --git a/patches/server/0492-Allow-adding-items-to-BlockDropItemEvent.patch b/patches/server/0492-Allow-adding-items-to-BlockDropItemEvent.patch index 0808b4dbcd..808e585500 100644 --- a/patches/server/0492-Allow-adding-items-to-BlockDropItemEvent.patch +++ b/patches/server/0492-Allow-adding-items-to-BlockDropItemEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Allow adding items to BlockDropItemEvent diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 7310d8011fc27b17360887c048cb6eb79e2c0b1f..edb5d93684d959dbad0115643b3c9f5096ceee3a 100644 +index 87c90c401c965ac65fcbe88bf2e1ef85bfd46755..aa03917f96ed17fad53e07fa58225174846333fd 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -452,13 +452,30 @@ public class CraftEventFactory { +@@ -453,13 +453,30 @@ public class CraftEventFactory { } public static void handleBlockDropItemEvent(Block block, BlockState state, ServerPlayer player, List<ItemEntity> items) { diff --git a/patches/server/0505-Expand-world-key-API.patch b/patches/server/0505-Expand-world-key-API.patch index dab6d8f7be..17d7ac06c4 100644 --- a/patches/server/0505-Expand-world-key-API.patch +++ b/patches/server/0505-Expand-world-key-API.patch @@ -67,10 +67,10 @@ index 24c8e9a43affa8ca99c03562aefc3d6402c23281..ec92033fef581e42fb3f36acaba62689 // Check if a World already exists with the UID. if (this.getWorld(world.getUID()) != null) { diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 50322927460ec9464363617e3f7fe5ff8faa1f6f..00e4e899cf7ee5da89a77175e417115e7ba97afd 100644 +index 7427a81a779b82f96d34a3de228c9d59ee77fea7..7e538a5e742914aa496d76ffe5b450397367cf40 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -541,6 +541,11 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -527,6 +527,11 @@ public final class CraftMagicNumbers implements UnsafeValues { public int nextEntityId() { return net.minecraft.world.entity.Entity.nextEntityId(); } diff --git a/patches/server/0510-Expose-protocol-version.patch b/patches/server/0510-Expose-protocol-version.patch index 3bdee13099..37634ea475 100644 --- a/patches/server/0510-Expose-protocol-version.patch +++ b/patches/server/0510-Expose-protocol-version.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Expose protocol version diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 00e4e899cf7ee5da89a77175e417115e7ba97afd..a71717fe99e78c480747cc61ab30b53b6667fde7 100644 +index 7e538a5e742914aa496d76ffe5b450397367cf40..86584a2308006a5b217841a97461707ce610d32f 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -546,6 +546,11 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -532,6 +532,11 @@ public final class CraftMagicNumbers implements UnsafeValues { public String getMainLevelName() { return ((net.minecraft.server.dedicated.DedicatedServer) net.minecraft.server.MinecraftServer.getServer()).getProperties().levelName; } diff --git a/patches/server/0512-Fix-PlayerItemConsumeEvent-cancelling-properly.patch b/patches/server/0512-Fix-PlayerItemConsumeEvent-cancelling-properly.patch index d9b5121ed1..8663738c4b 100644 --- a/patches/server/0512-Fix-PlayerItemConsumeEvent-cancelling-properly.patch +++ b/patches/server/0512-Fix-PlayerItemConsumeEvent-cancelling-properly.patch @@ -9,10 +9,10 @@ till their item is switched. This patch clears the active item when the event is cancelled diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 9153119e21c75b3d523e10897935d931f633f1a5..cabbe2ee01b5da681ab14cfa76063f04fba0953c 100644 +index 7e4f3f88cbd79a497aeaa65b5fb0997d27d4ee0f..d2bb6d312e67462e36cffb8de26b88e3050d0518 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -3982,6 +3982,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -4011,6 +4011,7 @@ public abstract class LivingEntity extends Entity implements Attackable { this.level().getCraftServer().getPluginManager().callEvent(event); if (event.isCancelled()) { diff --git a/patches/server/0520-Add-PlayerDeepSleepEvent.patch b/patches/server/0520-Add-PlayerDeepSleepEvent.patch index 169d874c90..c348ba15bc 100644 --- a/patches/server/0520-Add-PlayerDeepSleepEvent.patch +++ b/patches/server/0520-Add-PlayerDeepSleepEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add PlayerDeepSleepEvent diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java -index 80426e943b38e1cbde6ce80b3964df4d5ae23c94..7e54b4b521d0cfe907db5cfa26129752b3de4355 100644 +index 513e6505706e64f9410fa190014976dc469793af..b444b24a92bd2209ee4104ae82c7cfa9c876c910 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java -@@ -261,6 +261,13 @@ public abstract class Player extends LivingEntity { +@@ -262,6 +262,13 @@ public abstract class Player extends LivingEntity { if (this.isSleeping()) { ++this.sleepCounter; diff --git a/patches/server/0536-Expand-PlayerGameModeChangeEvent.patch b/patches/server/0536-Expand-PlayerGameModeChangeEvent.patch index f088e643a5..98696ab8cc 100644 --- a/patches/server/0536-Expand-PlayerGameModeChangeEvent.patch +++ b/patches/server/0536-Expand-PlayerGameModeChangeEvent.patch @@ -45,7 +45,7 @@ index 7f09119bc7d661e08a960dd2bd46006efe752d3e..d1da3600dc07107309b20ebe6e7c0c4d } diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index bd1abd4ad5dc129df4c844571c9a91e7cc1748d9..04c9fe154a72804d7bb817bf3bbfccd8be96a6ee 100644 +index 47259d580460fd00c6c7a4e798e28667f333ca9c..205d0f5bc3da737f960fb0e795b959e611e48422 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -2087,10 +2087,18 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player { @@ -78,7 +78,7 @@ index bd1abd4ad5dc129df4c844571c9a91e7cc1748d9..04c9fe154a72804d7bb817bf3bbfccd8 } } -@@ -2505,6 +2513,16 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player { +@@ -2512,6 +2520,16 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player { } public void loadGameTypes(@Nullable CompoundTag nbt) { @@ -147,10 +147,10 @@ index 699658bd80eb88907041efb01d31e4051edb91de..58e5acbd00c4f8c0fcafa4f2c21b6a9f } } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 6924bf3fad82cd055523af835a83aa0ca3490625..868c6f5ee5d67b92ad5834e05f9f1795cca879db 100644 +index b2e5bf420d0d8e3f635632d91faf15e10f1988f6..00ccb9ae0d41ba87db2617853206d714a4225563 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1653,7 +1653,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1654,7 +1654,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { Preconditions.checkArgument(mode != null, "GameMode cannot be null"); if (this.getHandle().connection == null) return; diff --git a/patches/server/0537-ItemStack-repair-check-API.patch b/patches/server/0537-ItemStack-repair-check-API.patch index b2c00e80ef..9621b72ce2 100644 --- a/patches/server/0537-ItemStack-repair-check-API.patch +++ b/patches/server/0537-ItemStack-repair-check-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] ItemStack repair check API diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index a71717fe99e78c480747cc61ab30b53b6667fde7..080ab25d3585552c1abd62a9992d48bf094fc065 100644 +index 86584a2308006a5b217841a97461707ce610d32f..86308d3633e02a85ea2727805990451af53033c8 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -551,6 +551,14 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -537,6 +537,14 @@ public final class CraftMagicNumbers implements UnsafeValues { public int getProtocolVersion() { return net.minecraft.SharedConstants.getCurrentVersion().getProtocolVersion(); } diff --git a/patches/server/0538-More-Enchantment-API.patch b/patches/server/0538-More-Enchantment-API.patch index 70558c14b9..692f90b66a 100644 --- a/patches/server/0538-More-Enchantment-API.patch +++ b/patches/server/0538-More-Enchantment-API.patch @@ -10,7 +10,7 @@ Co-authored-by: Luis <[email protected]> Co-authored-by: Janet Blackquill <[email protected]> diff --git a/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java b/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java -index 3ea6e6678432957c5caaff15ba20f8a8ddb393c9..10a74428ca8f8a869ba0d14f2a9b2126033df684 100644 +index fc6606e1bf2e2c35cb6c84af78859c3441775907..edf4df4d13dc814e98b897a3f8a5fd4757284299 100644 --- a/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java +++ b/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java @@ -5,6 +5,7 @@ import java.util.Locale; @@ -21,7 +21,7 @@ index 3ea6e6678432957c5caaff15ba20f8a8ddb393c9..10a74428ca8f8a869ba0d14f2a9b2126 import net.minecraft.tags.EnchantmentTags; import org.bukkit.NamespacedKey; import org.bukkit.Registry; -@@ -92,7 +93,7 @@ public class CraftEnchantment extends Enchantment implements Handleable<net.mine +@@ -90,7 +91,7 @@ public class CraftEnchantment extends Enchantment implements Handleable<net.mine @Override public boolean isTreasure() { @@ -30,7 +30,7 @@ index 3ea6e6678432957c5caaff15ba20f8a8ddb393c9..10a74428ca8f8a869ba0d14f2a9b2126 } @Override -@@ -169,12 +170,66 @@ public class CraftEnchantment extends Enchantment implements Handleable<net.mine +@@ -148,12 +149,66 @@ public class CraftEnchantment extends Enchantment implements Handleable<net.mine // Paper start @Override public net.kyori.adventure.text.Component displayName(int level) { diff --git a/patches/server/0544-Improve-item-default-attribute-API.patch b/patches/server/0544-Improve-item-default-attribute-API.patch index 76145fcd23..5a9d7ca280 100644 --- a/patches/server/0544-Improve-item-default-attribute-API.patch +++ b/patches/server/0544-Improve-item-default-attribute-API.patch @@ -3,8 +3,6 @@ From: Jake Potrebic <[email protected]> Date: Sat, 8 May 2021 15:01:54 -0700 Subject: [PATCH] Improve item default attribute API -Also fixes an issue where upstream isn't -actually getting the correct default attributes diff --git a/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttributeInstance.java b/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttributeInstance.java index de0eba19c0c963adb4f17cea22333240021fd801..3b171a08bd0bedfe224905feb5838d2540199bce 100644 @@ -21,10 +19,10 @@ index de0eba19c0c963adb4f17cea22333240021fd801..3b171a08bd0bedfe224905feb5838d25 } } diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemType.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemType.java -index 3ad2d93fa4b5174531349e9dfce4f48944ee8cc5..431910368e6d5487456e8430ad7b027d19429b58 100644 +index 66d773cadb74f9176e6cf68a565568034f52ec63..a1f2b9d40d374e8cdbaf916b25fa74b6c0970f81 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemType.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemType.java -@@ -197,15 +197,34 @@ public class CraftItemType<M extends ItemMeta> implements ItemType.Typed<M>, Han +@@ -197,19 +197,36 @@ public class CraftItemType<M extends ItemMeta> implements ItemType.Typed<M>, Han // return CraftEquipmentSlot.getSlot(EntityInsentient.getEquipmentSlotForItem(CraftItemStack.asNMSCopy(ItemStack.of(this)))); // } @@ -37,24 +35,25 @@ index 3ad2d93fa4b5174531349e9dfce4f48944ee8cc5..431910368e6d5487456e8430ad7b027d + @Override public Multimap<Attribute, AttributeModifier> getDefaultAttributeModifiers(EquipmentSlot slot) { -- ImmutableMultimap.Builder<Attribute, AttributeModifier> defaultAttributes = ImmutableMultimap.builder(); + // Paper start - improve/fix item default attribute API + final net.minecraft.world.entity.EquipmentSlot nmsSlot = CraftEquipmentSlot.getNMS(slot); + return this.getDefaultAttributeModifiers(sg -> sg.test(nmsSlot)); + } ++ ++ private Multimap<Attribute, AttributeModifier> getDefaultAttributeModifiers(final java.util.function.Predicate<net.minecraft.world.entity.EquipmentSlotGroup> slotPredicate) { ++ // Paper end - improve/fix item default attribute API + ImmutableMultimap.Builder<Attribute, AttributeModifier> defaultAttributes = ImmutableMultimap.builder(); -- ItemAttributeModifiers nmsDefaultAttributes = this.item.getDefaultAttributeModifiers(); + ItemAttributeModifiers nmsDefaultAttributes = this.item.components().getOrDefault(DataComponents.ATTRIBUTE_MODIFIERS, ItemAttributeModifiers.EMPTY); + if (nmsDefaultAttributes.modifiers().isEmpty()) { + nmsDefaultAttributes = this.item.getDefaultAttributeModifiers(); + } +- - nmsDefaultAttributes.forEach(CraftEquipmentSlot.getNMS(slot), (key, value) -> { - Attribute attribute = CraftAttribute.minecraftToBukkit(key.value()); - defaultAttributes.put(attribute, CraftAttributeInstance.convert(value, slot)); - }); -+ private Multimap<Attribute, AttributeModifier> getDefaultAttributeModifiers(final java.util.function.Predicate<net.minecraft.world.entity.EquipmentSlotGroup> slotPredicate) { -+ final ImmutableMultimap.Builder<Attribute, AttributeModifier> defaultAttributes = ImmutableMultimap.builder(); -+ ItemAttributeModifiers nmsDefaultAttributes = this.item.components().getOrDefault(DataComponents.ATTRIBUTE_MODIFIERS, ItemAttributeModifiers.EMPTY); -+ if (nmsDefaultAttributes.modifiers().isEmpty()) { -+ // we have to check both places cause for some reason vanilla puts default modifiers for armor in a different place -+ nmsDefaultAttributes = this.item.getDefaultAttributeModifiers(); -+ } ++ // Paper start - improve/fix item default attribute API + for (final net.minecraft.world.item.component.ItemAttributeModifiers.Entry entry : nmsDefaultAttributes.modifiers()) { + if (!slotPredicate.test(entry.slot())) continue; + final Attribute attribute = CraftAttribute.minecraftHolderToBukkit(entry.attribute()); @@ -66,22 +65,14 @@ index 3ad2d93fa4b5174531349e9dfce4f48944ee8cc5..431910368e6d5487456e8430ad7b027d return defaultAttributes.build(); } diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 080ab25d3585552c1abd62a9992d48bf094fc065..a867c9de9c2c1798d8e9014f5114b0f4e32b3261 100644 +index 86308d3633e02a85ea2727805990451af53033c8..53cb6d7c2a734e46322b746f00c2bd0f09488126 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -400,15 +400,11 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -396,7 +396,11 @@ public final class CraftMagicNumbers implements UnsafeValues { @Override public Multimap<Attribute, AttributeModifier> getDefaultAttributeModifiers(Material material, EquipmentSlot slot) { -- ImmutableMultimap.Builder<Attribute, AttributeModifier> defaultAttributes = ImmutableMultimap.builder(); -- -- ItemAttributeModifiers nmsDefaultAttributes = CraftMagicNumbers.getItem(material).getDefaultAttributeModifiers(); -- nmsDefaultAttributes.forEach(CraftEquipmentSlot.getNMS(slot), (key, value) -> { -- Attribute attribute = CraftAttribute.minecraftToBukkit(key.value()); -- defaultAttributes.put(attribute, CraftAttributeInstance.convert(value, slot)); -- }); -- -- return defaultAttributes.build(); +- return material.getDefaultAttributeModifiers(slot); + // Paper start - delegate to method on ItemType + final org.bukkit.inventory.ItemType item = material.asItemType(); + Preconditions.checkArgument(item != null, material + " is not an item and does not have default attributes"); diff --git a/patches/server/0548-Add-PlayerKickEvent-causes.patch b/patches/server/0548-Add-PlayerKickEvent-causes.patch index 050372991d..5cb94d101b 100644 --- a/patches/server/0548-Add-PlayerKickEvent-causes.patch +++ b/patches/server/0548-Add-PlayerKickEvent-causes.patch @@ -480,15 +480,15 @@ 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 868c6f5ee5d67b92ad5834e05f9f1795cca879db..c8a4677db69b0f4111d550ca457b9196e7acebdd 100644 +index 00ccb9ae0d41ba87db2617853206d714a4225563..ddd5bdf07f92f18ad27b34ce63a98a61f8263733 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -635,7 +635,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { org.spigotmc.AsyncCatcher.catchOp("player kick"); // Spigot if (this.getHandle().connection == null) return; -- this.getHandle().connection.disconnect(CraftChatMessage.fromStringOrEmpty(message)); -+ this.getHandle().connection.disconnect(CraftChatMessage.fromStringOrEmpty(message), org.bukkit.event.player.PlayerKickEvent.Cause.PLUGIN); // Paper - kick event cause +- this.getHandle().connection.disconnect(CraftChatMessage.fromStringOrEmpty(message, true)); ++ this.getHandle().connection.disconnect(CraftChatMessage.fromStringOrEmpty(message, true), org.bukkit.event.player.PlayerKickEvent.Cause.PLUGIN); // Paper - kick event cause } // Paper start @@ -519,15 +519,15 @@ index 868c6f5ee5d67b92ad5834e05f9f1795cca879db..c8a4677db69b0f4111d550ca457b9196 if (msg.startsWith("/")) { this.getHandle().connection.handleCommand(msg); diff --git a/src/main/java/org/spigotmc/RestartCommand.java b/src/main/java/org/spigotmc/RestartCommand.java -index 9a1fffa0c07c24eed8bd6ea8f3cd26c9f926c54d..f3fa0340babfc5eb627066115164e2d885c602c2 100644 +index 824c4ad135ea5177f416687c7042639ed126b70b..39e56b95aaafbcd8ebe68fdefaace83702e9510d 100644 --- a/src/main/java/org/spigotmc/RestartCommand.java +++ b/src/main/java/org/spigotmc/RestartCommand.java @@ -74,7 +74,7 @@ public class RestartCommand extends Command // Kick all players for ( ServerPlayer p : com.google.common.collect.ImmutableList.copyOf( MinecraftServer.getServer().getPlayerList().players ) ) { -- p.connection.disconnect( CraftChatMessage.fromStringOrEmpty( SpigotConfig.restartMessage ) ); -+ p.connection.disconnect( CraftChatMessage.fromStringOrEmpty( SpigotConfig.restartMessage ), org.bukkit.event.player.PlayerKickEvent.Cause.RESTART_COMMAND); // Paper - kick event reason (cause is never used)) +- p.connection.disconnect( CraftChatMessage.fromStringOrEmpty( SpigotConfig.restartMessage, true ) ); ++ p.connection.disconnect( CraftChatMessage.fromStringOrEmpty( SpigotConfig.restartMessage, true ), org.bukkit.event.player.PlayerKickEvent.Cause.RESTART_COMMAND); // Paper - kick event reason (cause is never used)) } // Give the socket a chance to send the packets try diff --git a/patches/server/0557-Line-Of-Sight-Changes.patch b/patches/server/0557-Line-Of-Sight-Changes.patch index 6f42029c68..1e1018607b 100644 --- a/patches/server/0557-Line-Of-Sight-Changes.patch +++ b/patches/server/0557-Line-Of-Sight-Changes.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Line Of Sight Changes diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index cabbe2ee01b5da681ab14cfa76063f04fba0953c..ca2d7db39d4f4ef485e1e4a49f2fe6b1c310baf7 100644 +index d2bb6d312e67462e36cffb8de26b88e3050d0518..85f3dcdc8349683cb79ce1d9fe56eff02af2a7a7 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -3726,7 +3726,8 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3755,7 +3755,8 @@ public abstract class LivingEntity extends Entity implements Attackable { Vec3 vec3d = new Vec3(this.getX(), this.getEyeY(), this.getZ()); Vec3 vec3d1 = new Vec3(entity.getX(), entity.getEyeY(), entity.getZ()); diff --git a/patches/server/0559-Fix-potions-splash-events.patch b/patches/server/0559-Fix-potions-splash-events.patch index dc4c8cf698..8d894f25e2 100644 --- a/patches/server/0559-Fix-potions-splash-events.patch +++ b/patches/server/0559-Fix-potions-splash-events.patch @@ -143,10 +143,10 @@ index be787a5b52e90796d4f06e17e564f4324807c3e6..cb34cc9443da56c0497c7a0192c8b836 public boolean isLingering() { diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index edb5d93684d959dbad0115643b3c9f5096ceee3a..18b2a6db3adee2ac2630d500005e0a4034cfbad7 100644 +index aa03917f96ed17fad53e07fa58225174846333fd..b53b457b55d22eae7114cafc85e63e9aa5b0b4b2 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -876,6 +876,32 @@ public class CraftEventFactory { +@@ -877,6 +877,32 @@ public class CraftEventFactory { return event; } diff --git a/patches/server/0561-Fix-PlayerDropItemEvent-using-wrong-item.patch b/patches/server/0561-Fix-PlayerDropItemEvent-using-wrong-item.patch index 832b9e4954..3bb995b5ce 100644 --- a/patches/server/0561-Fix-PlayerDropItemEvent-using-wrong-item.patch +++ b/patches/server/0561-Fix-PlayerDropItemEvent-using-wrong-item.patch @@ -31,23 +31,23 @@ index c81fd3e1108fb0a02f9240263404af2b968c8494..0d9de4c61c7b26a6ff37c12fde629161 } diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 04c9fe154a72804d7bb817bf3bbfccd8be96a6ee..d413c4d445f42f6a923a49ce4f04b13c3ee28f7a 100644 +index 205d0f5bc3da737f960fb0e795b959e611e48422..07ddd327c625d58137f0368be36fb708ac64ff4c 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -2482,7 +2482,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player { +@@ -2489,7 +2489,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player { - if (retainOwnership) { + if (flag1) { if (!itemstack1.isEmpty()) { -- this.awardStat(Stats.ITEM_DROPPED.get(itemstack1.getItem()), stack.getCount()); +- this.awardStat(Stats.ITEM_DROPPED.get(itemstack1.getItem()), itemstack.getCount()); + this.awardStat(Stats.ITEM_DROPPED.get(itemstack1.getItem()), itemstack1.getCount()); // Paper - Fix PlayerDropItemEvent using wrong item } this.awardStat(Stats.DROP); diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java -index 7e54b4b521d0cfe907db5cfa26129752b3de4355..c817d7cfa9bdef98aef6ac2df304ac5c2aa80649 100644 +index b444b24a92bd2209ee4104ae82c7cfa9c876c910..7fee6ffeb8ccde965fcc1454eb0d8c6b3637da41 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java -@@ -744,6 +744,11 @@ public abstract class Player extends LivingEntity { +@@ -745,6 +745,11 @@ public abstract class Player extends LivingEntity { } double d0 = this.getEyeY() - 0.30000001192092896D; diff --git a/patches/server/0570-Add-missing-forceDrop-toggles.patch b/patches/server/0570-Add-missing-forceDrop-toggles.patch index d7c261ea7c..e11380293a 100644 --- a/patches/server/0570-Add-missing-forceDrop-toggles.patch +++ b/patches/server/0570-Add-missing-forceDrop-toggles.patch @@ -56,20 +56,6 @@ index 8df42121aa22ec9f95a1b8627b64b0ff71e36314..7b3d5322611990406028e59b14099072 Panda.this.setItemSlot(EquipmentSlot.MAINHAND, ItemStack.EMPTY); int i = Panda.this.isLazy() ? Panda.this.random.nextInt(50) + 10 : Panda.this.random.nextInt(150) + 10; -diff --git a/src/main/java/net/minecraft/world/entity/animal/Wolf.java b/src/main/java/net/minecraft/world/entity/animal/Wolf.java -index faff64ae69eb689cea7754f221f374f8faa6e541..26b050599984ae3ba3827a0cabab255374e38c1e 100644 ---- a/src/main/java/net/minecraft/world/entity/animal/Wolf.java -+++ b/src/main/java/net/minecraft/world/entity/animal/Wolf.java -@@ -472,7 +472,9 @@ public class Wolf extends TamableAnimal implements NeutralMob, VariantHolder<Hol - this.playSound(SoundEvents.ARMOR_UNEQUIP_WOLF); - itemstack1 = this.getBodyArmorItem(); - this.setBodyArmorItem(ItemStack.EMPTY); -+ this.forceDrops = true; // Paper - add missing forceDrops toggles - this.spawnAtLocation(itemstack1); -+ this.forceDrops = false; // Paper - add missing forceDrops toggles - return InteractionResult.SUCCESS; - } else if (((Ingredient) ((ArmorMaterial) ArmorMaterials.ARMADILLO.value()).repairIngredient().get()).test(itemstack) && this.isInSittingPose() && this.hasArmor() && this.isOwnedBy(player) && this.getBodyArmorItem().isDamaged()) { - itemstack.shrink(1); diff --git a/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java b/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java index 691d23bcd3e34a89e14c2e124595e076325dedbc..d2dfa49e124460f4762b950f9ded106d2ec15dc2 100644 --- a/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java diff --git a/patches/server/0575-Add-PlayerSetSpawnEvent.patch b/patches/server/0575-Add-PlayerSetSpawnEvent.patch index b54fcfb9d0..cc76cab591 100644 --- a/patches/server/0575-Add-PlayerSetSpawnEvent.patch +++ b/patches/server/0575-Add-PlayerSetSpawnEvent.patch @@ -49,7 +49,7 @@ index a2d0699e8427b2262a2396495111125eccafbb66..15db9368227dbc29d07d74e85bd126b3 } } diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 967a61aa38f5361e5fceb8b7761664cb36cf568e..ce894b31e391786fe98742b9bf22d653df018570 100644 +index 2e9cf68e7e58cffa296bb60ddb97639662b2ab5c..fdf73f71ca34099081f9f80994bbe411052c0149 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -1425,7 +1425,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player { @@ -187,10 +187,10 @@ index ba22ad1e4253477572d10d71db6db0ebc14d6755..94d067e9eeee73183de25165d8c97043 } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index c8a4677db69b0f4111d550ca457b9196e7acebdd..d22990a2e7a1fcaf6e1f2d2f4856bd9b4b25aadb 100644 +index ddd5bdf07f92f18ad27b34ce63a98a61f8263733..d58e7197da3c4b35b28c2f427e9539c3f1df13b8 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1412,9 +1412,9 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1413,9 +1413,9 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public void setRespawnLocation(Location location, boolean override) { if (location == null) { diff --git a/patches/server/0576-Make-hoppers-respect-inventory-max-stack-size.patch b/patches/server/0576-Make-hoppers-respect-inventory-max-stack-size.patch index c5f669b979..a062b815e2 100644 --- a/patches/server/0576-Make-hoppers-respect-inventory-max-stack-size.patch +++ b/patches/server/0576-Make-hoppers-respect-inventory-max-stack-size.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Make hoppers respect inventory max stack size diff --git a/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java -index dfb57192105d5e05e4c2e32da5eadb7c701a763a..92086ca118d55ec49cefa5bf18977f8706e3e4b4 100644 +index 6d948b6151c6194bdba1cd461960397615c4bc40..0d6132abd49d66fbf84c046e09144cb33651be15 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java -@@ -485,15 +485,17 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen +@@ -487,15 +487,17 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen if (itemstack1.isEmpty()) { // Spigot start - SPIGOT-6693, InventorySubcontainer#setItem diff --git a/patches/server/0589-Get-entity-default-attributes.patch b/patches/server/0589-Get-entity-default-attributes.patch index 6f99af1f3a..89cfa6b22f 100644 --- a/patches/server/0589-Get-entity-default-attributes.patch +++ b/patches/server/0589-Get-entity-default-attributes.patch @@ -81,10 +81,10 @@ index 0000000000000000000000000000000000000000..ec9ebd2d539333293c51b7edfa18f18b + } +} diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index a867c9de9c2c1798d8e9014f5114b0f4e32b3261..cfd003e975573564a3fea9d4379842979711e841 100644 +index 53cb6d7c2a734e46322b746f00c2bd0f09488126..1e78b966da6a3fa9410ebe52ae94db9b87659c72 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -555,6 +555,18 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -549,6 +549,18 @@ public final class CraftMagicNumbers implements UnsafeValues { } return CraftMagicNumbers.getItem(itemToBeRepaired.getType()).isValidRepairItem(CraftItemStack.asNMSCopy(itemToBeRepaired), CraftItemStack.asNMSCopy(repairMaterial)); } diff --git a/patches/server/0591-Add-more-advancement-API.patch b/patches/server/0591-Add-more-advancement-API.patch index 970ef0c936..bd3ae33fff 100644 --- a/patches/server/0591-Add-more-advancement-API.patch +++ b/patches/server/0591-Add-more-advancement-API.patch @@ -164,10 +164,10 @@ index 8ca86852319d7463f60832bc98b825b0b4325995..62ada73302c6b3ce3fb2dcc8c31a1d9c private final DisplayInfo handle; diff --git a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java -index 93c0390aade242bc24f8d9a9ac99242d0f588d5e..164f736479facbab370a7b11ffa4f0fca767c448 100644 +index a2b1197a26eed4df77d7f770e016f522832d8aa2..d125f79d1416ecf58d4b2ec131c43f1007977c0c 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java +++ b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java -@@ -399,6 +399,11 @@ public class Commodore { +@@ -409,6 +409,11 @@ public class Commodore { super.visitMethodInsn(opcode, owner, name, "()Lcom/destroystokyo/paper/profile/PlayerProfile;", itf); return; } diff --git a/patches/server/0592-Add-ItemFactory-getSpawnEgg-API.patch b/patches/server/0592-Add-ItemFactory-getSpawnEgg-API.patch index 28bf327957..ee1d80dabb 100644 --- a/patches/server/0592-Add-ItemFactory-getSpawnEgg-API.patch +++ b/patches/server/0592-Add-ItemFactory-getSpawnEgg-API.patch @@ -37,10 +37,10 @@ index eabb8b42b890224dd19b879ff276e9908674310d..803a19063c03627dbea79cb1c395ae35 + // Paper end - old getSpawnEgg API } diff --git a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java -index 164f736479facbab370a7b11ffa4f0fca767c448..935c97af6fedde505c79956b24069770742a61cf 100644 +index d125f79d1416ecf58d4b2ec131c43f1007977c0c..1e050ef29593233694e0044bedf4c417d876f362 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java +++ b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java -@@ -406,6 +406,15 @@ public class Commodore { +@@ -416,6 +416,15 @@ public class Commodore { } // Paper end diff --git a/patches/server/0593-Add-critical-damage-API.patch b/patches/server/0593-Add-critical-damage-API.patch index 47b65264af..b3f7792da1 100644 --- a/patches/server/0593-Add-critical-damage-API.patch +++ b/patches/server/0593-Add-critical-damage-API.patch @@ -28,10 +28,10 @@ index c1d121d83591ca1b5bf9d9406c9622b4f24eafef..aee26dd78953ff43306aaa64161f5b9e + // Paper end - add critical damage API } diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java -index c817d7cfa9bdef98aef6ac2df304ac5c2aa80649..6a0c177859da18d8b1ccaa45eab477d2f5822888 100644 +index 7fee6ffeb8ccde965fcc1454eb0d8c6b3637da41..e772b6a501b225f13399365ad743cabe5f6f792e 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java -@@ -1292,6 +1292,7 @@ public abstract class Player extends LivingEntity { +@@ -1293,6 +1293,7 @@ public abstract class Player extends LivingEntity { flag2 = flag2 && !this.level().paperConfig().entities.behavior.disablePlayerCrits; // Paper - Toggleable player crits if (flag2) { @@ -39,13 +39,13 @@ index c817d7cfa9bdef98aef6ac2df304ac5c2aa80649..6a0c177859da18d8b1ccaa45eab477d2 f *= 1.5F; } -@@ -1351,7 +1352,7 @@ public abstract class Player extends LivingEntity { +@@ -1352,7 +1353,7 @@ public abstract class Player extends LivingEntity { float f7 = this.getEnchantedDamage(entityliving2, f6, damagesource) * f2; // CraftBukkit start - Only apply knockback if the damage hits -- if (entityliving2.hurt(this.damageSources().playerAttack(this).sweep(), f7)) { -+ if (entityliving2.hurt(this.damageSources().playerAttack(this).sweep().critical(flag2), f7)) { // Paper - add critical damage API - entityliving2.knockback(0.4000000059604645D, (double) Mth.sin(this.getYRot() * 0.017453292F), (double) (-Mth.cos(this.getYRot() * 0.017453292F)), this, io.papermc.paper.event.entity.EntityKnockbackEvent.Cause.SWEEP_ATTACK); // CraftBukkit // Paper - knockback events +- if (!entityliving2.hurt(this.damageSources().playerAttack(this).sweep(), f7)) { ++ if (!entityliving2.hurt(this.damageSources().playerAttack(this).sweep().critical(flag2), f7)) { // Paper - add critical damage API + continue; } // CraftBukkit end diff --git a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java @@ -61,7 +61,7 @@ index 746bb8a36bd6c6ef953289576af499caad588d79..57ebb96707748e90810dc07471f9769f int k = entity.getRemainingFireTicks(); diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 18b2a6db3adee2ac2630d500005e0a4034cfbad7..76e262cc2d6686096eb7b58b6e7343c2a0ecafe5 100644 +index b53b457b55d22eae7114cafc85e63e9aa5b0b4b2..ebe547736862b38dd11727124cdd70c7abe7d791 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -1065,7 +1065,7 @@ public class CraftEventFactory { diff --git a/patches/server/0598-Add-Raw-Byte-Entity-Serialization.patch b/patches/server/0598-Add-Raw-Byte-Entity-Serialization.patch index 4007a777a5..8f31d07f88 100644 --- a/patches/server/0598-Add-Raw-Byte-Entity-Serialization.patch +++ b/patches/server/0598-Add-Raw-Byte-Entity-Serialization.patch @@ -50,10 +50,10 @@ index 7310f53747e68b918f132ee0f0a142e36537902e..6f9286e65f7ac730b808ddf9b52c344f @Override public boolean isInvisible() { // Paper - moved up from LivingEntity diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index cfd003e975573564a3fea9d4379842979711e841..1a46245fed7a5fca532df7e3febb22f5effca764 100644 +index 1e78b966da6a3fa9410ebe52ae94db9b87659c72..21461817aa27b5b7df8af186712a54b3c80ee576 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -505,7 +505,33 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -499,7 +499,33 @@ public final class CraftMagicNumbers implements UnsafeValues { return CraftItemStack.asCraftMirror(net.minecraft.world.item.ItemStack.parse(MinecraftServer.getServer().registryAccess(), compound).orElseThrow()); } diff --git a/patches/server/0600-Do-not-run-close-logic-for-inventories-on-chunk-unlo.patch b/patches/server/0600-Do-not-run-close-logic-for-inventories-on-chunk-unlo.patch index dd5139ae7a..e615b2ea62 100644 --- a/patches/server/0600-Do-not-run-close-logic-for-inventories-on-chunk-unlo.patch +++ b/patches/server/0600-Do-not-run-close-logic-for-inventories-on-chunk-unlo.patch @@ -28,7 +28,7 @@ index efc27bb4072172f10839c181de9b5fba1f488b6f..4c739717fcf53b28312e8a98f9bf0989 } // Spigot End diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index ce894b31e391786fe98742b9bf22d653df018570..ecd43bbca7ea0e74f506f49fd14f2dd5d467efa1 100644 +index fdf73f71ca34099081f9f80994bbe411052c0149..d868d0776a8ca26deefe2e6b77838c2b502fff57 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -1718,6 +1718,18 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player { @@ -51,10 +51,10 @@ index ce894b31e391786fe98742b9bf22d653df018570..ecd43bbca7ea0e74f506f49fd14f2dd5 @Override public void doCloseContainer() { diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java -index 6a0c177859da18d8b1ccaa45eab477d2f5822888..028dc5eda7bb93bb4714f6b223379803307add93 100644 +index e772b6a501b225f13399365ad743cabe5f6f792e..fab56040ecf496e74f583ec5d6c6c9861cfa4e13 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java -@@ -509,6 +509,11 @@ public abstract class Player extends LivingEntity { +@@ -510,6 +510,11 @@ public abstract class Player extends LivingEntity { this.containerMenu = this.inventoryMenu; } // Paper end - Inventory close reason diff --git a/patches/server/0602-Improve-and-expand-AsyncCatcher.patch b/patches/server/0602-Improve-and-expand-AsyncCatcher.patch index f1b002b22c..a228047ccb 100644 --- a/patches/server/0602-Improve-and-expand-AsyncCatcher.patch +++ b/patches/server/0602-Improve-and-expand-AsyncCatcher.patch @@ -29,10 +29,10 @@ index 93a9ef3fc5620c622ce0dfb010c6dafad8fcdb71..987ad7f7130c45a4b3843e186b6a5662 if (player.isRemoved()) { LOGGER.info("Attempt to teleport removed player {} restricted", player.getScoreboardName()); diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index ca2d7db39d4f4ef485e1e4a49f2fe6b1c310baf7..94e26d8ba0eb32e241ae4018eee767120192a80d 100644 +index 85f3dcdc8349683cb79ce1d9fe56eff02af2a7a7..4714931fd5218df160e39f013278b7996cc5eca6 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -1121,7 +1121,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -1122,7 +1122,7 @@ public abstract class LivingEntity extends Entity implements Attackable { } public boolean addEffect(MobEffectInstance mobeffect, @Nullable Entity entity, EntityPotionEffectEvent.Cause cause) { diff --git a/patches/server/0632-Prevent-excessive-velocity-through-repeated-crits.patch b/patches/server/0632-Prevent-excessive-velocity-through-repeated-crits.patch index d6ec443589..b9094798f2 100644 --- a/patches/server/0632-Prevent-excessive-velocity-through-repeated-crits.patch +++ b/patches/server/0632-Prevent-excessive-velocity-through-repeated-crits.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Prevent excessive velocity through repeated crits diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 94e26d8ba0eb32e241ae4018eee767120192a80d..0ede1e49dc05596b8a2551dbed26f363105b3fe3 100644 +index 4714931fd5218df160e39f013278b7996cc5eca6..45493e09843e5a3c4511f7f1b36cfec9468a0391 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -2744,17 +2744,29 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -2773,17 +2773,29 @@ public abstract class LivingEntity extends Entity implements Attackable { return this.hasEffect(MobEffects.JUMP) ? 0.1F * ((float) this.getEffect(MobEffects.JUMP).getAmplifier() + 1.0F) : 0.0F; } diff --git a/patches/server/0660-Freeze-Tick-Lock-API.patch b/patches/server/0660-Freeze-Tick-Lock-API.patch index 96305af936..d00c82feec 100644 --- a/patches/server/0660-Freeze-Tick-Lock-API.patch +++ b/patches/server/0660-Freeze-Tick-Lock-API.patch @@ -46,10 +46,10 @@ index 6d011de57725aec5ffffc35b3b94ec1b7c178861..c16f179e4cb45f5a312255692cf86068 } catch (Throwable throwable) { diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 0ede1e49dc05596b8a2551dbed26f363105b3fe3..dfe58b1e3bab7ec8e8b12dba8d613a842f462cbb 100644 +index 45493e09843e5a3c4511f7f1b36cfec9468a0391..a02df3b6fd908b16dbe5a3be77174bfb82a5f35f 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -3468,7 +3468,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3497,7 +3497,7 @@ public abstract class LivingEntity extends Entity implements Attackable { this.level().getProfiler().pop(); this.level().getProfiler().push("freezing"); diff --git a/patches/server/0679-More-Projectile-API.patch b/patches/server/0679-More-Projectile-API.patch index ec6c7f9e77..ac564ab406 100644 --- a/patches/server/0679-More-Projectile-API.patch +++ b/patches/server/0679-More-Projectile-API.patch @@ -713,10 +713,10 @@ index e374b9f40eddca13b30855d25a2030f8df98138f..4fc893378fb0568ddcffc7593d66df6b // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 76e262cc2d6686096eb7b58b6e7343c2a0ecafe5..f47c881aada65e91a6a433b0d2df031f8f01c6b8 100644 +index ebe547736862b38dd11727124cdd70c7abe7d791..6bed9cce39eacf0f42ee4c6b007d2bdeb632b68f 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -833,19 +833,19 @@ public class CraftEventFactory { +@@ -834,19 +834,19 @@ public class CraftEventFactory { /** * PotionSplashEvent */ @@ -739,7 +739,7 @@ index 76e262cc2d6686096eb7b58b6e7343c2a0ecafe5..f47c881aada65e91a6a433b0d2df031f hitEntity = ((EntityHitResult) position).getEntity().getBukkitEntity(); } -@@ -854,20 +854,20 @@ public class CraftEventFactory { +@@ -855,20 +855,20 @@ public class CraftEventFactory { return event; } diff --git a/patches/server/0688-Fix-new-block-data-for-EntityChangeBlockEvent.patch b/patches/server/0688-Fix-new-block-data-for-EntityChangeBlockEvent.patch index 924b330ad8..1602195aee 100644 --- a/patches/server/0688-Fix-new-block-data-for-EntityChangeBlockEvent.patch +++ b/patches/server/0688-Fix-new-block-data-for-EntityChangeBlockEvent.patch @@ -196,10 +196,10 @@ index edc20745649b0837f1371c8d29e71fc0c8e5528f..932831bb5632ead5850842fc77192c84 } // CraftBukkit end diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index f47c881aada65e91a6a433b0d2df031f8f01c6b8..15afaf9b2fcff25288eb5739c9cc72fb301b875a 100644 +index 6bed9cce39eacf0f42ee4c6b007d2bdeb632b68f..4d5507e44d755588f18d992eb5f382f5f4fac273 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -1361,11 +1361,11 @@ public class CraftEventFactory { +@@ -1365,11 +1365,11 @@ public class CraftEventFactory { return event; } diff --git a/patches/server/0689-fix-player-loottables-running-when-mob-loot-gamerule.patch b/patches/server/0689-fix-player-loottables-running-when-mob-loot-gamerule.patch index a4490f06fd..11ef07e7f6 100644 --- a/patches/server/0689-fix-player-loottables-running-when-mob-loot-gamerule.patch +++ b/patches/server/0689-fix-player-loottables-running-when-mob-loot-gamerule.patch @@ -5,7 +5,7 @@ Subject: [PATCH] fix player loottables running when mob loot gamerule is false diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index a9a0e6c495c696a40bdc8147e9a2856500e422e5..af19742353008b42f5e12ed4e9351e3a3697c925 100644 +index 2a0a182191436cce8889aaa22821d770717ba8a8..8bf10e87954a42694894d107ed5fb13bc9106528 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -961,12 +961,14 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player { @@ -15,9 +15,9 @@ index a9a0e6c495c696a40bdc8147e9a2856500e422e5..af19742353008b42f5e12ed4e9351e3a + if (this.shouldDropLoot() && this.level().getGameRules().getBoolean(GameRules.RULE_DOMOBLOOT)) { // Paper - fix player loottables running when mob loot gamerule is false // SPIGOT-5071: manually add player loot tables (SPIGOT-5195 - ignores keepInventory rule) this.dropFromLootTable(damageSource, this.lastHurtByPlayerTime > 0); - for (org.bukkit.inventory.ItemStack item : this.drops) { - loot.add(item); - } + this.dropCustomDeathLoot(this.serverLevel(), damageSource, flag); + + loot.addAll(this.drops); this.drops.clear(); // SPIGOT-5188: make sure to clear + } // Paper - fix player loottables running when mob loot gamerule is false diff --git a/patches/server/0700-Add-EntityDyeEvent-and-CollarColorable-interface.patch b/patches/server/0700-Add-EntityDyeEvent-and-CollarColorable-interface.patch index 16f87ae350..0c6a5c56da 100644 --- a/patches/server/0700-Add-EntityDyeEvent-and-CollarColorable-interface.patch +++ b/patches/server/0700-Add-EntityDyeEvent-and-CollarColorable-interface.patch @@ -23,10 +23,10 @@ index d44807c16712afd37efdbf434d1afb12a7c3d343..2ed442c8d36f285420cf84a956e90b60 this.setCollarColor(enumcolor); itemstack.consume(1, player); diff --git a/src/main/java/net/minecraft/world/entity/animal/Wolf.java b/src/main/java/net/minecraft/world/entity/animal/Wolf.java -index 26b050599984ae3ba3827a0cabab255374e38c1e..c382a8f95f612db881b9cdbd07316d1ca1cd9c4b 100644 +index 22e37ac785340e2521f69a144a761732ce0a1a3f..31d7beca9797ab1a26792c3e30171a751c3846b1 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Wolf.java +++ b/src/main/java/net/minecraft/world/entity/animal/Wolf.java -@@ -451,6 +451,14 @@ public class Wolf extends TamableAnimal implements NeutralMob, VariantHolder<Hol +@@ -452,6 +452,14 @@ public class Wolf extends TamableAnimal implements NeutralMob, VariantHolder<Hol DyeColor enumcolor = itemdye.getDyeColor(); if (enumcolor != this.getCollarColor()) { diff --git a/patches/server/0703-Add-PlayerStopUsingItemEvent.patch b/patches/server/0703-Add-PlayerStopUsingItemEvent.patch index a2453612cc..735b98addf 100644 --- a/patches/server/0703-Add-PlayerStopUsingItemEvent.patch +++ b/patches/server/0703-Add-PlayerStopUsingItemEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add PlayerStopUsingItemEvent diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index dfe58b1e3bab7ec8e8b12dba8d613a842f462cbb..8e11b085d2159b1df8bbe536beb66d9bed915373 100644 +index a02df3b6fd908b16dbe5a3be77174bfb82a5f35f..fa9512da351ef92a8606b3e68ee060dac4c63346 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -4044,6 +4044,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -4073,6 +4073,7 @@ public abstract class LivingEntity extends Entity implements Attackable { public void releaseUsingItem() { if (!this.useItem.isEmpty()) { diff --git a/patches/server/0717-Nameable-Banner-API.patch b/patches/server/0717-Nameable-Banner-API.patch index 21ca7151b4..da3d804d8f 100644 --- a/patches/server/0717-Nameable-Banner-API.patch +++ b/patches/server/0717-Nameable-Banner-API.patch @@ -18,10 +18,10 @@ index 925608bfa9c848ed6285de5e35d60aa66e12004a..60c26076e7acf869fa0e20fdc14eeec3 private BannerPatternLayers patterns; diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBanner.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBanner.java -index 26ae3fe910964193c7fb22b8b644d5c0476f8d3d..65a9213ce8197d50a58f94edfd60c25c2be848be 100644 +index 5635230fc288fe5280bf785b42c862b8f111afb0..afed8bdb9bd6a135e9b5f7bd9bfc61964cb240f7 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBanner.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBanner.java -@@ -110,4 +110,26 @@ public class CraftBanner extends CraftBlockEntityState<BannerBlockEntity> implem +@@ -112,4 +112,26 @@ public class CraftBanner extends CraftBlockEntityState<BannerBlockEntity> implem public CraftBanner copy(Location location) { return new CraftBanner(this, location); } diff --git a/patches/server/0726-More-Teleport-API.patch b/patches/server/0726-More-Teleport-API.patch index 8162e7b15e..deb574d5df 100644 --- a/patches/server/0726-More-Teleport-API.patch +++ b/patches/server/0726-More-Teleport-API.patch @@ -112,7 +112,7 @@ index 47f24e390efd8eb4cb7f62b5203825f4160772b7..243ac4253a1541dba52126bad96682e4 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 240b00ac76d299994129724372d899427c9604c7..d0005af63d4ae0081a39797cb62c5ff3e2efa537 100644 +index c92ca61b2af012e58f998c8b08c895007a423f67..17becfd5a08a87682d665151e3539f870b72f981 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -1286,13 +1286,101 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -265,5 +265,5 @@ index 240b00ac76d299994129724372d899427c9604c7..d0005af63d4ae0081a39797cb62c5ff3 + entity.connection.internalTeleport(to.getX(), to.getY(), to.getZ(), to.getYaw(), to.getPitch(), nms); + // Paper end - Teleport API } else { + entity.portalProcess = null; // SPIGOT-7785: there is no need to carry this over as it contains the old world/location and we might run into trouble if there is a portal in the same spot in both worlds // The respawn reason should never be used if the passed location is non null. - this.server.getHandle().respawn(entity, true, Entity.RemovalReason.CHANGED_DIMENSION, null, to); diff --git a/patches/server/0737-Add-NamespacedKey-biome-methods.patch b/patches/server/0737-Add-NamespacedKey-biome-methods.patch index d981229c6f..0a5e2f5d8a 100644 --- a/patches/server/0737-Add-NamespacedKey-biome-methods.patch +++ b/patches/server/0737-Add-NamespacedKey-biome-methods.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Add NamespacedKey biome methods Co-authored-by: Thonk <[email protected]> diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 1a46245fed7a5fca532df7e3febb22f5effca764..7272f154644366c3c467b265aadc59b879a7b7bd 100644 +index 21461817aa27b5b7df8af186712a54b3c80ee576..2aa7aad2b4b7f2e7c81ccac28a1e6151055b0ba3 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -595,6 +595,21 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -589,6 +589,21 @@ public final class CraftMagicNumbers implements UnsafeValues { } // Paper end diff --git a/patches/server/0739-Stop-large-look-changes-from-crashing-the-server.patch b/patches/server/0739-Stop-large-look-changes-from-crashing-the-server.patch index 63adf0fc72..592bb75b03 100644 --- a/patches/server/0739-Stop-large-look-changes-from-crashing-the-server.patch +++ b/patches/server/0739-Stop-large-look-changes-from-crashing-the-server.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Stop large look changes from crashing the server Co-authored-by: Jaren Knodel <[email protected]> diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 8e11b085d2159b1df8bbe536beb66d9bed915373..1d6179d54ff2264d3489770b23fc7ba479c17f25 100644 +index fa9512da351ef92a8606b3e68ee060dac4c63346..e6335a55d87444d56d6f20dfc51cc4fc797de2cf 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -3129,37 +3129,15 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3158,37 +3158,15 @@ public abstract class LivingEntity extends Entity implements Attackable { this.level().getProfiler().pop(); this.level().getProfiler().push("rangeChecks"); diff --git a/patches/server/0741-Missing-eating-regain-reason.patch b/patches/server/0741-Missing-eating-regain-reason.patch index ac2e750c71..af804e161b 100644 --- a/patches/server/0741-Missing-eating-regain-reason.patch +++ b/patches/server/0741-Missing-eating-regain-reason.patch @@ -18,10 +18,10 @@ index 2ed442c8d36f285420cf84a956e90b6036384ce0..23d4dcc82115fd1a0a77565a04723040 return InteractionResult.sidedSuccess(this.level().isClientSide()); diff --git a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java -index f0abcdda90650df279056009441f8a0426757664..bdc845b36b316069a626dad6cf31f5bcc5cd7d35 100644 +index 12d3ef81247f3088490f9b87d8068c2e2c6338c7..aecd17953dc117d369885d4c8d7b5c7c3a0f8f0f 100644 --- a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java +++ b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java -@@ -384,7 +384,7 @@ public class Camel extends AbstractHorse implements PlayerRideableJumping, Saddl +@@ -387,7 +387,7 @@ public class Camel extends AbstractHorse implements PlayerRideableJumping, Saddl boolean flag = this.getHealth() < this.getMaxHealth(); if (flag) { diff --git a/patches/server/0747-Mitigate-effects-of-WorldCreator-keepSpawnLoaded-ret.patch b/patches/server/0747-Mitigate-effects-of-WorldCreator-keepSpawnLoaded-ret.patch index 08af302068..e344e07414 100644 --- a/patches/server/0747-Mitigate-effects-of-WorldCreator-keepSpawnLoaded-ret.patch +++ b/patches/server/0747-Mitigate-effects-of-WorldCreator-keepSpawnLoaded-ret.patch @@ -7,10 +7,10 @@ Subject: [PATCH] Mitigate effects of WorldCreator#keepSpawnLoaded ret type TODO: Remove in 1.21? diff --git a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java -index 935c97af6fedde505c79956b24069770742a61cf..854e0eb25b03cfe2979bc10223219c5b45691bd9 100644 +index 1e050ef29593233694e0044bedf4c417d876f362..7437228d2b3a724769099b6d03cd83d1e47d9c69 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java +++ b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java -@@ -404,6 +404,12 @@ public class Commodore { +@@ -414,6 +414,12 @@ public class Commodore { super.visitMethodInsn(Opcodes.INVOKEVIRTUAL, runtimeCbPkgPrefix() + "advancement/CraftAdvancement", "getDisplay0", desc, false); return; } diff --git a/patches/server/0755-Correctly-handle-interactions-with-items-on-cooldown.patch b/patches/server/0755-Correctly-handle-interactions-with-items-on-cooldown.patch index 5b61753747..103b29fc68 100644 --- a/patches/server/0755-Correctly-handle-interactions-with-items-on-cooldown.patch +++ b/patches/server/0755-Correctly-handle-interactions-with-items-on-cooldown.patch @@ -30,10 +30,10 @@ index 03d89f326d320c5d778c3d1e2db7d6b88753faec..717d015dd4637dd9d568b751be1dc104 this.interactResult = event.useItemInHand() == Event.Result.DENY; this.interactPosition = blockposition.immutable(); diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 15afaf9b2fcff25288eb5739c9cc72fb301b875a..8233b2287c9cf3cfb4fd3f44d61c055e4076b355 100644 +index 4d5507e44d755588f18d992eb5f382f5f4fac273..d248977de4babc7921be8a64ce51577d31365933 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -546,6 +546,12 @@ public class CraftEventFactory { +@@ -547,6 +547,12 @@ public class CraftEventFactory { } public static PlayerInteractEvent callPlayerInteractEvent(net.minecraft.world.entity.player.Player who, Action action, BlockPos position, Direction direction, ItemStack itemstack, boolean cancelledBlock, InteractionHand hand, Vec3 targetPos) { @@ -46,7 +46,7 @@ index 15afaf9b2fcff25288eb5739c9cc72fb301b875a..8233b2287c9cf3cfb4fd3f44d61c055e Player player = (who == null) ? null : (Player) who.getBukkitEntity(); CraftItemStack itemInHand = CraftItemStack.asCraftMirror(itemstack); -@@ -580,6 +586,11 @@ public class CraftEventFactory { +@@ -581,6 +587,11 @@ public class CraftEventFactory { if (cancelledBlock) { event.setUseInteractedBlock(Event.Result.DENY); } diff --git a/patches/server/0757-Elder-Guardian-appearance-API.patch b/patches/server/0757-Elder-Guardian-appearance-API.patch index 05ac7bf793..f5fe07ced7 100644 --- a/patches/server/0757-Elder-Guardian-appearance-API.patch +++ b/patches/server/0757-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 bffb3c029e917ccfc4b092a5d213a4d0f7a42ce4..daa4aad117a6cf5f1e4e6da245e5c346122ac324 100644 +index f49b65a34e9ca249d9055ecf09262cfe4ab445c5..4ba269dbbb44cc4ef36db7386e4ccc99bd90bd72 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -3297,6 +3297,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -3298,6 +3298,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } // Paper end diff --git a/patches/server/0762-Add-EntityToggleSitEvent.patch b/patches/server/0762-Add-EntityToggleSitEvent.patch index 66349ee5a3..c9aef59416 100644 --- a/patches/server/0762-Add-EntityToggleSitEvent.patch +++ b/patches/server/0762-Add-EntityToggleSitEvent.patch @@ -69,10 +69,10 @@ index 7b3d5322611990406028e59b1409907291e27b21..293d6891948e99ac9bd741008f7dcbc5 } diff --git a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java -index bdc845b36b316069a626dad6cf31f5bcc5cd7d35..71c1bc87ab5942fa07f187fa44089c08b5804e91 100644 +index aecd17953dc117d369885d4c8d7b5c7c3a0f8f0f..0388b09e1c4f03958384680ed487792a54007463 100644 --- a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java +++ b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java -@@ -567,7 +567,7 @@ public class Camel extends AbstractHorse implements PlayerRideableJumping, Saddl +@@ -570,7 +570,7 @@ public class Camel extends AbstractHorse implements PlayerRideableJumping, Saddl } public void sitDown() { @@ -81,7 +81,7 @@ index bdc845b36b316069a626dad6cf31f5bcc5cd7d35..71c1bc87ab5942fa07f187fa44089c08 this.makeSound(SoundEvents.CAMEL_SIT); this.setPose(Pose.SITTING); this.gameEvent(GameEvent.ENTITY_ACTION); -@@ -576,7 +576,7 @@ public class Camel extends AbstractHorse implements PlayerRideableJumping, Saddl +@@ -579,7 +579,7 @@ public class Camel extends AbstractHorse implements PlayerRideableJumping, Saddl } public void standUp() { @@ -90,7 +90,7 @@ index bdc845b36b316069a626dad6cf31f5bcc5cd7d35..71c1bc87ab5942fa07f187fa44089c08 this.makeSound(SoundEvents.CAMEL_STAND); this.setPose(Pose.STANDING); this.gameEvent(GameEvent.ENTITY_ACTION); -@@ -585,6 +585,7 @@ public class Camel extends AbstractHorse implements PlayerRideableJumping, Saddl +@@ -588,6 +588,7 @@ public class Camel extends AbstractHorse implements PlayerRideableJumping, Saddl } public void standUpInstantly() { diff --git a/patches/server/0768-Add-PrePlayerAttackEntityEvent.patch b/patches/server/0768-Add-PrePlayerAttackEntityEvent.patch index 02d71668dc..b0f3a07890 100644 --- a/patches/server/0768-Add-PrePlayerAttackEntityEvent.patch +++ b/patches/server/0768-Add-PrePlayerAttackEntityEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add PrePlayerAttackEntityEvent diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java -index 028dc5eda7bb93bb4714f6b223379803307add93..b5e1f39957f05670aec593f31ab2725fccffc692 100644 +index fab56040ecf496e74f583ec5d6c6c9861cfa4e13..ad334f149fe1b44d4ebe48489dcd2811ff1b5cd0 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java -@@ -1256,8 +1256,17 @@ public abstract class Player extends LivingEntity { +@@ -1257,8 +1257,17 @@ public abstract class Player extends LivingEntity { } public void attack(Entity target) { diff --git a/patches/server/0770-Add-Player-Warden-Warning-API.patch b/patches/server/0770-Add-Player-Warden-Warning-API.patch index 48110ad056..85b7ab61e8 100644 --- a/patches/server/0770-Add-Player-Warden-Warning-API.patch +++ b/patches/server/0770-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 daa4aad117a6cf5f1e4e6da245e5c346122ac324..90ce5c386d46f10e14df67953938168c29d24c6a 100644 +index 4ba269dbbb44cc4ef36db7386e4ccc99bd90bd72..02b9233ecf929ac9ec7d304231d8bc66fc00dad4 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -3302,6 +3302,41 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -3303,6 +3303,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/0773-check-global-player-list-where-appropriate.patch b/patches/server/0773-check-global-player-list-where-appropriate.patch index 63bb71842c..32596b991d 100644 --- a/patches/server/0773-check-global-player-list-where-appropriate.patch +++ b/patches/server/0773-check-global-player-list-where-appropriate.patch @@ -24,10 +24,10 @@ index 15607da2883653cd757a3220ddf79833afd39330..b9d3a98824fc146128f35244f5f15bba + // Paper end - check global player list where appropriate } diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 1d6179d54ff2264d3489770b23fc7ba479c17f25..532f954a052eca3279f974450c2133837410282e 100644 +index e6335a55d87444d56d6f20dfc51cc4fc797de2cf..ec656b2505c143e453b540e3e0a2cbfa0b370cd3 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -3694,7 +3694,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3723,7 +3723,7 @@ public abstract class LivingEntity extends Entity implements Attackable { } public void onItemPickup(ItemEntity item) { diff --git a/patches/server/0776-Friction-API.patch b/patches/server/0776-Friction-API.patch index 43e40c8c33..dfa1fdc21b 100644 --- a/patches/server/0776-Friction-API.patch +++ b/patches/server/0776-Friction-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Friction API diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 532f954a052eca3279f974450c2133837410282e..c64fb799f2f40831cd25a409713c9b5081c76002 100644 +index ec656b2505c143e453b540e3e0a2cbfa0b370cd3..fd0e44ea6ff2868b06c8f0af14be998d95f9f46b 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java @@ -285,6 +285,7 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -25,7 +25,7 @@ index 532f954a052eca3279f974450c2133837410282e..c64fb799f2f40831cd25a409713c9b50 } public void setDiscardFriction(boolean noDrag) { -@@ -773,6 +774,11 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -774,6 +775,11 @@ public abstract class LivingEntity extends Entity implements Attackable { @Override public void addAdditionalSaveData(CompoundTag nbt) { @@ -37,7 +37,7 @@ index 532f954a052eca3279f974450c2133837410282e..c64fb799f2f40831cd25a409713c9b50 nbt.putFloat("Health", this.getHealth()); nbt.putShort("HurtTime", (short) this.hurtTime); nbt.putInt("HurtByTimestamp", this.lastHurtByMobTimestamp); -@@ -816,6 +822,16 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -817,6 +823,16 @@ public abstract class LivingEntity extends Entity implements Attackable { } this.internalSetAbsorptionAmount(absorptionAmount); // Paper end - Check for NaN diff --git a/patches/server/0793-Flying-Fall-Damage.patch b/patches/server/0793-Flying-Fall-Damage.patch index 8b9d6862bd..4132811a77 100644 --- a/patches/server/0793-Flying-Fall-Damage.patch +++ b/patches/server/0793-Flying-Fall-Damage.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Flying Fall Damage diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java -index b5e1f39957f05670aec593f31ab2725fccffc692..98b3547b970e30e9cc009ef1fac9202590692d84 100644 +index ad334f149fe1b44d4ebe48489dcd2811ff1b5cd0..950ce40d268d89ff3c503116081db6c9ccd65329 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java -@@ -195,6 +195,7 @@ public abstract class Player extends LivingEntity { +@@ -196,6 +196,7 @@ public abstract class Player extends LivingEntity { private boolean ignoreFallDamageFromCurrentImpulse; private int currentImpulseContextResetGraceTime; public boolean affectsSpawning = true; // Paper - Affects Spawning API @@ -16,7 +16,7 @@ index b5e1f39957f05670aec593f31ab2725fccffc692..98b3547b970e30e9cc009ef1fac92025 // CraftBukkit start public boolean fauxSleeping; -@@ -1690,7 +1691,7 @@ public abstract class Player extends LivingEntity { +@@ -1693,7 +1694,7 @@ public abstract class Player extends LivingEntity { @Override public boolean causeFallDamage(float fallDistance, float damageMultiplier, DamageSource damageSource) { @@ -26,10 +26,10 @@ index b5e1f39957f05670aec593f31ab2725fccffc692..98b3547b970e30e9cc009ef1fac92025 } 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 6503bce4c0281619489adc01fa1da0c59b433875..207e72cad59a07c0750e9303dd21519c83ab2358 100644 +index 682c5e9328d965bf335bb06ac7aedf6d49b1c6cb..4bcceef859099405a3d78bc7e6b12c778e906d72 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2580,6 +2580,19 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2581,6 +2581,19 @@ public class CraftPlayer extends CraftHumanEntity implements Player { this.getHandle().onUpdateAbilities(); } diff --git a/patches/server/0797-Correctly-shrink-items-during-EntityResurrectEvent.patch b/patches/server/0797-Correctly-shrink-items-during-EntityResurrectEvent.patch index 58b1a31cc8..8f9bf2cb24 100644 --- a/patches/server/0797-Correctly-shrink-items-during-EntityResurrectEvent.patch +++ b/patches/server/0797-Correctly-shrink-items-during-EntityResurrectEvent.patch @@ -22,10 +22,10 @@ This patch corrects this behaviour by only shrinking the item if a totem of undying was found and the event was called uncancelled. diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index c64fb799f2f40831cd25a409713c9b5081c76002..8ec08a30875816d2b8258b56ee37a4938aed50fb 100644 +index fd0e44ea6ff2868b06c8f0af14be998d95f9f46b..7ad469bf4b88f9e33ad4aaebe18e41d25769444e 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -1621,7 +1621,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -1632,7 +1632,7 @@ public abstract class LivingEntity extends Entity implements Attackable { this.level().getCraftServer().getPluginManager().callEvent(event); if (!event.isCancelled()) { diff --git a/patches/server/0803-Add-EntityFertilizeEggEvent.patch b/patches/server/0803-Add-EntityFertilizeEggEvent.patch index a077b2cfc0..f8723b10b0 100644 --- a/patches/server/0803-Add-EntityFertilizeEggEvent.patch +++ b/patches/server/0803-Add-EntityFertilizeEggEvent.patch @@ -69,10 +69,10 @@ index d34d8fe70379dcad9540739ec0ae1c94f01fc46b..fadd341ff398886a4da102eefa1beb95 this.playSound(SoundEvents.SNIFFER_EGG_PLOP, 1.0F, (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 0.5F); } // Paper - Call EntityDropItemEvent diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 8233b2287c9cf3cfb4fd3f44d61c055e4076b355..63038e0ca10507751218fda5b9ace3cb6295e817 100644 +index d248977de4babc7921be8a64ce51577d31365933..85621246d1e29d678d8ec1b40893ff6650e08e1e 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -2128,4 +2128,28 @@ public class CraftEventFactory { +@@ -2147,4 +2147,28 @@ public class CraftEventFactory { return event.callEvent(); } // Paper end diff --git a/patches/server/0804-Fix-HumanEntity-drop-not-updating-the-client-inv.patch b/patches/server/0804-Fix-HumanEntity-drop-not-updating-the-client-inv.patch index a3e0925b49..99130d8f1a 100644 --- a/patches/server/0804-Fix-HumanEntity-drop-not-updating-the-client-inv.patch +++ b/patches/server/0804-Fix-HumanEntity-drop-not-updating-the-client-inv.patch @@ -7,10 +7,10 @@ Subject: [PATCH] Fix HumanEntity#drop not updating the client inv public net.minecraft.server.level.ServerPlayer containerSynchronizer diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -index e1150d36de56466ad9fdd5f2cdb4c30855d4af70..3d36d79a4e7f16f6face3465cdf54656984f3ebc 100644 +index 9ab3fc287480aedcb4033801d4f092719e933454..12ab8f7cde88cd6ce3ad474fe2843d5d30c3c0d7 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -@@ -750,8 +750,15 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { +@@ -751,8 +751,15 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { // Paper end @Override public boolean dropItem(boolean dropAll) { diff --git a/patches/server/0807-Fix-advancement-triggers-for-entity-damage.patch b/patches/server/0807-Fix-advancement-triggers-for-entity-damage.patch index e4afda05dd..4ebe570740 100644 --- a/patches/server/0807-Fix-advancement-triggers-for-entity-damage.patch +++ b/patches/server/0807-Fix-advancement-triggers-for-entity-damage.patch @@ -23,10 +23,10 @@ index 2ebbf7954dc5e0d6c9d53327d05b725eec310086..c5bd2e90ad74ba08910f65a2e07b6f76 return !this.getResponse(); diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 8ec08a30875816d2b8258b56ee37a4938aed50fb..c8c52514777a97b35bd4fb2ac84565f07c8921d7 100644 +index 7ad469bf4b88f9e33ad4aaebe18e41d25769444e..ffc0fcd7c2075b44585bd754494f2f7c07788f47 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -2359,7 +2359,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -2388,7 +2388,7 @@ public abstract class LivingEntity extends Entity implements Attackable { // Duplicate triggers if blocking if (event.getDamage(DamageModifier.BLOCKING) < 0) { if (this instanceof ServerPlayer) { @@ -35,7 +35,7 @@ index 8ec08a30875816d2b8258b56ee37a4938aed50fb..c8c52514777a97b35bd4fb2ac84565f0 f2 = (float) -event.getDamage(DamageModifier.BLOCKING); if (f2 > 0.0F && f2 < 3.4028235E37F) { ((ServerPlayer) this).awardStat(Stats.DAMAGE_BLOCKED_BY_SHIELD, Math.round(originalDamage * 10.0F)); -@@ -2367,7 +2367,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -2396,7 +2396,7 @@ public abstract class LivingEntity extends Entity implements Attackable { } if (damagesource.getEntity() instanceof ServerPlayer) { diff --git a/patches/server/0823-Expand-PlayerItemMendEvent.patch b/patches/server/0823-Expand-PlayerItemMendEvent.patch index 446aa3bb10..5cc04e3321 100644 --- a/patches/server/0823-Expand-PlayerItemMendEvent.patch +++ b/patches/server/0823-Expand-PlayerItemMendEvent.patch @@ -30,10 +30,10 @@ index a758b2456acac23095fe4619ae10300a034cb460..a58ff67052fb5f33782f8b5c83465ec0 if (l > 0) { // this.value = l; // CraftBukkit - update exp value of orb for PlayerItemMendEvent calls // Paper - the value field should not be mutated here because it doesn't take "count" into account diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index ee5d93cd0c7ea7376e8488265d4e21610edeedc2..e84337b01ec7e5c530a4c6042b9386385eb58446 100644 +index d0cd2a8c99d607e36d37718b9e2c439f4a939535..7cd9b17e1863a369b578bc2a22d892246e7a02b9 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1852,11 +1852,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1853,11 +1853,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player { handle.serverLevel(), itemstack, amount ); int i = Math.min(possibleDurabilityFromXp, itemstack.getDamageValue()); @@ -49,10 +49,10 @@ index ee5d93cd0c7ea7376e8488265d4e21610edeedc2..e84337b01ec7e5c530a4c6042b938638 } } diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 63038e0ca10507751218fda5b9ace3cb6295e817..214a1b8901947e8c08e8d7fc3f19e866a21350c8 100644 +index 85621246d1e29d678d8ec1b40893ff6650e08e1e..b1c568200fb6870843b8ace4a9b15041980aceeb 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -1267,10 +1267,10 @@ public class CraftEventFactory { +@@ -1271,10 +1271,10 @@ public class CraftEventFactory { return event; } diff --git a/patches/server/0838-Call-missing-BlockDispenseEvent.patch b/patches/server/0838-Call-missing-BlockDispenseEvent.patch index 97050595b8..e4be646fe3 100644 --- a/patches/server/0838-Call-missing-BlockDispenseEvent.patch +++ b/patches/server/0838-Call-missing-BlockDispenseEvent.patch @@ -50,10 +50,10 @@ index 96db0b1041a4c0f054d4f3f2bdced960b119664e..78951f50188528718cdb3dbbaabe3f9f for (int k = 0; k < 5; ++k) { worldserver.sendParticles(ParticleTypes.SPLASH, (double) blockposition.getX() + worldserver.random.nextDouble(), (double) (blockposition.getY() + 1), (double) blockposition.getZ() + worldserver.random.nextDouble(), 1, 0.0D, 0.0D, 0.0D, 1.0D); diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 214a1b8901947e8c08e8d7fc3f19e866a21350c8..35b6443d15678ec84271dcebf29b98b36df97a6e 100644 +index b1c568200fb6870843b8ace4a9b15041980aceeb..cbb5baae60e682bc250568327737a1b1994ceb76 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -2129,6 +2129,32 @@ public class CraftEventFactory { +@@ -2148,6 +2148,32 @@ public class CraftEventFactory { } // Paper end diff --git a/patches/server/0843-Fix-BanList-API.patch b/patches/server/0843-Fix-BanList-API.patch index dcc17ccb44..995aa9c90a 100644 --- a/patches/server/0843-Fix-BanList-API.patch +++ b/patches/server/0843-Fix-BanList-API.patch @@ -208,10 +208,10 @@ 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 e84337b01ec7e5c530a4c6042b9386385eb58446..85f403c07ff146a0da232ac7bfc0551a2fa2601b 100644 +index 7cd9b17e1863a369b578bc2a22d892246e7a02b9..49e22acbcdcdb2108b360c2a6e40c752c12ab9f6 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1746,23 +1746,23 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1747,23 +1747,23 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } @Override @@ -240,7 +240,7 @@ index e84337b01ec7e5c530a4c6042b9386385eb58446..85f403c07ff146a0da232ac7bfc0551a if (kickPlayer) { this.kickPlayer(reason); } -@@ -1770,12 +1770,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1771,12 +1771,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } @Override diff --git a/patches/server/0847-ExperienceOrb-should-call-EntitySpawnEvent.patch b/patches/server/0847-ExperienceOrb-should-call-EntitySpawnEvent.patch index 542bede5c4..e3ebc75918 100644 --- a/patches/server/0847-ExperienceOrb-should-call-EntitySpawnEvent.patch +++ b/patches/server/0847-ExperienceOrb-should-call-EntitySpawnEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] ExperienceOrb should call EntitySpawnEvent diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 35b6443d15678ec84271dcebf29b98b36df97a6e..7b1de2fddd5ff236c477439142c6e38a580d7f56 100644 +index cbb5baae60e682bc250568327737a1b1994ceb76..01f6d9a3339529bc3a1ec2bacae422b86f1eb253 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -736,7 +736,8 @@ public class CraftEventFactory { +@@ -737,7 +737,8 @@ public class CraftEventFactory { // Spigot start - SPIGOT-7523: Merge after spawn event and only merge if the event was not cancelled (gets checked above) if (entity instanceof net.minecraft.world.entity.ExperienceOrb xp) { double radius = world.spigotConfig.expMerge; diff --git a/patches/server/0861-Fix-custom-statistic-criteria-creation.patch b/patches/server/0861-Fix-custom-statistic-criteria-creation.patch index f399187f50..23faf0bb9f 100644 --- a/patches/server/0861-Fix-custom-statistic-criteria-creation.patch +++ b/patches/server/0861-Fix-custom-statistic-criteria-creation.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix custom statistic criteria creation diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 7272f154644366c3c467b265aadc59b879a7b7bd..a98fcfcf71b2a072d60120046d9aac9ad4546196 100644 +index 2aa7aad2b4b7f2e7c81ccac28a1e6151055b0ba3..e74f4a16d3e1e7cf716b93057c8b42e8ed0f3503 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -610,6 +610,14 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -604,6 +604,14 @@ public final class CraftMagicNumbers implements UnsafeValues { } // Paper end - namespaced key biome methods diff --git a/patches/server/0870-Add-Listing-API-for-Player.patch b/patches/server/0870-Add-Listing-API-for-Player.patch index 45d76a9d22..8f4e9c9d40 100644 --- a/patches/server/0870-Add-Listing-API-for-Player.patch +++ b/patches/server/0870-Add-Listing-API-for-Player.patch @@ -119,7 +119,7 @@ index be6bf7afa3cea4ed48f363e89ccd079062edc8d9..9b1a6d8351fb473eec75a2fd08fb892b // 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 296bb88ed34f499535ef0b9fdffa67b7de81c60b..e4de4ed09b20ed224eadcbc6d650192897c4def5 100644 +index 4c5249eab8e59b46c902f2cb65f90aa2a66a33d4..204e4e4dd197088457cd6d2a18f86287ca3324b2 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -201,6 +201,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -130,7 +130,7 @@ index 296bb88ed34f499535ef0b9fdffa67b7de81c60b..e4de4ed09b20ed224eadcbc6d6501928 private static final WeakHashMap<Plugin, WeakReference<Plugin>> pluginWeakReferences = new WeakHashMap<>(); private int hash = 0; private double health = 20; -@@ -2091,7 +2092,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2092,7 +2093,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { otherPlayer.setUUID(uuidOverride); } // Paper end @@ -139,7 +139,7 @@ index 296bb88ed34f499535ef0b9fdffa67b7de81c60b..e4de4ed09b20ed224eadcbc6d6501928 if (original != null) otherPlayer.setUUID(original); // Paper - uuid override } -@@ -2195,6 +2196,41 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2196,6 +2197,41 @@ public class CraftPlayer extends CraftHumanEntity implements Player { return (entity != null) ? this.canSee(entity) : false; // If we can't find it, we can't see it } diff --git a/patches/server/0872-Add-BlockFace-to-BlockDamageEvent.patch b/patches/server/0872-Add-BlockFace-to-BlockDamageEvent.patch index 7ad1e7c9e4..7721e78d75 100644 --- a/patches/server/0872-Add-BlockFace-to-BlockDamageEvent.patch +++ b/patches/server/0872-Add-BlockFace-to-BlockDamageEvent.patch @@ -18,10 +18,10 @@ index c680f081ba548f84f07a968a46811090c53e57e3..d839f8df658c894f144ba4637d290ffb if (blockEvent.isCancelled()) { // Let the client know the block still exists diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 7b1de2fddd5ff236c477439142c6e38a580d7f56..361ad90853dbd7dc2d502f224f355d6d5e9c92cc 100644 +index 01f6d9a3339529bc3a1ec2bacae422b86f1eb253..9f6d459146f502909d262a7178d5b8d5575c563c 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -651,13 +651,13 @@ public class CraftEventFactory { +@@ -652,13 +652,13 @@ public class CraftEventFactory { /** * BlockDamageEvent */ diff --git a/patches/server/0882-Add-titleOverride-to-InventoryOpenEvent.patch b/patches/server/0882-Add-titleOverride-to-InventoryOpenEvent.patch index 3bb0db6ef2..c8738e3bfc 100644 --- a/patches/server/0882-Add-titleOverride-to-InventoryOpenEvent.patch +++ b/patches/server/0882-Add-titleOverride-to-InventoryOpenEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add titleOverride to InventoryOpenEvent diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 46d6fb2591f47c245446db210a00cbaa1e2bd99b..184f3c7a1304f4f9d2aaeae27172be9d853c30de 100644 +index b5035cc4b5cfa246487dc5091cc5d43e04253d6d..f568fa18ddcb1a1cd060c469edd6db45431bb53c 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -1659,12 +1659,17 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player { @@ -37,7 +37,7 @@ index 46d6fb2591f47c245446db210a00cbaa1e2bd99b..184f3c7a1304f4f9d2aaeae27172be9d this.initMenu(container); return OptionalInt.of(this.containerCounter); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -index 3d36d79a4e7f16f6face3465cdf54656984f3ebc..41f3cdec7deabf34358b8087df77169f85a5b919 100644 +index 12ab8f7cde88cd6ce3ad474fe2843d5d30c3c0d7..c1bad887d1340ebc7c63fda3dceff929e4a44517 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java @@ -358,12 +358,16 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { @@ -58,7 +58,7 @@ index 3d36d79a4e7f16f6face3465cdf54656984f3ebc..41f3cdec7deabf34358b8087df77169f //player.connection.send(new ClientboundOpenScreenPacket(container.containerId, windowType, CraftChatMessage.fromString(title)[0])); // Paper - comment if (!player.isImmobile()) player.connection.send(new ClientboundOpenScreenPacket(container.containerId, windowType, io.papermc.paper.adventure.PaperAdventure.asVanilla(adventure$title))); // Paper - Prevent opening inventories when frozen -@@ -439,7 +443,10 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { +@@ -440,7 +444,10 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { } // Trigger an INVENTORY_OPEN event @@ -70,7 +70,7 @@ index 3d36d79a4e7f16f6face3465cdf54656984f3ebc..41f3cdec7deabf34358b8087df77169f if (container == null) { return; } -@@ -450,6 +457,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { +@@ -451,6 +458,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { //String title = inventory.getTitle(); // Paper - comment net.kyori.adventure.text.Component adventure$title = inventory.title(); // Paper if (adventure$title == null) adventure$title = net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(inventory.getTitle()); // Paper @@ -79,10 +79,10 @@ index 3d36d79a4e7f16f6face3465cdf54656984f3ebc..41f3cdec7deabf34358b8087df77169f if (!player.isImmobile()) player.connection.send(new ClientboundOpenScreenPacket(container.containerId, windowType, io.papermc.paper.adventure.PaperAdventure.asVanilla(adventure$title))); // Paper - Prevent opening inventories when frozen player.containerMenu = container; diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 361ad90853dbd7dc2d502f224f355d6d5e9c92cc..c9a38f6b91ac538aea4c4a6f23d18415585a931b 100644 +index 9f6d459146f502909d262a7178d5b8d5575c563c..e079e8f4078078d737a9d554dbcd2568b1a1f9eb 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -1384,10 +1384,21 @@ public class CraftEventFactory { +@@ -1388,10 +1388,21 @@ public class CraftEventFactory { } public static AbstractContainerMenu callInventoryOpenEvent(ServerPlayer player, AbstractContainerMenu container) { @@ -105,7 +105,7 @@ index 361ad90853dbd7dc2d502f224f355d6d5e9c92cc..c9a38f6b91ac538aea4c4a6f23d18415 if (player.containerMenu != player.inventoryMenu) { // fire INVENTORY_CLOSE if one already open player.connection.handleContainerClose(new ServerboundContainerClosePacket(player.containerMenu.containerId), InventoryCloseEvent.Reason.OPEN_NEW); // Paper - Inventory close reason } -@@ -1402,10 +1413,10 @@ public class CraftEventFactory { +@@ -1406,10 +1417,10 @@ public class CraftEventFactory { if (event.isCancelled()) { container.transferTo(player.containerMenu, craftPlayer); diff --git a/patches/server/0899-Fix-UnsafeValues-loadAdvancement.patch b/patches/server/0899-Fix-UnsafeValues-loadAdvancement.patch index 205c42df23..ff17036140 100644 --- a/patches/server/0899-Fix-UnsafeValues-loadAdvancement.patch +++ b/patches/server/0899-Fix-UnsafeValues-loadAdvancement.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix UnsafeValues#loadAdvancement diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index a98fcfcf71b2a072d60120046d9aac9ad4546196..17caf21e23aa7f5a5216923e73aae94a59bcac44 100644 +index e74f4a16d3e1e7cf716b93057c8b42e8ed0f3503..278ef7b7cd2cf95dcf38fb4cadfd2acfcc9c4dc5 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -322,9 +322,30 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -318,9 +318,30 @@ public final class CraftMagicNumbers implements UnsafeValues { ResourceLocation minecraftkey = CraftNamespacedKey.toMinecraft(key); JsonElement jsonelement = ServerAdvancementManager.GSON.fromJson(advancement, JsonElement.class); diff --git a/patches/server/0900-Add-player-idle-duration-API.patch b/patches/server/0900-Add-player-idle-duration-API.patch index e9d6bf10c6..eac8276c5d 100644 --- a/patches/server/0900-Add-player-idle-duration-API.patch +++ b/patches/server/0900-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 d5757fa3d4254535448eb040593c8c23995b7bc9..141b79346d6826a5fcea04f2d65506448cbed254 100644 +index ea742de14280c64f94461ebfb4647536a1dddb4f..bababc918704a671ee4635ba0c79219d94474821 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -3418,6 +3418,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -3419,6 +3419,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } // Paper end diff --git a/patches/server/0907-Broadcast-take-item-packets-with-collector-as-source.patch b/patches/server/0907-Broadcast-take-item-packets-with-collector-as-source.patch index f114e5e960..25d46b180a 100644 --- a/patches/server/0907-Broadcast-take-item-packets-with-collector-as-source.patch +++ b/patches/server/0907-Broadcast-take-item-packets-with-collector-as-source.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Broadcast take item packets with collector as source This fixes players (which can't view the collector) seeing item pickups with themselves as the target. diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index c8c52514777a97b35bd4fb2ac84565f07c8921d7..9a2b874594e2f04f59b7d2be389223604d56219a 100644 +index ffc0fcd7c2075b44585bd754494f2f7c07788f47..2ad88bc281861f53b5d65ce81448a334849ffff0 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -3720,7 +3720,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3749,7 +3749,7 @@ public abstract class LivingEntity extends Entity implements Attackable { public void take(Entity item, int count) { if (!item.isRemoved() && !this.level().isClientSide && (item instanceof ItemEntity || item instanceof AbstractArrow || item instanceof ExperienceOrb)) { diff --git a/patches/server/0911-Fix-several-issues-with-EntityBreedEvent.patch b/patches/server/0911-Fix-several-issues-with-EntityBreedEvent.patch index 9e82a901a0..6a97d9fb9e 100644 --- a/patches/server/0911-Fix-several-issues-with-EntityBreedEvent.patch +++ b/patches/server/0911-Fix-several-issues-with-EntityBreedEvent.patch @@ -11,10 +11,10 @@ also changed. Also in several places, the breed item was stored after it was decreased by one to consume the item. diff --git a/src/main/java/net/minecraft/world/entity/animal/Animal.java b/src/main/java/net/minecraft/world/entity/animal/Animal.java -index 370c444153d04fe7896952219604d83a19a996e2..e96fca314bebea5fcdb684d3478af1b6dc5f13cf 100644 +index b46352b328178df2a48d1c9e895bed3fabd2c292..1808e1b01afa3041a54c9c9a7586d4d61960527a 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Animal.java +++ b/src/main/java/net/minecraft/world/entity/animal/Animal.java -@@ -147,8 +147,9 @@ public abstract class Animal extends AgeableMob { +@@ -148,8 +148,9 @@ public abstract class Animal extends AgeableMob { int i = this.getAge(); if (!this.level().isClientSide && i == 0 && this.canFallInLove()) { @@ -25,7 +25,7 @@ index 370c444153d04fe7896952219604d83a19a996e2..e96fca314bebea5fcdb684d3478af1b6 return InteractionResult.SUCCESS; } -@@ -174,10 +175,18 @@ public abstract class Animal extends AgeableMob { +@@ -175,10 +176,18 @@ public abstract class Animal extends AgeableMob { return this.inLove <= 0; } @@ -44,7 +44,7 @@ index 370c444153d04fe7896952219604d83a19a996e2..e96fca314bebea5fcdb684d3478af1b6 return; } this.inLove = entityEnterLoveModeEvent.getTicksInLove(); -@@ -185,7 +194,7 @@ public abstract class Animal extends AgeableMob { +@@ -186,7 +195,7 @@ public abstract class Animal extends AgeableMob { if (player != null) { this.loveCause = player.getUUID(); } @@ -69,10 +69,10 @@ index 293d6891948e99ac9bd741008f7dcbc5fc1a2e3d..e108f876d3f129c6287f13d68427aed2 if (this.level().isClientSide || this.isSitting() || this.isInWater()) { return InteractionResult.PASS; diff --git a/src/main/java/net/minecraft/world/entity/animal/armadillo/Armadillo.java b/src/main/java/net/minecraft/world/entity/animal/armadillo/Armadillo.java -index 38bb6e627c5500923103c3c9552eddcc63257a1d..792d9039ac0561464c666977ff8308e4c629e5eb 100644 +index 4eb305bc77767531efb6f9d299216248d4ee39d2..729fd2d52dd48e25ee7a077a3ffafc80ecef7c9f 100644 --- a/src/main/java/net/minecraft/world/entity/animal/armadillo/Armadillo.java +++ b/src/main/java/net/minecraft/world/entity/animal/armadillo/Armadillo.java -@@ -348,8 +348,8 @@ public class Armadillo extends Animal { +@@ -352,8 +352,8 @@ public class Armadillo extends Animal { } @Override @@ -84,10 +84,10 @@ index 38bb6e627c5500923103c3c9552eddcc63257a1d..792d9039ac0561464c666977ff8308e4 } diff --git a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java -index 71c1bc87ab5942fa07f187fa44089c08b5804e91..147974651d37e81d81ca97bfa31c9df9867492be 100644 +index 0388b09e1c4f03958384680ed487792a54007463..8941752e4600ccd11b3fa1147b2e414785589eed 100644 --- a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java +++ b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java -@@ -390,7 +390,7 @@ public class Camel extends AbstractHorse implements PlayerRideableJumping, Saddl +@@ -393,7 +393,7 @@ public class Camel extends AbstractHorse implements PlayerRideableJumping, Saddl boolean flag1 = this.isTamed() && this.getAge() == 0 && this.canFallInLove(); if (flag1) { diff --git a/patches/server/0915-Don-t-fire-sync-events-during-worldgen.patch b/patches/server/0915-Don-t-fire-sync-events-during-worldgen.patch index b115ced80b..01cd11852f 100644 --- a/patches/server/0915-Don-t-fire-sync-events-during-worldgen.patch +++ b/patches/server/0915-Don-t-fire-sync-events-during-worldgen.patch @@ -68,10 +68,10 @@ index 5fb3279342506611882b5780cfbee0371919c93c..b98f9246b60daf31460f41ce214dfa7c }, () -> { EntityType.LOGGER.warn("Skipping Entity with id {}", nbt.getString("id")); diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 9a2b874594e2f04f59b7d2be389223604d56219a..3f788e88604b77761c5add39450cf1640604c0f0 100644 +index 2ad88bc281861f53b5d65ce81448a334849ffff0..2cbb4ff57117382791eefa4881fc0b328c77d58a 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -1137,6 +1137,11 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -1138,6 +1138,11 @@ public abstract class LivingEntity extends Entity implements Attackable { } public boolean addEffect(MobEffectInstance mobeffect, @Nullable Entity entity, EntityPotionEffectEvent.Cause cause) { @@ -83,7 +83,7 @@ index 9a2b874594e2f04f59b7d2be389223604d56219a..3f788e88604b77761c5add39450cf164 // org.spigotmc.AsyncCatcher.catchOp("effect add"); // Spigot // Paper - move to API if (this.isTickingEffects) { this.effectsToProcess.add(new ProcessableEffect(mobeffect, cause)); -@@ -1156,10 +1161,13 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -1157,10 +1162,13 @@ public abstract class LivingEntity extends Entity implements Attackable { override = new MobEffectInstance(mobeffect1).update(mobeffect); } @@ -97,7 +97,7 @@ index 9a2b874594e2f04f59b7d2be389223604d56219a..3f788e88604b77761c5add39450cf164 // CraftBukkit end if (mobeffect1 == null) { -@@ -1168,7 +1176,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -1169,7 +1177,7 @@ public abstract class LivingEntity extends Entity implements Attackable { flag = true; mobeffect.onEffectAdded(this); // CraftBukkit start diff --git a/patches/server/0918-Restore-vanilla-entity-drops-behavior.patch b/patches/server/0918-Restore-vanilla-entity-drops-behavior.patch index 5d48caea92..7aa60b4674 100644 --- a/patches/server/0918-Restore-vanilla-entity-drops-behavior.patch +++ b/patches/server/0918-Restore-vanilla-entity-drops-behavior.patch @@ -9,14 +9,14 @@ on dropping the item instead of generalizing it for all dropped items like CB does. diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 184f3c7a1304f4f9d2aaeae27172be9d853c30de..3cbb59df34156479d24a8251f2b3acbb5e60dc2c 100644 +index f568fa18ddcb1a1cd060c469edd6db45431bb53c..191dfbd0f15c3a21278f3c4f9ce29f1698e0836c 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -978,22 +978,20 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player { +@@ -978,20 +978,20 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player { if (this.isRemoved()) { return; } -- java.util.List<org.bukkit.inventory.ItemStack> loot = new java.util.ArrayList<org.bukkit.inventory.ItemStack>(this.getInventory().getContainerSize()); +- java.util.List<org.bukkit.inventory.ItemStack> loot = new java.util.ArrayList<>(this.getInventory().getContainerSize()); + List<DefaultDrop> loot = new java.util.ArrayList<>(this.getInventory().getContainerSize()); // Paper - Restore vanilla drops behavior boolean keepInventory = this.level().getGameRules().getBoolean(GameRules.RULE_KEEPINVENTORY) || this.isSpectator(); @@ -31,24 +31,11 @@ index 184f3c7a1304f4f9d2aaeae27172be9d853c30de..3cbb59df34156479d24a8251f2b3acbb if (this.shouldDropLoot() && this.level().getGameRules().getBoolean(GameRules.RULE_DOMOBLOOT)) { // Paper - fix player loottables running when mob loot gamerule is false // SPIGOT-5071: manually add player loot tables (SPIGOT-5195 - ignores keepInventory rule) this.dropFromLootTable(damageSource, this.lastHurtByPlayerTime > 0); -- for (org.bukkit.inventory.ItemStack item : this.drops) { -- loot.add(item); -- } -+ loot.addAll(this.drops); // Paper - this.drops.clear(); // SPIGOT-5188: make sure to clear - } // Paper - fix player loottables running when mob loot gamerule is false - -@@ -2530,8 +2528,8 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player { - } - - @Override -- public ItemEntity drop(ItemStack stack, boolean throwRandomly, boolean retainOwnership) { -- ItemEntity entityitem = super.drop(stack, throwRandomly, retainOwnership); -+ public ItemEntity drop(ItemStack stack, boolean throwRandomly, boolean retainOwnership, boolean callDropEvent) { // Paper - Restore vanilla drops behavior; override method with most params -+ ItemEntity entityitem = super.drop(stack, throwRandomly, retainOwnership, callDropEvent); // Paper - Restore vanilla drops behavior; override method with most params +- this.dropCustomDeathLoot(this.serverLevel(), damageSource, flag); ++ // Paper - Restore vanilla drops behaviour; custom death loot is a noop on server player, remove. - if (entityitem == null) { - return null; + loot.addAll(this.drops); + this.drops.clear(); // SPIGOT-5188: make sure to clear diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java index 24aacf9997c9ea0bd68ef3803f4a3ee4a920ab44..363fe1aff439983199f5137547cef9516fbab2a8 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java @@ -104,7 +91,7 @@ index 24aacf9997c9ea0bd68ef3803f4a3ee4a920ab44..363fe1aff439983199f5137547cef951 return this.spawnAtLocation(entityitem); } diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 3f788e88604b77761c5add39450cf1640604c0f0..3e58fa4160fd4e4e5b5d00ba8f963b1b74be2663 100644 +index 2cbb4ff57117382791eefa4881fc0b328c77d58a..3def6b7919484c330bc1c4aea1a8e2c6ad21f999 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java @@ -278,7 +278,7 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -165,10 +152,10 @@ index 5bcb9a53ebebeef4bd6ec2458df4b63002ebd804..2f398750bfee5758ad8b1367b6fc1436 } } diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index c9a38f6b91ac538aea4c4a6f23d18415585a931b..bec1f62559b42acee6c955baf7851aecb9179e16 100644 +index e079e8f4078078d737a9d554dbcd2568b1a1f9eb..1d958323eccd4cf5e369e99e32d2f1dec0959591 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -965,18 +965,24 @@ public class CraftEventFactory { +@@ -966,18 +966,24 @@ public class CraftEventFactory { } public static EntityDeathEvent callEntityDeathEvent(net.minecraft.world.entity.LivingEntity victim, DamageSource damageSource) { @@ -197,7 +184,7 @@ index c9a38f6b91ac538aea4c4a6f23d18415585a931b..bec1f62559b42acee6c955baf7851aec populateFields(victim, event); // Paper - make cancellable CraftWorld world = (CraftWorld) entity.getWorld(); Bukkit.getServer().getPluginManager().callEvent(event); -@@ -990,20 +996,24 @@ public class CraftEventFactory { +@@ -991,20 +997,24 @@ public class CraftEventFactory { victim.expToDrop = event.getDroppedExp(); lootCheck.run(); // Paper - advancement triggers before destroying items @@ -238,8 +225,8 @@ index c9a38f6b91ac538aea4c4a6f23d18415585a931b..bec1f62559b42acee6c955baf7851aec + // Paper end - Restore vanilla drops behavior if (stack == null || stack.getType() == Material.AIR) continue; -- world.dropItem(entity.getLocation(), stack); -+ drop.runConsumer(world, entity.getLocation()); // Paper - Restore vanilla drops behavior +- victim.drop(CraftItemStack.asNMSCopy(stack), true, false, false); // SPIGOT-7800, SPIGOT-7801: Vanilla Behaviour for dropped items ++ drop.runConsumer(entity.getWorld(), entity.getLocation()); // Paper - Restore vanilla drops behavior } return event; diff --git a/patches/server/0922-Fix-NPE-on-null-loc-for-EntityTeleportEvent.patch b/patches/server/0922-Fix-NPE-on-null-loc-for-EntityTeleportEvent.patch index 4c7c476e6d..72b2cc189a 100644 --- a/patches/server/0922-Fix-NPE-on-null-loc-for-EntityTeleportEvent.patch +++ b/patches/server/0922-Fix-NPE-on-null-loc-for-EntityTeleportEvent.patch @@ -26,10 +26,10 @@ index a306b30af19277386a2f3e560b4902a8b5796f2a..54851f6cc0d5fddb32a9a1e84a4f5ae4 x = to.getX(); y = to.getY(); diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 3e58fa4160fd4e4e5b5d00ba8f963b1b74be2663..a7eec0a1f053d0f4b68604c48aba95420049cfdd 100644 +index 3def6b7919484c330bc1c4aea1a8e2c6ad21f999..ff16c7196b146388c526e3100e561be771ca8a91 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -4200,7 +4200,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -4229,7 +4229,7 @@ public abstract class LivingEntity extends Entity implements Attackable { if (!(this instanceof ServerPlayer)) { EntityTeleportEvent teleport = new EntityTeleportEvent(this.getBukkitEntity(), new Location(this.level().getWorld(), d3, d4, d5), new Location(this.level().getWorld(), d0, d6, d2)); this.level().getCraftServer().getPluginManager().callEvent(teleport); diff --git a/patches/server/0923-Add-experience-points-API.patch b/patches/server/0923-Add-experience-points-API.patch index 9b9a45f7be..e4e988cec2 100644 --- a/patches/server/0923-Add-experience-points-API.patch +++ b/patches/server/0923-Add-experience-points-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add experience points API diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java -index 98b3547b970e30e9cc009ef1fac9202590692d84..bef9c905d884fec70f6faecff4d73c5484a412f5 100644 +index 950ce40d268d89ff3c503116081db6c9ccd65329..454b29d8c9e42e328933aa578f49d28f1e77898a 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java -@@ -1866,7 +1866,7 @@ public abstract class Player extends LivingEntity { +@@ -1869,7 +1869,7 @@ public abstract class Player extends LivingEntity { } public int getXpNeededForNextLevel() { @@ -18,10 +18,10 @@ index 98b3547b970e30e9cc009ef1fac9202590692d84..bef9c905d884fec70f6faecff4d73c54 // 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 c24f27206dea30b99f2c5b80d8e011b7bc2233e8..4a886f11b10395143879e1c1795afc269eed109d 100644 +index cb2cda2cb472b6ca0dd9b4fd1aea74ec3d215bbf..3a1777539f378f1e41bbd6b972c12a726afe5feb 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1920,6 +1920,49 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1921,6 +1921,49 @@ public class CraftPlayer extends CraftHumanEntity implements Player { Preconditions.checkArgument(exp >= 0, "Total experience points must not be negative (%s)", exp); this.getHandle().totalExperience = exp; } diff --git a/patches/server/0924-Add-drops-to-shear-events.patch b/patches/server/0924-Add-drops-to-shear-events.patch index 31dda33340..9a344bf8ac 100644 --- a/patches/server/0924-Add-drops-to-shear-events.patch +++ b/patches/server/0924-Add-drops-to-shear-events.patch @@ -233,33 +233,75 @@ index 2de1a2f666da9db1832907e1651dbff948e37252..5c2ed3c39c8eb850f3be1e2ea5b5a7ea } diff --git a/src/main/java/net/minecraft/world/entity/monster/Bogged.java b/src/main/java/net/minecraft/world/entity/monster/Bogged.java -index 8420d75865b86e1d8afea2527b5521cac184e8b1..6e290d67b00c88ecd2cf2ce5f612f52ebda9e280 100644 +index dc6230458e09f7555eee7f6a567ff60ad454666b..9d50b9ac8084f3db1844cc7ad1ce9153614ff9d9 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Bogged.java +++ b/src/main/java/net/minecraft/world/entity/monster/Bogged.java -@@ -135,6 +135,15 @@ public class Bogged extends AbstractSkeleton implements Shearable { +@@ -80,12 +80,19 @@ public class Bogged extends AbstractSkeleton implements Shearable { + + if (itemstack.is(Items.SHEARS) && this.readyForShearing()) { + // CraftBukkit start +- if (!org.bukkit.craftbukkit.event.CraftEventFactory.handlePlayerShearEntityEvent(player, this, itemstack, hand)) { +- this.getEntityData().markDirty(Bogged.DATA_SHEARED); // CraftBukkit - mark dirty to restore sheared state to clients +- return InteractionResult.PASS; ++ // Paper start - expose drops in event ++ java.util.List<net.minecraft.world.item.ItemStack> drops = generateDefaultDrops(); ++ final org.bukkit.event.player.PlayerShearEntityEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.handlePlayerShearEntityEvent(player, this, itemstack, hand, drops); ++ if (event != null) { ++ if (event.isCancelled()) { ++ if (player instanceof final net.minecraft.server.level.ServerPlayer serverPlayer) this.resendPossiblyDesyncedDataValues(java.util.List.of(Bogged.DATA_SHEARED), serverPlayer); ++ return InteractionResult.PASS; ++ } ++ drops = org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(event.getDrops()); ++ // Paper end - expose drops in event + } + // CraftBukkit end +- this.shear(SoundSource.PLAYERS); ++ this.shear(SoundSource.PLAYERS, drops); // Paper - expose drops in event + this.gameEvent(GameEvent.SHEAR, player); + if (!this.level().isClientSide) { + itemstack.hurtAndBreak(1, player, getSlotForHand(hand)); +@@ -140,12 +147,31 @@ public class Bogged extends AbstractSkeleton implements Shearable { + + @Override + public void shear(SoundSource shearedSoundCategory) { ++ // Paper start - shear drop API ++ this.shear(shearedSoundCategory, generateDefaultDrops()); ++ } ++ ++ @Override ++ public void shear(SoundSource shearedSoundCategory, java.util.List<net.minecraft.world.item.ItemStack> drops) { ++ // Paper end - shear drop API + this.level().playSound((Player) null, (Entity) this, SoundEvents.BOGGED_SHEAR, shearedSoundCategory, 1.0F, 1.0F); +- this.spawnShearedMushrooms(); ++ this.spawnDrops(drops); // Paper - shear drop API + this.setSheared(true); } private void spawnShearedMushrooms() { -+ // Paper start - shear drops API -+ this.generateShearedMushrooms(stack -> { ++ // Paper start - shear drops API ++ this.spawnDrops(generateDefaultDrops()); // Only here for people calling spawnSheardMushrooms. Not used otherwise. ++ } ++ private void spawnDrops(java.util.List<net.minecraft.world.item.ItemStack> drops) { ++ drops.forEach(stack -> { + this.forceDrops = true; + this.spawnAtLocation(stack, this.getBbHeight()); + this.forceDrops = false; + }); + } + private void generateShearedMushrooms(java.util.function.Consumer<ItemStack> stackConsumer) { -+ // Paper end - shear drops API - if (this.level() instanceof ServerLevel serverLevel) { - LootTable lootTable = serverLevel.getServer().reloadableRegistries().getLootTable(BuiltInLootTables.BOGGED_SHEAR); - LootParams lootParams = new LootParams.Builder(serverLevel) -@@ -143,11 +152,20 @@ public class Bogged extends AbstractSkeleton implements Shearable { - .create(LootContextParamSets.SHEARING); ++ // Paper end - shear drops API + Level world = this.level(); + + if (world instanceof ServerLevel worldserver) { +@@ -156,12 +182,21 @@ public class Bogged extends AbstractSkeleton implements Shearable { + while (objectlistiterator.hasNext()) { + ItemStack itemstack = (ItemStack) objectlistiterator.next(); - for (ItemStack itemStack : lootTable.getRandomItems(lootParams)) { -- this.spawnAtLocation(itemStack, this.getBbHeight()); -+ stackConsumer.accept(itemStack); // Paper +- this.spawnAtLocation(itemstack, this.getBbHeight()); ++ stackConsumer.accept(itemstack); // Paper } } + } + // Paper start - shear drops API @@ -275,10 +317,10 @@ index 8420d75865b86e1d8afea2527b5521cac184e8b1..6e290d67b00c88ecd2cf2ce5f612f52e public boolean readyForShearing() { return !this.isSheared() && this.isAlive(); diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index bec1f62559b42acee6c955baf7851aecb9179e16..1af662ca881d656b17697fce837f659349241234 100644 +index 1d958323eccd4cf5e369e99e32d2f1dec0959591..56869e0d001d984c6b73f5a92c60508e2366eb61 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -1669,20 +1669,20 @@ public class CraftEventFactory { +@@ -1673,20 +1673,20 @@ public class CraftEventFactory { player.level().getCraftServer().getPluginManager().callEvent(event); } diff --git a/patches/server/0925-Add-PlayerShieldDisableEvent.patch b/patches/server/0925-Add-PlayerShieldDisableEvent.patch index 4a3d927625..5bbd9b6ff6 100644 --- a/patches/server/0925-Add-PlayerShieldDisableEvent.patch +++ b/patches/server/0925-Add-PlayerShieldDisableEvent.patch @@ -16,10 +16,10 @@ sideeffects, meaning the disable event cannot share a handlerlist with the cooldown event diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java -index bef9c905d884fec70f6faecff4d73c5484a412f5..e27fd3a1eb1a128613e328910f09f290007f48d5 100644 +index 454b29d8c9e42e328933aa578f49d28f1e77898a..d0b51d96d6795b5fa03bc195b90324680545b752 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java -@@ -1004,7 +1004,7 @@ public abstract class Player extends LivingEntity { +@@ -1005,7 +1005,7 @@ public abstract class Player extends LivingEntity { protected void blockUsingShield(LivingEntity attacker) { super.blockUsingShield(attacker); if (attacker.canDisableShield()) { @@ -28,7 +28,7 @@ index bef9c905d884fec70f6faecff4d73c5484a412f5..e27fd3a1eb1a128613e328910f09f290 } } -@@ -1495,8 +1495,21 @@ public abstract class Player extends LivingEntity { +@@ -1498,8 +1498,21 @@ public abstract class Player extends LivingEntity { this.attack(target); } diff --git a/patches/server/0926-Validate-ResourceLocation-in-NBT-reading.patch b/patches/server/0926-Validate-ResourceLocation-in-NBT-reading.patch index 58ef6fe154..5531d9ffc8 100644 --- a/patches/server/0926-Validate-ResourceLocation-in-NBT-reading.patch +++ b/patches/server/0926-Validate-ResourceLocation-in-NBT-reading.patch @@ -66,10 +66,10 @@ index b98f9246b60daf31460f41ce214dfa7c011f5684..842b0cec0397d7ae5166617627340ffa @Nullable diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index a7eec0a1f053d0f4b68604c48aba95420049cfdd..09336e1e21b7bbed7d9730967d5a799c9029332e 100644 +index ff16c7196b146388c526e3100e561be771ca8a91..cbf076c5fa69d32ad3c8ea759cd9d405b60f8663 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -886,11 +886,13 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -887,11 +887,13 @@ public abstract class LivingEntity extends Entity implements Attackable { if (nbt.contains("SleepingX", 99) && nbt.contains("SleepingY", 99) && nbt.contains("SleepingZ", 99)) { BlockPos blockposition = new BlockPos(nbt.getInt("SleepingX"), nbt.getInt("SleepingY"), nbt.getInt("SleepingZ")); diff --git a/patches/server/0928-Fixup-NamespacedKey-handling.patch b/patches/server/0928-Fixup-NamespacedKey-handling.patch index 42c433ad7f..2861dc5138 100644 --- a/patches/server/0928-Fixup-NamespacedKey-handling.patch +++ b/patches/server/0928-Fixup-NamespacedKey-handling.patch @@ -85,10 +85,10 @@ index cc97638e038ea64ad180ebfded2528aa07d1809e..10e4318782107644f67818109784fff6 // Now also convert from when keys where saved return CraftRegistry.get(Registry.ATTRIBUTE, key, ApiVersion.CURRENT); diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBanner.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBanner.java -index 65a9213ce8197d50a58f94edfd60c25c2be848be..28d8fd2e3eb87e989621ffa6b0e5005bd181391c 100644 +index afed8bdb9bd6a135e9b5f7bd9bfc61964cb240f7..26088d4039599e7bd1ad8017d845e7b1c15be9e1 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBanner.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBanner.java -@@ -36,7 +36,11 @@ public class CraftBanner extends CraftBlockEntityState<BannerBlockEntity> implem +@@ -38,7 +38,11 @@ public class CraftBanner extends CraftBlockEntityState<BannerBlockEntity> implem if (banner.getPatterns() != null) { for (int i = 0; i < banner.getPatterns().layers().size(); i++) { BannerPatternLayers.Layer p = banner.getPatterns().layers().get(i); diff --git a/patches/server/0933-Add-api-for-spawn-egg-texture-colors.patch b/patches/server/0933-Add-api-for-spawn-egg-texture-colors.patch index 2462562bb0..0652b1399e 100644 --- a/patches/server/0933-Add-api-for-spawn-egg-texture-colors.patch +++ b/patches/server/0933-Add-api-for-spawn-egg-texture-colors.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add api for spawn egg texture colors diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 17caf21e23aa7f5a5216923e73aae94a59bcac44..3e74e449e5674be3a84168d24f58b108ac334513 100644 +index 278ef7b7cd2cf95dcf38fb4cadfd2acfcc9c4dc5..be009fe105a4fff86d592ebc8df75650aff74a29 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -654,6 +654,15 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -648,6 +648,15 @@ public final class CraftMagicNumbers implements UnsafeValues { return CraftRegistry.get(registry, namespacedKey, ApiVersion.CURRENT); } diff --git a/patches/server/0934-Add-Lifecycle-Event-system.patch b/patches/server/0934-Add-Lifecycle-Event-system.patch index 1b988c3e25..6c4f2f8644 100644 --- a/patches/server/0934-Add-Lifecycle-Event-system.patch +++ b/patches/server/0934-Add-Lifecycle-Event-system.patch @@ -751,10 +751,10 @@ index d96399e9bf1a58db5a4a22e58abb99e7660e0694..66bdac50130f523f9dc4379b103b7a46 + // Paper end - lifecycle events } diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 3e74e449e5674be3a84168d24f58b108ac334513..dabda356cdd4928c306feaace5bf03924b310613 100644 +index be009fe105a4fff86d592ebc8df75650aff74a29..d329da33f9bfea5e30e42cd30974b7d3b775f446 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -663,6 +663,13 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -657,6 +657,13 @@ public final class CraftMagicNumbers implements UnsafeValues { } // Paper end - spawn egg color visibility diff --git a/patches/server/0935-ItemStack-Tooltip-API.patch b/patches/server/0935-ItemStack-Tooltip-API.patch index 6b01a6f311..16bb22ce78 100644 --- a/patches/server/0935-ItemStack-Tooltip-API.patch +++ b/patches/server/0935-ItemStack-Tooltip-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] ItemStack Tooltip API diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index dabda356cdd4928c306feaace5bf03924b310613..be56e7a7607d3119e560f38e800ad4bbfe1e7714 100644 +index d329da33f9bfea5e30e42cd30974b7d3b775f446..fa60f4e05e3303a7fe4faab0098c1fb439a24354 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -639,6 +639,21 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -633,6 +633,21 @@ public final class CraftMagicNumbers implements UnsafeValues { } // Paper end - fix custom stats criteria creation diff --git a/patches/server/0962-Fix-shield-disable-inconsistency.patch b/patches/server/0962-Fix-shield-disable-inconsistency.patch index 69826053ae..25f666c8ec 100644 --- a/patches/server/0962-Fix-shield-disable-inconsistency.patch +++ b/patches/server/0962-Fix-shield-disable-inconsistency.patch @@ -8,10 +8,10 @@ it will not disable the shield if the attacker is holding an axe item. diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 09336e1e21b7bbed7d9730967d5a799c9029332e..fd6b21f7a196e1232c0bb03335bd78417f55c5bb 100644 +index cbf076c5fa69d32ad3c8ea759cd9d405b60f8663..8072d31525d9c7890804bb879893f1a69820e32d 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -2325,7 +2325,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -2349,7 +2349,7 @@ public abstract class LivingEntity extends Entity implements Attackable { this.hurtCurrentlyUsedShield((float) -event.getDamage(DamageModifier.BLOCKING)); Entity entity = damagesource.getDirectEntity(); diff --git a/patches/server/0967-Fix-helmet-damage-reduction-inconsistencies.patch b/patches/server/0967-Fix-helmet-damage-reduction-inconsistencies.patch index bbce375f3f..68b0416c32 100644 --- a/patches/server/0967-Fix-helmet-damage-reduction-inconsistencies.patch +++ b/patches/server/0967-Fix-helmet-damage-reduction-inconsistencies.patch @@ -7,13 +7,13 @@ Affect the falling stalactite damage type where the reduction is not applied like in Vanilla diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 37bd0b7a1bfb9d59efa803e453f39d4e3fc916a4..bd6fee3e3ad9116802ff8bb57bfa741b881c4057 100644 +index e9a5f06c405fb81609205b6b96cb0a7e49d5589c..9c7cd9387f90d061aec76f7f0451a1da8b42ea3d 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -1215,7 +1215,7 @@ public class CraftEventFactory { - Map<DamageModifier, Function<? super Double, Double>> modifierFunctions = new EnumMap<>(DamageModifier.class); - modifiers.put(DamageModifier.BASE, rawDamage); - modifierFunctions.put(DamageModifier.BASE, CraftEventFactory.ZERO); +@@ -1219,7 +1219,7 @@ public class CraftEventFactory { + modifiers.put(DamageModifier.FREEZING, freezingModifier); + modifierFunctions.put(DamageModifier.FREEZING, freezing); + } - if (source.is(DamageTypes.FALLING_BLOCK) || source.is(DamageTypes.FALLING_ANVIL)) { + if (source.is(DamageTypeTags.DAMAGES_HELMET)) { // Paper modifiers.put(DamageModifier.HARD_HAT, hardHatModifier); diff --git a/patches/server/0968-Revert-to-vanilla-handling-of-LivingEntity-actuallyH.patch b/patches/server/0968-Revert-to-vanilla-handling-of-LivingEntity-actuallyH.patch index 58c69c8939..cecfa52277 100644 --- a/patches/server/0968-Revert-to-vanilla-handling-of-LivingEntity-actuallyH.patch +++ b/patches/server/0968-Revert-to-vanilla-handling-of-LivingEntity-actuallyH.patch @@ -5,19 +5,26 @@ Subject: [PATCH] Revert to vanilla handling of LivingEntity#actuallyHurt diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index fd6b21f7a196e1232c0bb03335bd78417f55c5bb..66707853328b6b23771c88abd0cf5a7ef766bb71 100644 +index 8072d31525d9c7890804bb879893f1a69820e32d..c54cb799730353ba1d44c110c85455eb1da6b1d1 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -2210,7 +2210,7 @@ public abstract class LivingEntity extends Entity implements Attackable { - } - - // CraftBukkit start -- protected boolean actuallyHurt(final DamageSource damagesource, float f) { // void -> boolean, add final -+ protected boolean actuallyHurt(final DamageSource damagesource, float f) { // void -> boolean, add final // Paper - return false ONLY if event cancelled - if (!this.isInvulnerableTo(damagesource)) { - final boolean human = this instanceof net.minecraft.world.entity.player.Player; - float originalDamage = f; -@@ -2382,12 +2382,12 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -1479,6 +1479,7 @@ public abstract class LivingEntity extends Entity implements Attackable { + if (!this.actuallyHurt(source, (float) event.getFinalDamage() - this.lastHurt, event)) { + return false; + } ++ if (this instanceof ServerPlayer && event.getDamage() == 0) return false; // Paper - revert to vanilla damage - players are not affected by damage that is 0 - use raw damage here, as it is just the original amount but post plugin changes to it. + // CraftBukkit end + this.lastHurt = amount; + flag1 = false; +@@ -1487,6 +1488,7 @@ public abstract class LivingEntity extends Entity implements Attackable { + if (!this.actuallyHurt(source, (float) event.getFinalDamage(), event)) { + return false; + } ++ if (this instanceof ServerPlayer && event.getDamage() == 0) return false; // Paper - revert to vanilla damage - players are not affected by damage that is 0 - use raw damage here, as it is just the original amount but post plugin changes to it. + this.lastHurt = amount; + this.invulnerableTime = this.invulnerableDuration; // CraftBukkit - restore use of maxNoDamageTicks + // this.actuallyHurt(damagesource, f); +@@ -2411,12 +2413,12 @@ public abstract class LivingEntity extends Entity implements Attackable { return true; } else { diff --git a/patches/server/0969-improve-checking-handled-tags-in-itemmeta.patch b/patches/server/0969-improve-checking-handled-tags-in-itemmeta.patch index ac06baf9f0..42263a75de 100644 --- a/patches/server/0969-improve-checking-handled-tags-in-itemmeta.patch +++ b/patches/server/0969-improve-checking-handled-tags-in-itemmeta.patch @@ -211,7 +211,7 @@ index ef56ebc8060da1d416d91299b03ff0a8f6901ac1..7672128ecca3052f2dc422349a863484 static Material getType(net.minecraft.world.item.ItemStack item) { diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemType.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemType.java -index 431910368e6d5487456e8430ad7b027d19429b58..9d2feff3df87cfeefe7105d954854af05cef6f69 100644 +index a1f2b9d40d374e8cdbaf916b25fa74b6c0970f81..d03f4a767f6c7fe7d6bcef20e6676c39d9657584 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemType.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemType.java @@ -114,8 +114,8 @@ public class CraftItemType<M extends ItemMeta> implements ItemType.Typed<M>, Han @@ -301,7 +301,7 @@ index 4faada5f974214f3054dc1bec9c79e2600c8df48..d7e5491cc0296563fb9fdf28d64b21a1 getOrEmpty(tag, CraftMetaBlockState.BLOCK_ENTITY_TAG).ifPresent((nbt) -> { diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java -index 4da38ebb7fdbdb0f8fa422ebcd2e3eec2b2be846..a395c7ce952f4a60a5edf80e8731afa6388d18ea 100644 +index 552ebe67f87b48734adf0da8ef78dcac9dd670a2..e064af399dcae40b4f35aa993d356b1462f91d6c 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java @@ -64,8 +64,8 @@ public class CraftMetaBook extends CraftMetaItem implements BookMeta, WritableBo @@ -316,7 +316,7 @@ index 4da38ebb7fdbdb0f8fa422ebcd2e3eec2b2be846..a395c7ce952f4a60a5edf80e8731afa6 getOrEmpty(tag, CraftMetaBook.BOOK_CONTENT).ifPresent((writable) -> { List<Filterable<String>> pages = writable.pages(); diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBookSigned.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBookSigned.java -index c7360e2b2d6e50abc371c21b09cdadd63892f439..3f78a0935d738854182254b345064e3c225dcd5f 100644 +index 162997fc80dfe2df1f13c802c1b610f04cb9d05a..806c1cbee7c4e23eee38c8f400ec2d924c9a360c 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBookSigned.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBookSigned.java @@ -78,8 +78,8 @@ public class CraftMetaBookSigned extends CraftMetaItem implements BookMeta { @@ -436,7 +436,7 @@ index 3ff0340c40e9dc9a6e690de15ccade7a0c4e8f02..3f6c5cbbf63631e4b72dc43558651ea9 getOrEmpty(tag, CraftMetaEntityTag.ENTITY_TAG).ifPresent((nbt) -> { this.entityTag = nbt.copyTag(); diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaFirework.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaFirework.java -index f2cecd01f7f214a023e1bdeecc14359f696fb9d4..97b7085250d749c5e46352b372068b51de89bc7f 100644 +index 8c1d2d0521da52f9a1262f5433da21700b9b0454..9600b23666668d7d581e2920a4e03e59cc2339fb 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaFirework.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaFirework.java @@ -59,8 +59,8 @@ class CraftMetaFirework extends CraftMetaItem implements FireworkMeta { @@ -451,7 +451,7 @@ index f2cecd01f7f214a023e1bdeecc14359f696fb9d4..97b7085250d749c5e46352b372068b51 getOrEmpty(tag, CraftMetaFirework.FIREWORKS).ifPresent((fireworks) -> { this.power = fireworks.flightDuration(); diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -index 044713d5b2661405200590914f73b07e73aeb48f..58da8cb19a8444c634cbc1f39e93503ca8e2ecab 100644 +index d29b8c6851aad227eb8f12012903e0ddd5531755..58da8cb19a8444c634cbc1f39e93503ca8e2ecab 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java @@ -346,7 +346,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -484,7 +484,7 @@ index 044713d5b2661405200590914f73b07e73aeb48f..58da8cb19a8444c634cbc1f39e93503c // Paper end - don't lose unhandled tags key.getValue().ifPresent((value) -> { this.unhandledTags.set((DataComponentType) key.getKey(), value); -@@ -2047,68 +2054,75 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -2047,67 +2054,75 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { this.version = version; } @@ -533,7 +533,6 @@ index 044713d5b2661405200590914f73b07e73aeb48f..58da8cb19a8444c634cbc1f39e93503c - CraftMetaFirework.FIREWORKS.TYPE, - CraftMetaEnchantedBook.STORED_ENCHANTMENTS.TYPE, - CraftMetaCharge.EXPLOSION.TYPE, -- CraftMetaBlockState.BLOCK_ENTITY_TAG.TYPE, - CraftMetaKnowledgeBook.BOOK_RECIPES.TYPE, - CraftMetaTropicalFishBucket.ENTITY_TAG.TYPE, - CraftMetaTropicalFishBucket.BUCKET_ENTITY_TAG.TYPE, diff --git a/patches/server/0970-General-ItemMeta-fixes.patch b/patches/server/0970-General-ItemMeta-fixes.patch index 1f0a2364a7..cc18be8924 100644 --- a/patches/server/0970-General-ItemMeta-fixes.patch +++ b/patches/server/0970-General-ItemMeta-fixes.patch @@ -445,7 +445,7 @@ index d7e5491cc0296563fb9fdf28d64b21a10c08ea4a..224ea52574b80bb087c5c62eaf1d4626 private static Material shieldToBannerHack() { diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java -index a395c7ce952f4a60a5edf80e8731afa6388d18ea..e213ac74f8f4a62b7b8b2b7889250f5cdeb348fe 100644 +index e064af399dcae40b4f35aa993d356b1462f91d6c..27a275f324891e395bf3fd3038c0b9a724bbbf66 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java @@ -34,7 +34,7 @@ public class CraftMetaBook extends CraftMetaItem implements BookMeta, WritableBo @@ -457,45 +457,6 @@ index a395c7ce952f4a60a5edf80e8731afa6388d18ea..e213ac74f8f4a62b7b8b2b7889250f5c static final int MAX_PAGE_LENGTH = WritableBookContent.PAGE_EDIT_LENGTH; // SPIGOT-6911: Use Minecraft limits // We store the pages in their raw original text representation. See SPIGOT-5063, SPIGOT-5350, SPIGOT-3206 -diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBookSigned.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBookSigned.java -index 3f78a0935d738854182254b345064e3c225dcd5f..218df87c596d47b431dbbf2aa42822ef174f948f 100644 ---- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBookSigned.java -+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBookSigned.java -@@ -116,8 +116,8 @@ public class CraftMetaBookSigned extends CraftMetaItem implements BookMeta { - } - } - -- this.resolved = SerializableMeta.getObject(Boolean.class, map, CraftMetaBookSigned.RESOLVED.BUKKIT, true); -- this.generation = SerializableMeta.getObject(Integer.class, map, CraftMetaBookSigned.GENERATION.BUKKIT, true); -+ this.resolved = SerializableMeta.getBoolean(map, CraftMetaBookSigned.RESOLVED.BUKKIT); // Paper - General ItemMeta fixes -+ this.generation = SerializableMeta.getObjectOptionally(Integer.class, map, CraftMetaBookSigned.GENERATION.BUKKIT, true).orElse(0); // Paper - General ItemMeta Fixes - } - - @Override -@@ -129,7 +129,7 @@ public class CraftMetaBookSigned extends CraftMetaItem implements BookMeta { - for (Component page : this.pages) { - list.add(Filterable.passThrough(page)); - } -- itemData.put(CraftMetaBookSigned.BOOK_CONTENT, new WrittenBookContent(Filterable.from(FilteredText.passThrough(this.title)), this.author, this.generation, list, this.resolved)); -+ itemData.put(CraftMetaBookSigned.BOOK_CONTENT, new WrittenBookContent(Filterable.from(FilteredText.passThrough(this.title == null ? "" : this.title)), this.author == null ? "" : this.author, this.generation, list, this.resolved)); - } - } - -@@ -358,7 +358,13 @@ public class CraftMetaBookSigned extends CraftMetaItem implements BookMeta { - } - - if (this.pages != null) { -- builder.put(CraftMetaBookSigned.BOOK_PAGES.BUKKIT, ImmutableList.copyOf(this.pages)); -+ // Paper start - deserialization expects json -+ final List<String> jsonPages = new ArrayList<>(this.pages.size()); -+ for (final Component page : this.pages) { -+ jsonPages.add(CraftChatMessage.toJSON(page)); -+ } -+ builder.put(CraftMetaBookSigned.BOOK_PAGES.BUKKIT, ImmutableList.copyOf(jsonPages)); -+ // Paper end - deserialization expects json - } - - if (this.resolved) { diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBundle.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBundle.java index 2736a87a6c481da0575e6e29ea08faa539c24378..51da0db4da3549efd69f367e28450408968fa8d0 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBundle.java @@ -671,7 +632,7 @@ index 3f6c5cbbf63631e4b72dc43558651ea94f31ca78..da474a5b963d8e6769d120e9091e60ed return true; } diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaFirework.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaFirework.java -index 97b7085250d749c5e46352b372068b51de89bc7f..7277e7ee566aabf6e01937072d949ed67c3e8e38 100644 +index 9600b23666668d7d581e2920a4e03e59cc2339fb..0eceacbb096481d3bd31f5f99e964c88aea2e3fb 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaFirework.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaFirework.java @@ -54,7 +54,7 @@ class CraftMetaFirework extends CraftMetaItem implements FireworkMeta { @@ -740,23 +701,7 @@ index 97b7085250d749c5e46352b372068b51de89bc7f..7277e7ee566aabf6e01937072d949ed6 effects.add((FireworkEffect) obj); } } -@@ -185,9 +189,13 @@ class CraftMetaFirework extends CraftMetaItem implements FireworkMeta { - } - - List<FireworkExplosion> effects = new ArrayList<>(); -- for (FireworkEffect effect : this.effects) { -- effects.add(CraftMetaFirework.getExplosion(effect)); -+ // Paper start - fix NPE with effects list being null -+ if (this.effects != null) { -+ for (FireworkEffect effect : this.effects) { -+ effects.add(CraftMetaFirework.getExplosion(effect)); -+ } - } -+ // Paper end - - itemTag.put(CraftMetaFirework.FIREWORKS, new Fireworks(this.power, effects)); - } -@@ -212,7 +220,7 @@ class CraftMetaFirework extends CraftMetaItem implements FireworkMeta { +@@ -214,7 +218,7 @@ class CraftMetaFirework extends CraftMetaItem implements FireworkMeta { } boolean isFireworkEmpty() { @@ -765,7 +710,7 @@ index 97b7085250d749c5e46352b372068b51de89bc7f..7277e7ee566aabf6e01937072d949ed6 } boolean hasPower() { -@@ -228,7 +236,7 @@ class CraftMetaFirework extends CraftMetaItem implements FireworkMeta { +@@ -230,7 +234,7 @@ class CraftMetaFirework extends CraftMetaItem implements FireworkMeta { if (meta instanceof CraftMetaFirework that) { return (this.hasPower() ? that.hasPower() && this.power == that.power : !that.hasPower()) @@ -774,7 +719,7 @@ index 97b7085250d749c5e46352b372068b51de89bc7f..7277e7ee566aabf6e01937072d949ed6 } return true; -@@ -246,7 +254,7 @@ class CraftMetaFirework extends CraftMetaItem implements FireworkMeta { +@@ -248,7 +252,7 @@ class CraftMetaFirework extends CraftMetaItem implements FireworkMeta { if (this.hasPower()) { hash = 61 * hash + this.power; } @@ -783,7 +728,7 @@ index 97b7085250d749c5e46352b372068b51de89bc7f..7277e7ee566aabf6e01937072d949ed6 hash = 61 * hash + 13 * this.effects.hashCode(); } return hash != original ? CraftMetaFirework.class.hashCode() ^ hash : hash; -@@ -256,7 +264,7 @@ class CraftMetaFirework extends CraftMetaItem implements FireworkMeta { +@@ -258,7 +262,7 @@ class CraftMetaFirework extends CraftMetaItem implements FireworkMeta { Builder<String, Object> serialize(Builder<String, Object> builder) { super.serialize(builder); @@ -792,7 +737,7 @@ index 97b7085250d749c5e46352b372068b51de89bc7f..7277e7ee566aabf6e01937072d949ed6 builder.put(CraftMetaFirework.EXPLOSIONS.BUKKIT, ImmutableList.copyOf(this.effects)); } -@@ -281,6 +289,7 @@ class CraftMetaFirework extends CraftMetaItem implements FireworkMeta { +@@ -283,6 +287,7 @@ class CraftMetaFirework extends CraftMetaItem implements FireworkMeta { @Override public void addEffect(FireworkEffect effect) { Preconditions.checkArgument(effect != null, "FireworkEffect cannot be null"); @@ -800,7 +745,7 @@ index 97b7085250d749c5e46352b372068b51de89bc7f..7277e7ee566aabf6e01937072d949ed6 if (this.effects == null) { this.effects = new ArrayList<FireworkEffect>(); } -@@ -290,6 +299,10 @@ class CraftMetaFirework extends CraftMetaItem implements FireworkMeta { +@@ -292,6 +297,10 @@ class CraftMetaFirework extends CraftMetaItem implements FireworkMeta { @Override public void addEffects(FireworkEffect... effects) { Preconditions.checkArgument(effects != null, "effects cannot be null"); @@ -811,7 +756,7 @@ index 97b7085250d749c5e46352b372068b51de89bc7f..7277e7ee566aabf6e01937072d949ed6 if (effects.length == 0) { return; } -@@ -308,7 +321,7 @@ class CraftMetaFirework extends CraftMetaItem implements FireworkMeta { +@@ -310,7 +319,7 @@ class CraftMetaFirework extends CraftMetaItem implements FireworkMeta { @Override public void addEffects(Iterable<FireworkEffect> effects) { Preconditions.checkArgument(effects != null, "effects cannot be null"); @@ -820,7 +765,7 @@ index 97b7085250d749c5e46352b372068b51de89bc7f..7277e7ee566aabf6e01937072d949ed6 } @Override -@@ -343,7 +356,7 @@ class CraftMetaFirework extends CraftMetaItem implements FireworkMeta { +@@ -345,7 +354,7 @@ class CraftMetaFirework extends CraftMetaItem implements FireworkMeta { @Override public void setPower(int power) { Preconditions.checkArgument(power >= 0, "power cannot be less than zero: %s", power); @@ -1473,10 +1418,10 @@ index 17705059b81942e4df43a4a5180092e09c985ade..80e6b85a107d5236edba99540cb5074e } diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/SerializableMeta.java b/src/main/java/org/bukkit/craftbukkit/inventory/SerializableMeta.java -index 8b407a33b04af6ae396ada0b8aca7dc246d314ef..d204845cf0b9de00589593469755cb8e42e0aa67 100644 +index b7e93a6ec72ec3e3390fefa52fda0c2cd8e17c0c..758778650bebf7b96eefab42543e812849124b2f 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/SerializableMeta.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/SerializableMeta.java -@@ -123,4 +123,21 @@ public final class SerializableMeta implements ConfigurationSerializable { +@@ -128,4 +128,21 @@ public final class SerializableMeta implements ConfigurationSerializable { } throw new IllegalArgumentException(field + "(" + object + ") is not a valid " + clazz); } diff --git a/patches/server/0979-Prevent-sending-oversized-item-data-in-equipment-and.patch b/patches/server/0979-Prevent-sending-oversized-item-data-in-equipment-and.patch index 9e1dfe1f30..8c27be5d12 100644 --- a/patches/server/0979-Prevent-sending-oversized-item-data-in-equipment-and.patch +++ b/patches/server/0979-Prevent-sending-oversized-item-data-in-equipment-and.patch @@ -214,10 +214,10 @@ index 60c65af218d533d53b765ba2175fed163c32c126..a0f5839719ca0ce6ed048229f074041b } } diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 66707853328b6b23771c88abd0cf5a7ef766bb71..7a6c8a64bd119fd1f2fc245f84cbb332ecd937e3 100644 +index 651c965cb92a91af7b346416f9e4f2e407b3ba18..882e3b6a58951f33a71f862bfa49a5b32d8e8f98 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -3322,7 +3322,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3353,7 +3353,7 @@ public abstract class LivingEntity extends Entity implements Attackable { } }); diff --git a/patches/server/0989-Configurable-damage-tick-when-blocking-with-shield.patch b/patches/server/0989-Configurable-damage-tick-when-blocking-with-shield.patch index 8c0e7e79e6..97b65a71cb 100644 --- a/patches/server/0989-Configurable-damage-tick-when-blocking-with-shield.patch +++ b/patches/server/0989-Configurable-damage-tick-when-blocking-with-shield.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Configurable damage tick when blocking with shield diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 7a6c8a64bd119fd1f2fc245f84cbb332ecd937e3..45e5f14c3ad7cf25e11baa1554eb5fabac41ebe2 100644 +index 882e3b6a58951f33a71f862bfa49a5b32d8e8f98..4827998c3b5ad72578de1310ab1c67671c21c5a2 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -2380,7 +2380,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -2411,7 +2411,7 @@ public abstract class LivingEntity extends Entity implements Attackable { CriteriaTriggers.PLAYER_HURT_ENTITY.trigger((ServerPlayer) damagesource.getEntity(), this, damagesource, originalDamage, f, true); // Paper - fix taken/dealt param order } diff --git a/patches/server/0991-Chunk-System-Starlight-from-Moonrise.patch b/patches/server/0991-Chunk-System-Starlight-from-Moonrise.patch index 1fa4249c11..6dd4a1a9b2 100644 --- a/patches/server/0991-Chunk-System-Starlight-from-Moonrise.patch +++ b/patches/server/0991-Chunk-System-Starlight-from-Moonrise.patch @@ -26377,7 +26377,7 @@ index 4d7e234d379a451c4bb53bc2fcdf22cb191f8d1a..cf33e22ae85cd30b4f5d526dbfececca return crashreportsystemdetails; } diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 3cbb59df34156479d24a8251f2b3acbb5e60dc2c..6b9354e3ac064daa3101e71d8e54e883f628f70c 100644 +index 09e60ea5c25f23bcc7e24f16c7a31f616d249ff9..478d6e2eaa1a8fded571ff2c2c623028c3def94d 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -199,7 +199,7 @@ import org.bukkit.event.player.PlayerToggleSneakEvent; @@ -29678,10 +29678,10 @@ index 8f88ccec6b8947ca2738dc07c23aebe258145c83..cdc704364cf339084537d089e654f607 // 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 33541edc8bb2d673342448046fa29767f171bbf3..1bc343df0e7b8e6e3fadc970a4a4c8d787d93828 100644 +index 3480f06d4476c5c200246e6200e2eda2a5de1a5a..62bfde27a182be24710eb3b72448e82da58afc8f 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -3491,12 +3491,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -3492,12 +3492,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public int getViewDistance() { @@ -29698,7 +29698,7 @@ index 33541edc8bb2d673342448046fa29767f171bbf3..1bc343df0e7b8e6e3fadc970a4a4c8d7 } @Override -@@ -3506,7 +3508,9 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -3507,7 +3509,9 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public void setSimulationDistance(final int simulationDistance) { @@ -29709,7 +29709,7 @@ index 33541edc8bb2d673342448046fa29767f171bbf3..1bc343df0e7b8e6e3fadc970a4a4c8d7 } @Override -@@ -3516,6 +3520,8 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -3517,6 +3521,8 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public void setSendViewDistance(final int viewDistance) { diff --git a/patches/server/0992-Rewrite-dataconverter-system.patch b/patches/server/0992-Rewrite-dataconverter-system.patch index b03980be16..ea19e60350 100644 --- a/patches/server/0992-Rewrite-dataconverter-system.patch +++ b/patches/server/0992-Rewrite-dataconverter-system.patch @@ -29388,10 +29388,10 @@ index 1d287dd7379e56f7fd4b425880b850cd843f5789..8ab7ca373a885fbe658013c9c6a2e38d return nbttagcompound; }); diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index be56e7a7607d3119e560f38e800ad4bbfe1e7714..5a04134973dd1db7f778a57ec5f185feec370990 100644 +index fa60f4e05e3303a7fe4faab0098c1fb439a24354..ca1c0955be0d0f78972f39c4bd4afffd46c2fb45 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -522,7 +522,7 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -516,7 +516,7 @@ public final class CraftMagicNumbers implements UnsafeValues { net.minecraft.nbt.CompoundTag compound = deserializeNbtFromBytes(data); final int dataVersion = compound.getInt("DataVersion"); @@ -29400,7 +29400,7 @@ index be56e7a7607d3119e560f38e800ad4bbfe1e7714..5a04134973dd1db7f778a57ec5f185fe return CraftItemStack.asCraftMirror(net.minecraft.world.item.ItemStack.parse(MinecraftServer.getServer().registryAccess(), compound).orElseThrow()); } -@@ -543,7 +543,7 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -537,7 +537,7 @@ public final class CraftMagicNumbers implements UnsafeValues { net.minecraft.nbt.CompoundTag compound = deserializeNbtFromBytes(data); int dataVersion = compound.getInt("DataVersion"); diff --git a/patches/server/0995-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch b/patches/server/0995-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch index 198e443db0..cb921d96da 100644 --- a/patches/server/0995-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch +++ b/patches/server/0995-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch @@ -25,10 +25,10 @@ index db30381b3aeab83bcd0d1a341e4056d7c36a6f11..fc011c30628d77d55defe421db6ac194 } } diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java -index e27fd3a1eb1a128613e328910f09f290007f48d5..54ba25632c2a9e1c93a5b3a0b92e5280864c49d6 100644 +index d0b51d96d6795b5fa03bc195b90324680545b752..09bcbc0ae36e4e69fee87a7e0c49acf496117a39 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java -@@ -807,6 +807,14 @@ public abstract class Player extends LivingEntity { +@@ -808,6 +808,14 @@ public abstract class Player extends LivingEntity { return null; } // CraftBukkit end diff --git a/patches/server/0996-Strip-raytracing-for-EntityLiving-hasLineOfSight.patch b/patches/server/0996-Strip-raytracing-for-EntityLiving-hasLineOfSight.patch index 46a4939bd4..1f1ac95450 100644 --- a/patches/server/0996-Strip-raytracing-for-EntityLiving-hasLineOfSight.patch +++ b/patches/server/0996-Strip-raytracing-for-EntityLiving-hasLineOfSight.patch @@ -26,10 +26,10 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 45e5f14c3ad7cf25e11baa1554eb5fabac41ebe2..25a7dfddb44a11f6e20c459141a61270c0c12d4c 100644 +index 4827998c3b5ad72578de1310ab1c67671c21c5a2..42ff2150543108c393f108767963cde49d08efa8 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -3743,7 +3743,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3774,7 +3774,7 @@ public abstract class LivingEntity extends Entity implements Attackable { Vec3 vec3d1 = new Vec3(entity.getX(), entity.getEyeY(), entity.getZ()); // Paper - diff on change - used in CraftLivingEntity#hasLineOfSight(Location) and CraftWorld#lineOfSightExists diff --git a/patches/server/1009-Optimize-Hoppers.patch b/patches/server/1009-Optimize-Hoppers.patch index 500c718a87..7ac3c6b823 100644 --- a/patches/server/1009-Optimize-Hoppers.patch +++ b/patches/server/1009-Optimize-Hoppers.patch @@ -105,7 +105,7 @@ index cd3b952a228c09077c2e74183a34ddb32811280b..c0563260277f9f4bd9ff08993b2efb4b } diff --git a/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java -index 92086ca118d55ec49cefa5bf18977f8706e3e4b4..8310d132006043e93c612890514c4c7f3eb1c74d 100644 +index 0d6132abd49d66fbf84c046e09144cb33651be15..53f9d28bf3c6aafd4fdd6c12e0285500fe7350ce 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java @@ -156,6 +156,43 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen @@ -370,7 +370,7 @@ index 92086ca118d55ec49cefa5bf18977f8706e3e4b4..8310d132006043e93c612890514c4c7f private static boolean ejectItems(Level world, BlockPos pos, HopperBlockEntity blockEntity) { Container iinventory = HopperBlockEntity.getAttachedContainer(world, pos, blockEntity); -@@ -209,47 +443,50 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen +@@ -209,48 +443,51 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen if (HopperBlockEntity.isFullContainer(iinventory, enumdirection)) { return false; } else { @@ -380,6 +380,7 @@ index 92086ca118d55ec49cefa5bf18977f8706e3e4b4..8310d132006043e93c612890514c4c7f - if (!itemstack.isEmpty()) { - int j = itemstack.getCount(); - // CraftBukkit start - Call event when pushing items into other inventories +- ItemStack original = itemstack.copy(); - CraftItemStack oitemstack = CraftItemStack.asCraftMirror(blockEntity.removeItem(i, world.spigotConfig.hopperAmount)); // Spigot - - Inventory destinationInventory; @@ -395,7 +396,7 @@ index 92086ca118d55ec49cefa5bf18977f8706e3e4b4..8310d132006043e93c612890514c4c7f - InventoryMoveItemEvent event = new InventoryMoveItemEvent(blockEntity.getOwner().getInventory(), oitemstack, destinationInventory, true); - world.getCraftServer().getPluginManager().callEvent(event); - if (event.isCancelled()) { -- blockEntity.setItem(i, itemstack); +- blockEntity.setItem(i, original); - blockEntity.setCooldown(world.spigotConfig.hopperTransfer); // Delay hopper checks // Spigot - return false; - } @@ -423,6 +424,7 @@ index 92086ca118d55ec49cefa5bf18977f8706e3e4b4..8310d132006043e93c612890514c4c7f + // if (!itemstack.isEmpty()) { + // int j = itemstack.getCount(); + // // CraftBukkit start - Call event when pushing items into other inventories ++ // ItemStack original = itemstack.copy(); + // CraftItemStack oitemstack = CraftItemStack.asCraftMirror(blockEntity.removeItem(i, world.spigotConfig.hopperAmount)); // Spigot + + // Inventory destinationInventory; @@ -438,7 +440,7 @@ index 92086ca118d55ec49cefa5bf18977f8706e3e4b4..8310d132006043e93c612890514c4c7f + // InventoryMoveItemEvent event = new InventoryMoveItemEvent(tileentityhopper.getOwner().getInventory(), oitemstack, destinationInventory, true); + // world.getCraftServer().getPluginManager().callEvent(event); + // if (event.isCancelled()) { -+ // blockEntity.setItem(i, itemstack); ++ // blockEntity.setItem(i, original); + // blockEntity.setCooldown(world.spigotConfig.hopperTransfer); // Delay hopper checks // Spigot + // return false; + // } @@ -462,7 +464,7 @@ index 92086ca118d55ec49cefa5bf18977f8706e3e4b4..8310d132006043e93c612890514c4c7f } } } -@@ -300,7 +537,6 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen +@@ -301,7 +538,6 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen return false; } } @@ -470,7 +472,7 @@ index 92086ca118d55ec49cefa5bf18977f8706e3e4b4..8310d132006043e93c612890514c4c7f return true; } -@@ -311,6 +547,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen +@@ -312,6 +548,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen if (iinventory != null) { Direction enumdirection = Direction.DOWN; @@ -478,12 +480,13 @@ index 92086ca118d55ec49cefa5bf18977f8706e3e4b4..8310d132006043e93c612890514c4c7f int[] aint = HopperBlockEntity.getSlots(iinventory, enumdirection); int i = aint.length; -@@ -346,44 +583,47 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen +@@ -347,45 +584,48 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen ItemStack itemstack = iinventory.getItem(i); if (!itemstack.isEmpty() && HopperBlockEntity.canTakeItemFromContainer(ihopper, iinventory, itemstack, i, enumdirection)) { - int j = itemstack.getCount(); - // CraftBukkit start - Call event on collection of items from inventories into the hopper +- ItemStack original = itemstack.copy(); - CraftItemStack oitemstack = CraftItemStack.asCraftMirror(iinventory.removeItem(i, world.spigotConfig.hopperAmount)); // Spigot - - Inventory sourceInventory; @@ -500,7 +503,7 @@ index 92086ca118d55ec49cefa5bf18977f8706e3e4b4..8310d132006043e93c612890514c4c7f - - Bukkit.getServer().getPluginManager().callEvent(event); - if (event.isCancelled()) { -- iinventory.setItem(i, itemstack); +- iinventory.setItem(i, original); - - if (ihopper instanceof HopperBlockEntity) { - ((HopperBlockEntity) ihopper).setCooldown(world.spigotConfig.hopperTransfer); // Spigot @@ -524,6 +527,7 @@ index 92086ca118d55ec49cefa5bf18977f8706e3e4b4..8310d132006043e93c612890514c4c7f + return hopperPull(world, ihopper, iinventory, itemstack, i); + // int j = itemstack.getCount(); + // // CraftBukkit start - Call event on collection of items from inventories into the hopper ++ // ItemStack original = itemstack.copy(); + // CraftItemStack oitemstack = CraftItemStack.asCraftMirror(iinventory.removeItem(i, world.spigotConfig.hopperAmount)); // Spigot + + // Inventory sourceInventory; @@ -540,7 +544,7 @@ index 92086ca118d55ec49cefa5bf18977f8706e3e4b4..8310d132006043e93c612890514c4c7f + + // Bukkit.getServer().getPluginManager().callEvent(event); + // if (event.isCancelled()) { -+ // iinventory.setItem(i, itemstack); ++ // iinventory.setItem(i, original); + + // if (ihopper instanceof HopperBlockEntity) { + // ((HopperBlockEntity) ihopper).setCooldown(world.spigotConfig.hopperTransfer); // Spigot @@ -564,7 +568,7 @@ index 92086ca118d55ec49cefa5bf18977f8706e3e4b4..8310d132006043e93c612890514c4c7f } return false; -@@ -392,12 +632,14 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen +@@ -394,12 +634,14 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen public static boolean addItem(Container inventory, ItemEntity itemEntity) { boolean flag = false; // CraftBukkit start @@ -580,7 +584,7 @@ index 92086ca118d55ec49cefa5bf18977f8706e3e4b4..8310d132006043e93c612890514c4c7f ItemStack itemstack = itemEntity.getItem().copy(); ItemStack itemstack1 = HopperBlockEntity.addItem((Container) null, inventory, itemstack, (Direction) null); -@@ -491,7 +733,9 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen +@@ -493,7 +735,9 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen stack = stack.split(to.getMaxStackSize()); } // Spigot end @@ -590,7 +594,7 @@ index 92086ca118d55ec49cefa5bf18977f8706e3e4b4..8310d132006043e93c612890514c4c7f stack = leftover; // Paper - Make hoppers respect inventory max stack size flag = true; } else if (HopperBlockEntity.canMergeItems(itemstack1, stack)) { -@@ -571,14 +815,20 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen +@@ -573,14 +817,20 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen @Nullable public static Container getContainerAt(Level world, BlockPos pos) { @@ -613,7 +617,7 @@ index 92086ca118d55ec49cefa5bf18977f8706e3e4b4..8310d132006043e93c612890514c4c7f iinventory = HopperBlockEntity.getEntityContainer(world, x, y, z); } -@@ -613,13 +863,13 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen +@@ -615,13 +865,13 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen @Nullable private static Container getEntityContainer(Level world, double x, double y, double z) { diff --git a/patches/server/1018-API-for-checking-sent-chunks.patch b/patches/server/1018-API-for-checking-sent-chunks.patch index 54f091fb69..137772f487 100644 --- a/patches/server/1018-API-for-checking-sent-chunks.patch +++ b/patches/server/1018-API-for-checking-sent-chunks.patch @@ -20,10 +20,10 @@ index 82e8ce73b77accd6a4210f88c9fccb325ae367d4..91c4219b2abf1b5be3dc35f7b8403884 } } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 1bc343df0e7b8e6e3fadc970a4a4c8d787d93828..7eea190ce8a62960ecc42ff56a4ef71b754184fb 100644 +index 62bfde27a182be24710eb3b72448e82da58afc8f..d01b45a48d412e3cb591acee101730704574448a 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -3483,6 +3483,35 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -3484,6 +3484,35 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } // Paper end diff --git a/patches/server/1019-Improve-boat-collision-performance.patch b/patches/server/1019-Check-distance-in-entity-interactions.patch index f646d2f8e9..afcd6f38a8 100644 --- a/patches/server/1019-Improve-boat-collision-performance.patch +++ b/patches/server/1019-Check-distance-in-entity-interactions.patch @@ -1,61 +1,60 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Spottedleaf <[email protected]> Date: Mon, 2 Aug 2021 10:10:40 +0200 -Subject: [PATCH] Improve boat collision performance +Subject: [PATCH] Check distance in entity interactions diff --git a/src/main/java/net/minecraft/Util.java b/src/main/java/net/minecraft/Util.java -index 42d7ecfab6f72517904451d9df3f0404b176fdb2..5869f2f5c72f736e6b077683327c64b9e0e0c733 100644 +index 42d7ecfab6f72517904451d9df3f0404b176fdb2..0e38a641d8e537750166b56c57aca4a90d418af1 100644 --- a/src/main/java/net/minecraft/Util.java +++ b/src/main/java/net/minecraft/Util.java @@ -125,6 +125,7 @@ public class Util { .filter(fileSystemProvider -> fileSystemProvider.getScheme().equalsIgnoreCase("jar")) .findFirst() .orElseThrow(() -> new IllegalStateException("No jar file system provider found")); -+ public static final double COLLISION_EPSILON = 1.0E-7; // Paper - Improve boat collision performance ++ public static final double COLLISION_EPSILON = 1.0E-7; // Paper - Check distance in entity interactions private static Consumer<String> thePauser = message -> { }; diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 25a7dfddb44a11f6e20c459141a61270c0c12d4c..affc39430e1f77e09768d2f614fcd5073d5a9270 100644 +index 42ff2150543108c393f108767963cde49d08efa8..6e5af47f5d2775c1afc4914342c3d0ea6569c792 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -1436,7 +1436,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -1437,7 +1437,7 @@ public abstract class LivingEntity extends Entity implements Attackable { if (!source.is(DamageTypeTags.IS_PROJECTILE)) { Entity entity = source.getDirectEntity(); - if (entity instanceof LivingEntity) { -+ if (entity instanceof LivingEntity && entity.distanceToSqr(this) <= (200.0D * 200.0D)) { // Paper - Improve boat collision performance ++ if (entity instanceof LivingEntity && entity.distanceToSqr(this) <= (200.0D * 200.0D)) { // Paper - Check distance in entity interactions LivingEntity entityliving = (LivingEntity) entity; this.blockUsingShield(entityliving); -@@ -1533,8 +1533,13 @@ public abstract class LivingEntity extends Entity implements Attackable { - double d0 = 0.0D; - double d1 = 0.0D; - Entity entity2 = source.getDirectEntity(); -- -- if (entity2 instanceof Projectile) { -+ // Paper start - improve boat collision performance -+ final boolean far = entity2.distanceToSqr(this) > (200.0D * 200.0D); -+ if (far) { +@@ -1557,6 +1557,14 @@ public abstract class LivingEntity extends Entity implements Attackable { + d0 = source.getSourcePosition().x() - this.getX(); + d1 = source.getSourcePosition().z() - this.getZ(); + } ++ // Paper start - Check distance in entity interactions; see for loop in knockback method ++ if (Math.abs(d0) > 200) { + d0 = Math.random() - Math.random(); ++ } ++ if (Math.abs(d1) > 200) { + d1 = Math.random() - Math.random(); -+ } else if (entity2 instanceof Projectile) { -+ // Paper end - improve boat collision performance - Projectile iprojectile = (Projectile) entity2; - DoubleDoubleImmutablePair doubledoubleimmutablepair = iprojectile.calculateHorizontalHurtKnockbackDirection(this, source); ++ } ++ // Paper end - Check distance in entity interactions -@@ -2325,7 +2330,7 @@ public abstract class LivingEntity extends Entity implements Attackable { + this.knockback(0.4000000059604645D, d0, d1, entity1, entity1 == null ? io.papermc.paper.event.entity.EntityKnockbackEvent.Cause.DAMAGE : io.papermc.paper.event.entity.EntityKnockbackEvent.Cause.ENTITY_ATTACK); // CraftBukkit // Paper - knockback events + if (!flag) { +@@ -2351,7 +2359,7 @@ public abstract class LivingEntity extends Entity implements Attackable { this.hurtCurrentlyUsedShield((float) -event.getDamage(DamageModifier.BLOCKING)); Entity entity = damagesource.getDirectEntity(); - if (!damagesource.is(DamageTypeTags.IS_PROJECTILE) && entity instanceof LivingEntity) { // Paper - Fix shield disable inconsistency -+ if (!damagesource.is(DamageTypeTags.IS_PROJECTILE) && entity instanceof LivingEntity && entity.distanceToSqr(this) <= (200.0D * 200.0D)) { // Paper - Fix shield disable inconsistency & improve boat collision performance ++ if (!damagesource.is(DamageTypeTags.IS_PROJECTILE) && entity instanceof LivingEntity && entity.distanceToSqr(this) <= (200.0D * 200.0D)) { // Paper - Fix shield disable inconsistency & Check distance in entity interactions this.blockUsingShield((LivingEntity) entity); } } diff --git a/src/main/java/net/minecraft/world/entity/vehicle/Boat.java b/src/main/java/net/minecraft/world/entity/vehicle/Boat.java -index 907f751c859855484151fb5d607acee2f2a35076..edd30d872d151f953df28c8f6d40efa8d39f5e36 100644 +index 907f751c859855484151fb5d607acee2f2a35076..f1955afc8e367f80ead85bd5ad3b8d66c255565a 100644 --- a/src/main/java/net/minecraft/world/entity/vehicle/Boat.java +++ b/src/main/java/net/minecraft/world/entity/vehicle/Boat.java @@ -718,7 +718,7 @@ public class Boat extends VehicleEntity implements Leashable, VariantHolder<Boat @@ -63,7 +62,7 @@ index 907f751c859855484151fb5d607acee2f2a35076..edd30d872d151f953df28c8f6d40efa8 if (this.level().noCollision(this, this.getBoundingBox().move(0.0D, d2 - this.getY(), 0.0D))) { - this.setPos(this.getX(), d2, this.getZ()); -+ this.move(MoverType.SELF, new Vec3(0.0D, d2 - this.getY(), 0.0D)); // Paper - improve boat collision performance ++ this.move(MoverType.SELF, new Vec3(0.0D, d2 - this.getY(), 0.0D)); // Paper - Check distance in entity interactions // TODO Still needed? this.setDeltaMovement(this.getDeltaMovement().multiply(1.0D, 0.0D, 1.0D)); this.lastYd = 0.0D; } diff --git a/patches/server/1023-Properly-resend-entities.patch b/patches/server/1023-Properly-resend-entities.patch index 78394d89ec..49917da8c7 100644 --- a/patches/server/1023-Properly-resend-entities.patch +++ b/patches/server/1023-Properly-resend-entities.patch @@ -166,10 +166,10 @@ index f1fb4e830c6720d09b22056e3d0b9a08fe2bd472..83f3ffdd8fa901b3de580d2359cdb5ea public boolean equals(Object object) { return object instanceof Entity ? ((Entity) object).id == this.id : false; diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index affc39430e1f77e09768d2f614fcd5073d5a9270..b9cef93fe382b666bec04ca95eeaf2d8acbb3c40 100644 +index 6e5af47f5d2775c1afc4914342c3d0ea6569c792..c5ca9fa86b940c6b5a54b05ff1bb3d0a300d60b2 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -3845,6 +3845,11 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3879,6 +3879,11 @@ public abstract class LivingEntity extends Entity implements Attackable { return ((Byte) this.entityData.get(LivingEntity.DATA_LIVING_ENTITY_FLAGS) & 2) > 0 ? InteractionHand.OFF_HAND : InteractionHand.MAIN_HAND; } diff --git a/patches/server/1025-Registry-Modification-API.patch b/patches/server/1025-Registry-Modification-API.patch index c45b119038..dc555c750d 100644 --- a/patches/server/1025-Registry-Modification-API.patch +++ b/patches/server/1025-Registry-Modification-API.patch @@ -1347,10 +1347,10 @@ index d21b7e39d71c785f47f790e1ad4be33a8e8e6e51..a47421425a8d5d2f07e08890fded0f7b + // Paper end - RegistrySet API } diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 5a04134973dd1db7f778a57ec5f185feec370990..8dba6c4a2e1f305cf576e8bfdca5d0c07ab871ae 100644 +index ca1c0955be0d0f78972f39c4bd4afffd46c2fb45..0984843ff443ba40406839d06f83304902ee4f43 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -685,6 +685,21 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -679,6 +679,21 @@ public final class CraftMagicNumbers implements UnsafeValues { } // Paper end - lifecycle event API diff --git a/patches/server/1028-Proxy-ItemStack-to-CraftItemStack.patch b/patches/server/1028-Proxy-ItemStack-to-CraftItemStack.patch index aba1d9b341..ad3c75feb2 100644 --- a/patches/server/1028-Proxy-ItemStack-to-CraftItemStack.patch +++ b/patches/server/1028-Proxy-ItemStack-to-CraftItemStack.patch @@ -160,7 +160,7 @@ index be36336a3c7d1ae88277f4ee1be70075001de7a7..814e8ece6821e359b504e8c4d140cc38 @Override diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemType.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemType.java -index 9d2feff3df87cfeefe7105d954854af05cef6f69..07539ebfefa3352de5ee7a17f2724cf2c979f399 100644 +index d03f4a767f6c7fe7d6bcef20e6676c39d9657584..bae3dd5fc67e6b3d98a5e63ffbf639c5042f8843 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemType.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemType.java @@ -100,13 +100,14 @@ public class CraftItemType<M extends ItemMeta> implements ItemType.Typed<M>, Han @@ -205,10 +205,10 @@ index 9c004e7cb46841d874ab997bf2e3b63ae763aec7..d7c8f26b21276d9ff1d5c7c9738cc112 + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 8dba6c4a2e1f305cf576e8bfdca5d0c07ab871ae..d70c5546c8bd6f364fad9b24880b6867efdab644 100644 +index 0984843ff443ba40406839d06f83304902ee4f43..3137391cadef7c67019561e65fedd0664e689eae 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -700,6 +700,13 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -694,6 +694,13 @@ public final class CraftMagicNumbers implements UnsafeValues { } // Paper end - hack to get tags for non server-backed registries diff --git a/patches/server/1035-fix-horse-inventories.patch b/patches/server/1035-fix-horse-inventories.patch new file mode 100644 index 0000000000..e8388a0c72 --- /dev/null +++ b/patches/server/1035-fix-horse-inventories.patch @@ -0,0 +1,173 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jake Potrebic <[email protected]> +Date: Sat, 6 Jul 2024 13:57:10 -0700 +Subject: [PATCH] fix horse inventories + +Horse inventories now combine 2 inventories (like +result inventories). + +== AT == +public net/minecraft/world/inventory/HorseInventoryMenu SLOT_BODY_ARMOR + +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java +index 9bcc0931510607b8fbd01233e2b3c346369b214d..467693a60786688b753cebac3b0a88898e332eee 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java +@@ -112,7 +112,7 @@ public abstract class CraftAbstractHorse extends CraftAnimals implements Abstrac + + @Override + public AbstractHorseInventory getInventory() { +- return new CraftSaddledInventory(getHandle().inventory); ++ return new CraftSaddledInventory(getHandle().inventory, this.getHandle().getBodyArmorAccess()); // Paper - use both inventories + } + + // Paper start - Horse API +diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryAbstractHorse.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryAbstractHorse.java +index 4946da593713f4d11d88ac1bb68a089f2f6d5ae0..bae0db99a8159bdea71182485b22cce9fc61e00a 100644 +--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryAbstractHorse.java ++++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryAbstractHorse.java +@@ -6,17 +6,64 @@ import org.bukkit.inventory.ItemStack; + + public class CraftInventoryAbstractHorse extends CraftInventory implements AbstractHorseInventory { + +- public CraftInventoryAbstractHorse(Container inventory) { ++ // Paper start - combine both horse inventories ++ private final Container bodyArmor; ++ public CraftInventoryAbstractHorse(Container inventory, final Container bodyArmor) { + super(inventory); ++ this.bodyArmor = bodyArmor; ++ // Paper end - combine both horse inventories + } + + @Override + public ItemStack getSaddle() { +- return this.getItem(0); ++ return this.getItem(net.minecraft.world.entity.animal.horse.AbstractHorse.INV_SLOT_SADDLE); // Paper + } + + @Override + public void setSaddle(ItemStack stack) { +- this.setItem(0, stack); ++ this.setItem(net.minecraft.world.entity.animal.horse.AbstractHorse.INV_SLOT_SADDLE, stack); // Paper + } ++ ++ // Paper start - combine both horse inventories ++ public Container getMainInventory() { ++ return this.inventory; ++ } ++ ++ public Container getArmorInventory() { ++ return this.bodyArmor; ++ } ++ ++ public ItemStack getArmor() { ++ return this.getItem(net.minecraft.world.inventory.HorseInventoryMenu.SLOT_BODY_ARMOR); ++ } ++ ++ public void setArmor(ItemStack armor) { ++ this.setItem(net.minecraft.world.inventory.HorseInventoryMenu.SLOT_BODY_ARMOR, armor); ++ } ++ ++ @Override ++ public int getSize() { ++ return this.getMainInventory().getContainerSize() + this.getArmorInventory().getContainerSize(); ++ } ++ ++ @Override ++ public ItemStack getItem(final int index) { ++ if (index == net.minecraft.world.inventory.HorseInventoryMenu.SLOT_BODY_ARMOR) { ++ final net.minecraft.world.item.ItemStack item = this.getArmorInventory().getItem(index); ++ return item.isEmpty() ? null : CraftItemStack.asCraftMirror(item); ++ } else { ++ final net.minecraft.world.item.ItemStack item = this.getMainInventory().getItem(index); ++ return item.isEmpty() ? null : CraftItemStack.asCraftMirror(item); ++ } ++ } ++ ++ @Override ++ public void setItem(final int index, final ItemStack item) { ++ if (index == net.minecraft.world.inventory.HorseInventoryMenu.SLOT_BODY_ARMOR) { ++ this.getArmorInventory().setItem(index, CraftItemStack.asNMSCopy(item)); ++ } else { ++ this.getMainInventory().setItem(index, CraftItemStack.asNMSCopy(item)); ++ } ++ } ++ // Paper end - combine both horse inventories + } +diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryHorse.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryHorse.java +index 07a304edc2a7b3450a55728e78a4fe37febdbadc..ebf0da48378b9376b3be2ca731315485003f6a89 100644 +--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryHorse.java ++++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryHorse.java +@@ -6,21 +6,9 @@ import org.bukkit.inventory.ItemStack; + + public class CraftInventoryHorse extends CraftSaddledInventory implements HorseInventory { + +- private final Container bodyArmorInventory; +- ++ // Paper start - properly combine both inventories + public CraftInventoryHorse(Container inventory, Container bodyArmorInventory) { +- super(inventory); +- this.bodyArmorInventory = bodyArmorInventory; +- } +- +- @Override +- public ItemStack getArmor() { +- net.minecraft.world.item.ItemStack item = this.bodyArmorInventory.getItem(0); +- return item.isEmpty() ? null : CraftItemStack.asCraftMirror(item); +- } +- +- @Override +- public void setArmor(ItemStack stack) { +- this.bodyArmorInventory.setItem(0, CraftItemStack.asNMSCopy(stack)); ++ super(inventory, bodyArmorInventory); + } ++ // Paper end - properly combine both inventories + } +diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryLlama.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryLlama.java +index dcbc80646ebfc384c4f6ab1beee46a4b71a67af8..0804b642d966f2cb09f4101410e2ff1d154ea594 100644 +--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryLlama.java ++++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryLlama.java +@@ -6,21 +6,19 @@ import org.bukkit.inventory.LlamaInventory; + + public class CraftInventoryLlama extends CraftInventoryAbstractHorse implements LlamaInventory { + +- private final Container bodyArmorInventory; +- ++ // Paper start - properly combine both inventories + public CraftInventoryLlama(Container inventory, Container bodyArmorInventory) { +- super(inventory); +- this.bodyArmorInventory = bodyArmorInventory; ++ super(inventory, bodyArmorInventory); ++ // Paper end - properly combine both inventories + } + + @Override + public ItemStack getDecor() { +- net.minecraft.world.item.ItemStack item = this.bodyArmorInventory.getItem(0); +- return item.isEmpty() ? null : CraftItemStack.asCraftMirror(item); ++ return this.getArmor(); // Paper + } + + @Override + public void setDecor(ItemStack stack) { +- this.bodyArmorInventory.setItem(0, CraftItemStack.asNMSCopy(stack)); ++ this.setArmor(stack); // Paper + } + } +diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftSaddledInventory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftSaddledInventory.java +index 3a617c07d445bacf5a13e0e3ff6481823cfc8477..1c100c7c210485c1d3510745de7d18f58ba72557 100644 +--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftSaddledInventory.java ++++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftSaddledInventory.java +@@ -5,8 +5,10 @@ import org.bukkit.inventory.SaddledHorseInventory; + + public class CraftSaddledInventory extends CraftInventoryAbstractHorse implements SaddledHorseInventory { + +- public CraftSaddledInventory(Container inventory) { +- super(inventory); ++ // Paper start - combine both inventories ++ public CraftSaddledInventory(Container inventory, final Container bodyArmor) { ++ super(inventory, bodyArmor); ++ // Paper end - combine both inventories + } + + } |