diff options
author | Jake Potrebic <[email protected]> | 2024-04-25 23:10:38 -0700 |
---|---|---|
committer | Jake Potrebic <[email protected]> | 2024-04-25 23:10:38 -0700 |
commit | 43d110e9a9563364b18d2b9986e0dceedd0b5d7f (patch) | |
tree | bd94055e37bdb5219f9c8f7f21c7acb939d91a7c | |
parent | bcdf1f96b8d5ae0a513cf99f8cba7b9926afcb91 (diff) | |
download | Paper-43d110e9a9563364b18d2b9986e0dceedd0b5d7f.tar.gz Paper-43d110e9a9563364b18d2b9986e0dceedd0b5d7f.zip |
fix issue with item default attribute API
22 files changed, 71 insertions, 94 deletions
diff --git a/patches/api/0285-Attributes-API-for-item-defaults.patch b/patches/api/0285-Attributes-API-for-item-defaults.patch index ca26876023..1445309f84 100644 --- a/patches/api/0285-Attributes-API-for-item-defaults.patch +++ b/patches/api/0285-Attributes-API-for-item-defaults.patch @@ -3,9 +3,10 @@ From: Jake Potrebic <[email protected]> Date: Sat, 8 May 2021 15:02:00 -0700 Subject: [PATCH] Attributes API for item defaults +(Now replaced by upstream's API) diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java -index 7c14a272156cefe6d69e41fec6892891646e0985..0dd2a9c7ea5b56995ff238fd0e5eceacf91c9e6f 100644 +index 7c14a272156cefe6d69e41fec6892891646e0985..eb9e0eb1aa6e203ff6f896b177ee60c8afacc62d 100644 --- a/src/main/java/org/bukkit/Material.java +++ b/src/main/java/org/bukkit/Material.java @@ -4759,6 +4759,21 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla @@ -23,33 +24,10 @@ index 7c14a272156cefe6d69e41fec6892891646e0985..0dd2a9c7ea5b56995ff238fd0e5eceac + * @deprecated use {@link #getDefaultAttributeModifiers(EquipmentSlot)} + */ + @NotNull -+ @Deprecated ++ @Deprecated(forRemoval = true, since = "1.20.5") + public Multimap<Attribute, AttributeModifier> getItemAttributes(@NotNull EquipmentSlot equipmentSlot) { -+ return Bukkit.getUnsafe().getItemAttributes(this, equipmentSlot); ++ return this.getDefaultAttributeModifiers(equipmentSlot); + } // Paper end /** -diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java -index 057f4db9cb6b686ab941ec5d3e6ca23dcfbd845f..db8ffa9b303b9128be175f383fdf838a4e0719e5 100644 ---- a/src/main/java/org/bukkit/UnsafeValues.java -+++ b/src/main/java/org/bukkit/UnsafeValues.java -@@ -197,6 +197,18 @@ public interface UnsafeValues { - */ - public boolean isValidRepairItemStack(@org.jetbrains.annotations.NotNull ItemStack itemToBeRepaired, @org.jetbrains.annotations.NotNull ItemStack repairMaterial); - -+ /** -+ * Returns an immutable multimap of attributes for the material and slot. -+ * {@link Material#isItem()} must be true for this material. -+ * -+ * @param material the material -+ * @param equipmentSlot the slot to get the attributes for -+ * @throws IllegalArgumentException if {@link Material#isItem()} is false -+ * @return an immutable multimap of attributes -+ */ -+ @org.jetbrains.annotations.NotNull -+ public Multimap<Attribute, AttributeModifier> getItemAttributes(@org.jetbrains.annotations.NotNull Material material, @org.jetbrains.annotations.NotNull EquipmentSlot equipmentSlot); -+ - /** - * Returns the server's protocol version. - * diff --git a/patches/api/0312-Get-entity-default-attributes.patch b/patches/api/0312-Get-entity-default-attributes.patch index 72068dd1df..8c11a9af7f 100644 --- a/patches/api/0312-Get-entity-default-attributes.patch +++ b/patches/api/0312-Get-entity-default-attributes.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Get entity default attributes diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java -index db8ffa9b303b9128be175f383fdf838a4e0719e5..b205937d1cd627c1dd660277f69891b5412b1c16 100644 +index 057f4db9cb6b686ab941ec5d3e6ca23dcfbd845f..900b502a400bb99a2131305812e48acfeb8b94a1 100644 --- a/src/main/java/org/bukkit/UnsafeValues.java +++ b/src/main/java/org/bukkit/UnsafeValues.java -@@ -215,5 +215,22 @@ public interface UnsafeValues { +@@ -203,5 +203,22 @@ public interface UnsafeValues { * @return the server's protocol version */ int getProtocolVersion(); diff --git a/patches/api/0317-Add-isCollidable-methods-to-various-places.patch b/patches/api/0317-Add-isCollidable-methods-to-various-places.patch index 0dc9b1393b..a5f9888bf8 100644 --- a/patches/api/0317-Add-isCollidable-methods-to-various-places.patch +++ b/patches/api/0317-Add-isCollidable-methods-to-various-places.patch @@ -5,12 +5,12 @@ Subject: [PATCH] Add isCollidable methods to various places diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java -index 0dd2a9c7ea5b56995ff238fd0e5eceacf91c9e6f..22e59e24709b1aa1f326d382ebce752c2b42e435 100644 +index eb9e0eb1aa6e203ff6f896b177ee60c8afacc62d..137b4553636f31574c51960cada6eb07d80a02d9 100644 --- a/src/main/java/org/bukkit/Material.java +++ b/src/main/java/org/bukkit/Material.java @@ -4774,6 +4774,16 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla public Multimap<Attribute, AttributeModifier> getItemAttributes(@NotNull EquipmentSlot equipmentSlot) { - return Bukkit.getUnsafe().getItemAttributes(this, equipmentSlot); + return this.getDefaultAttributeModifiers(equipmentSlot); } + + /** @@ -26,10 +26,10 @@ index 0dd2a9c7ea5b56995ff238fd0e5eceacf91c9e6f..22e59e24709b1aa1f326d382ebce752c /** diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java -index b205937d1cd627c1dd660277f69891b5412b1c16..ca0b126bff245ed3fe69bc49c28499f7a7aa9556 100644 +index 900b502a400bb99a2131305812e48acfeb8b94a1..75c9569214321b3f23f3614722d7453020d095c3 100644 --- a/src/main/java/org/bukkit/UnsafeValues.java +++ b/src/main/java/org/bukkit/UnsafeValues.java -@@ -232,5 +232,14 @@ public interface UnsafeValues { +@@ -220,5 +220,14 @@ public interface UnsafeValues { * @throws IllegalArgumentException if the entity does not exist of have default attributes (use {@link #hasDefaultEntityAttributes(NamespacedKey)} first) */ @org.jetbrains.annotations.NotNull org.bukkit.attribute.Attributable getDefaultEntityAttributes(@org.jetbrains.annotations.NotNull NamespacedKey entityKey); diff --git a/patches/api/0320-Add-Raw-Byte-Entity-Serialization.patch b/patches/api/0320-Add-Raw-Byte-Entity-Serialization.patch index d23f9d0469..5895168aae 100644 --- a/patches/api/0320-Add-Raw-Byte-Entity-Serialization.patch +++ b/patches/api/0320-Add-Raw-Byte-Entity-Serialization.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add Raw Byte Entity Serialization diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java -index ca0b126bff245ed3fe69bc49c28499f7a7aa9556..6426d8585bba71b3e998b1eb078ac0fc67076d65 100644 +index 75c9569214321b3f23f3614722d7453020d095c3..bdfa60a764c13d82cd013335fb7b0c896abe74bd 100644 --- a/src/main/java/org/bukkit/UnsafeValues.java +++ b/src/main/java/org/bukkit/UnsafeValues.java @@ -158,6 +158,14 @@ public interface UnsafeValues { diff --git a/patches/api/0367-Add-NamespacedKey-biome-methods.patch b/patches/api/0367-Add-NamespacedKey-biome-methods.patch index 97a47e3b8e..88b7d9aefc 100644 --- a/patches/api/0367-Add-NamespacedKey-biome-methods.patch +++ b/patches/api/0367-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/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java -index 6426d8585bba71b3e998b1eb078ac0fc67076d65..d97e42de951527afb03eafc481704418dedffde9 100644 +index bdfa60a764c13d82cd013335fb7b0c896abe74bd..0eddda31e47e807551436ae834e89ea56141f163 100644 --- a/src/main/java/org/bukkit/UnsafeValues.java +++ b/src/main/java/org/bukkit/UnsafeValues.java -@@ -249,5 +249,32 @@ public interface UnsafeValues { +@@ -237,5 +237,32 @@ public interface UnsafeValues { * @throws IllegalArgumentException if {@link Material#isBlock()} is false */ boolean isCollidable(@org.jetbrains.annotations.NotNull Material material); diff --git a/patches/api/0416-Fix-custom-statistic-criteria-creation.patch b/patches/api/0416-Fix-custom-statistic-criteria-creation.patch index 1e6de23d5e..3a25880b2e 100644 --- a/patches/api/0416-Fix-custom-statistic-criteria-creation.patch +++ b/patches/api/0416-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/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java -index d97e42de951527afb03eafc481704418dedffde9..c73eed20d18d1109e3b78b9daa92d7438fc52e8d 100644 +index 0eddda31e47e807551436ae834e89ea56141f163..7b54ca313ce65f91932ee8ee968196f6091db86f 100644 --- a/src/main/java/org/bukkit/UnsafeValues.java +++ b/src/main/java/org/bukkit/UnsafeValues.java -@@ -276,5 +276,7 @@ public interface UnsafeValues { +@@ -264,5 +264,7 @@ public interface UnsafeValues { * @throws IllegalStateException if no biome by the given key is registered. */ void setBiomeKey(RegionAccessor accessor, int x, int y, int z, NamespacedKey biomeKey); diff --git a/patches/api/0442-add-missing-Experimental-annotations.patch b/patches/api/0442-add-missing-Experimental-annotations.patch index ea9a525017..6a10187982 100644 --- a/patches/api/0442-add-missing-Experimental-annotations.patch +++ b/patches/api/0442-add-missing-Experimental-annotations.patch @@ -27,7 +27,7 @@ index 6b68c92ec894451d99ded3e3df5965cb31d68ed2..fd5e433f930963c102c9c977523a0036 public static final FeatureFlag UPDATE_121 = Bukkit.getUnsafe().getFeatureFlag(NamespacedKey.minecraft("update_1_21")); } diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java -index 22e59e24709b1aa1f326d382ebce752c2b42e435..9de0f7bb9f91835d66e8ce85bbc9caf45ab552b0 100644 +index 137b4553636f31574c51960cada6eb07d80a02d9..cdbb67b677d5226d15df40339b7df02482561e3e 100644 --- a/src/main/java/org/bukkit/Material.java +++ b/src/main/java/org/bukkit/Material.java @@ -146,54 +146,67 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla diff --git a/patches/api/0454-Add-api-for-spawn-egg-texture-colors.patch b/patches/api/0454-Add-api-for-spawn-egg-texture-colors.patch index 35366bea02..f05f31cb72 100644 --- a/patches/api/0454-Add-api-for-spawn-egg-texture-colors.patch +++ b/patches/api/0454-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/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java -index c73eed20d18d1109e3b78b9daa92d7438fc52e8d..1ac54ae7b4bcc7932492477e88a81954f71f342f 100644 +index 7b54ca313ce65f91932ee8ee968196f6091db86f..e1493ef58854e7bc929a2fa5aaba9da527dfd563 100644 --- a/src/main/java/org/bukkit/UnsafeValues.java +++ b/src/main/java/org/bukkit/UnsafeValues.java -@@ -279,4 +279,17 @@ public interface UnsafeValues { +@@ -267,4 +267,17 @@ public interface UnsafeValues { String getStatisticCriteriaKey(@NotNull org.bukkit.Statistic statistic); // Paper end diff --git a/patches/api/0455-Add-Lifecycle-Event-system.patch b/patches/api/0455-Add-Lifecycle-Event-system.patch index f915f892cf..540279acf4 100644 --- a/patches/api/0455-Add-Lifecycle-Event-system.patch +++ b/patches/api/0455-Add-Lifecycle-Event-system.patch @@ -528,10 +528,10 @@ index 0000000000000000000000000000000000000000..304f978e40e1759bb19704cc5cec3995 + } +} diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java -index 1ac54ae7b4bcc7932492477e88a81954f71f342f..14a49bfd1822c25b95000f3fbb60ba1d55ae0d38 100644 +index e1493ef58854e7bc929a2fa5aaba9da527dfd563..887129a95ff2e299507bf870b1ef3212afe6563e 100644 --- a/src/main/java/org/bukkit/UnsafeValues.java +++ b/src/main/java/org/bukkit/UnsafeValues.java -@@ -292,4 +292,12 @@ public interface UnsafeValues { +@@ -280,4 +280,12 @@ public interface UnsafeValues { */ @Nullable org.bukkit.Color getSpawnEggLayerColor(org.bukkit.entity.EntityType entityType, int layer); // Paper end - spawn egg color visibility diff --git a/patches/api/0456-ItemStack-Tooltip-API.patch b/patches/api/0456-ItemStack-Tooltip-API.patch index 0db68cc72b..995d8493f5 100644 --- a/patches/api/0456-ItemStack-Tooltip-API.patch +++ b/patches/api/0456-ItemStack-Tooltip-API.patch @@ -108,10 +108,10 @@ index 0000000000000000000000000000000000000000..1d9bed6691f581529c53b577b26f1d0f + } +} diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java -index 14a49bfd1822c25b95000f3fbb60ba1d55ae0d38..b9a07b2db8a3dcdb72c33c8ceda129921b2c02f1 100644 +index 887129a95ff2e299507bf870b1ef3212afe6563e..c7d0cdd4778c329f09db6cea97ddb019690d6246 100644 --- a/src/main/java/org/bukkit/UnsafeValues.java +++ b/src/main/java/org/bukkit/UnsafeValues.java -@@ -300,4 +300,6 @@ public interface UnsafeValues { +@@ -288,4 +288,6 @@ public interface UnsafeValues { @org.jetbrains.annotations.ApiStatus.Internal io.papermc.paper.plugin.lifecycle.event.LifecycleEventManager<org.bukkit.plugin.Plugin> createPluginLifecycleEventManager(final org.bukkit.plugin.java.JavaPlugin plugin, final java.util.function.BooleanSupplier registrationCheck); // Paper end - lifecycle event API diff --git a/patches/server/0558-Attributes-API-for-item-defaults.patch b/patches/server/0558-Attributes-API-for-item-defaults.patch deleted file mode 100644 index d229da9c2a..0000000000 --- a/patches/server/0558-Attributes-API-for-item-defaults.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Jake Potrebic <[email protected]> -Date: Sat, 8 May 2021 15:01:54 -0700 -Subject: [PATCH] Attributes API for item defaults - - -diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 6b3fbdf0a53f95c43eee7b745d85e8fcf84413b0..d85adc8aa11579d94ab48f6360e3df4c5796af30 100644 ---- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -561,6 +561,19 @@ public final class CraftMagicNumbers implements UnsafeValues { - return CraftMagicNumbers.getItem(itemToBeRepaired.getType()).isValidRepairItem(CraftItemStack.asNMSCopy(itemToBeRepaired), CraftItemStack.asNMSCopy(repairMaterial)); - } - -+ @Override -+ public Multimap<Attribute, AttributeModifier> getItemAttributes(Material material, EquipmentSlot equipmentSlot) { -+ Item item = CraftMagicNumbers.getItem(material); -+ if (item == null) { -+ throw new IllegalArgumentException(material + " is not an item and therefore does not have attributes"); -+ } -+ ImmutableMultimap.Builder<Attribute, AttributeModifier> attributeMapBuilder = ImmutableMultimap.builder(); -+ item.getDefaultAttributeModifiers(CraftEquipmentSlot.getNMS(equipmentSlot)).forEach((attributeBase, attributeModifier) -> { -+ attributeMapBuilder.put(CraftAttribute.stringToBukkit(net.minecraft.core.registries.BuiltInRegistries.ATTRIBUTE.getKey(attributeBase).toString()), CraftAttributeInstance.convert(attributeModifier, equipmentSlot)); -+ }); -+ return attributeMapBuilder.build(); -+ } -+ - @Override - public int getProtocolVersion() { - return net.minecraft.SharedConstants.getCurrentVersion().getProtocolVersion(); diff --git a/patches/server/0558-Fix-item-default-attributes-API.patch b/patches/server/0558-Fix-item-default-attributes-API.patch new file mode 100644 index 0000000000..a3726019c7 --- /dev/null +++ b/patches/server/0558-Fix-item-default-attributes-API.patch @@ -0,0 +1,29 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jake Potrebic <[email protected]> +Date: Sat, 8 May 2021 15:01:54 -0700 +Subject: [PATCH] Fix item default attributes API + +(previously added this API but upstream also added it) + +diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +index 6b3fbdf0a53f95c43eee7b745d85e8fcf84413b0..bbe66459f29edf0c3de289a8b8a93e926323f82a 100644 +--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java ++++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +@@ -396,9 +396,14 @@ 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(); ++ // Paper start - fix item default attribute API ++ final Item item = CraftMagicNumbers.getItem(material); ++ if (item == null) { ++ throw new IllegalArgumentException(material + " is not an item and therefore does not have attributes"); ++ } ++ final ImmutableMultimap.Builder<Attribute, AttributeModifier> defaultAttributes = ImmutableMultimap.builder(); ++ ItemAttributeModifiers nmsDefaultAttributes = item.components().getOrDefault(net.minecraft.core.component.DataComponents.ATTRIBUTE_MODIFIERS, ItemAttributeModifiers.EMPTY); ++ // Paper end - fix item default attribute API + nmsDefaultAttributes.forEach(CraftEquipmentSlot.getNMS(slot), (key, value) -> { + Attribute attribute = CraftAttribute.minecraftToBukkit(key.value()); + defaultAttributes.put(attribute, CraftAttributeInstance.convert(value, slot)); diff --git a/patches/server/0606-Get-entity-default-attributes.patch b/patches/server/0606-Get-entity-default-attributes.patch index ae103104ed..ac552e1e77 100644 --- a/patches/server/0606-Get-entity-default-attributes.patch +++ b/patches/server/0606-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 d85adc8aa11579d94ab48f6360e3df4c5796af30..e747c87ff8f1101119a9fb33c4d52fd97ef04938 100644 +index bbe66459f29edf0c3de289a8b8a93e926323f82a..c9c18f0e1d7ccb2c7024ed60bf1ac99d30f0104d 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -578,6 +578,18 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -570,6 +570,18 @@ public final class CraftMagicNumbers implements UnsafeValues { public int getProtocolVersion() { return net.minecraft.SharedConstants.getCurrentVersion().getProtocolVersion(); } diff --git a/patches/server/0612-Add-isCollidable-methods-to-various-places.patch b/patches/server/0612-Add-isCollidable-methods-to-various-places.patch index 96ca5afc16..6bcc5653a6 100644 --- a/patches/server/0612-Add-isCollidable-methods-to-various-places.patch +++ b/patches/server/0612-Add-isCollidable-methods-to-various-places.patch @@ -39,10 +39,10 @@ index 1002123cd0c6f57cecc4e80f5f21cc6ff5886d37..e96023b71845526383288917e8d7c575 + // 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 e747c87ff8f1101119a9fb33c4d52fd97ef04938..97a8748284547ee6c507d9f763772e34b2371d90 100644 +index c9c18f0e1d7ccb2c7024ed60bf1ac99d30f0104d..71488300c3c4e45e6a8742c70f156fbc901efe5e 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -590,6 +590,12 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -582,6 +582,12 @@ public final class CraftMagicNumbers implements UnsafeValues { var supplier = net.minecraft.world.entity.ai.attributes.DefaultAttributes.getSupplier((net.minecraft.world.entity.EntityType<? extends net.minecraft.world.entity.LivingEntity>) net.minecraft.core.registries.BuiltInRegistries.ENTITY_TYPE.get(CraftNamespacedKey.toMinecraft(bukkitEntityKey))); return new io.papermc.paper.attribute.UnmodifiableAttributeMap(supplier); } diff --git a/patches/server/0615-Add-Raw-Byte-Entity-Serialization.patch b/patches/server/0615-Add-Raw-Byte-Entity-Serialization.patch index 37f4e302fe..5007c8b775 100644 --- a/patches/server/0615-Add-Raw-Byte-Entity-Serialization.patch +++ b/patches/server/0615-Add-Raw-Byte-Entity-Serialization.patch @@ -50,10 +50,10 @@ index 9edcdc71b28cf08e42fbe44723ba540e8d4f7808..a61638bc8200f6aa25d9c3254aea6c0c @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 97a8748284547ee6c507d9f763772e34b2371d90..ab9cf64fdde15e80c4c6fb101ee4a328844aa112 100644 +index 71488300c3c4e45e6a8742c70f156fbc901efe5e..277ed7b7281821b25d508e0faf56433ef2ede59e 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -501,7 +501,33 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -506,7 +506,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/0757-Add-NamespacedKey-biome-methods.patch b/patches/server/0757-Add-NamespacedKey-biome-methods.patch index 42c85345c5..94253c34e4 100644 --- a/patches/server/0757-Add-NamespacedKey-biome-methods.patch +++ b/patches/server/0757-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 ab9cf64fdde15e80c4c6fb101ee4a328844aa112..14a73354698a1d0592eb0fc10c73fc2d25c02e4e 100644 +index 277ed7b7281821b25d508e0faf56433ef2ede59e..b44aa2f312d3cf51741c1a8e10dee366a724dc13 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -622,6 +622,19 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -614,6 +614,19 @@ public final class CraftMagicNumbers implements UnsafeValues { Preconditions.checkArgument(material.isBlock(), material + " is not a block"); return getBlock(material).hasCollision; } diff --git a/patches/server/0884-Fix-custom-statistic-criteria-creation.patch b/patches/server/0884-Fix-custom-statistic-criteria-creation.patch index a5adfbb956..30ac66f7e8 100644 --- a/patches/server/0884-Fix-custom-statistic-criteria-creation.patch +++ b/patches/server/0884-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 14a73354698a1d0592eb0fc10c73fc2d25c02e4e..b5b165fc9d28afa5bac24daee98df472ac254ee1 100644 +index b44aa2f312d3cf51741c1a8e10dee366a724dc13..c5042837254bdc84e3064941b7aa567348af77a2 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -635,6 +635,12 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -627,6 +627,12 @@ public final class CraftMagicNumbers implements UnsafeValues { net.minecraft.core.Holder<net.minecraft.world.level.biome.Biome> biomeBase = cra.getHandle().registryAccess().registryOrThrow(net.minecraft.core.registries.Registries.BIOME).getHolderOrThrow(net.minecraft.resources.ResourceKey.create(net.minecraft.core.registries.Registries.BIOME, org.bukkit.craftbukkit.util.CraftNamespacedKey.toMinecraft(biomeKey))); cra.setBiome(x, y, z, biomeBase); } diff --git a/patches/server/0922-Fix-UnsafeValues-loadAdvancement.patch b/patches/server/0922-Fix-UnsafeValues-loadAdvancement.patch index a259259eee..458f262592 100644 --- a/patches/server/0922-Fix-UnsafeValues-loadAdvancement.patch +++ b/patches/server/0922-Fix-UnsafeValues-loadAdvancement.patch @@ -5,7 +5,7 @@ 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 b5b165fc9d28afa5bac24daee98df472ac254ee1..af98e9e0777ecca333b32245262d453d71afa396 100644 +index c5042837254bdc84e3064941b7aa567348af77a2..8dde83ba89ee5b29dcc8cc89dbf9274fea46eb00 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java @@ -320,7 +320,27 @@ public final class CraftMagicNumbers implements UnsafeValues { diff --git a/patches/server/0957-Add-api-for-spawn-egg-texture-colors.patch b/patches/server/0957-Add-api-for-spawn-egg-texture-colors.patch index e322b67bea..5b26539aae 100644 --- a/patches/server/0957-Add-api-for-spawn-egg-texture-colors.patch +++ b/patches/server/0957-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 af98e9e0777ecca333b32245262d453d71afa396..31acd769bdfdff0128275e401a6209df093506d3 100644 +index 8dde83ba89ee5b29dcc8cc89dbf9274fea46eb00..0ea32cb3ccfc07b62fb174a381a24d52d082b5b4 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -663,6 +663,15 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -655,6 +655,15 @@ public final class CraftMagicNumbers implements UnsafeValues { } // Paper end diff --git a/patches/server/0958-Add-Lifecycle-Event-system.patch b/patches/server/0958-Add-Lifecycle-Event-system.patch index a99f906a5f..ff773d46dc 100644 --- a/patches/server/0958-Add-Lifecycle-Event-system.patch +++ b/patches/server/0958-Add-Lifecycle-Event-system.patch @@ -739,10 +739,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 31acd769bdfdff0128275e401a6209df093506d3..c6ce4e9428b5d6d117def376accdfb0c12b49565 100644 +index 0ea32cb3ccfc07b62fb174a381a24d52d082b5b4..90e2e6719c043b133734a5f544f7e80f6a67b2f9 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -672,6 +672,13 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -664,6 +664,13 @@ public final class CraftMagicNumbers implements UnsafeValues { } // Paper end - spawn egg color visibility diff --git a/patches/server/0959-ItemStack-Tooltip-API.patch b/patches/server/0959-ItemStack-Tooltip-API.patch index f3240fe913..f293e899b6 100644 --- a/patches/server/0959-ItemStack-Tooltip-API.patch +++ b/patches/server/0959-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 c6ce4e9428b5d6d117def376accdfb0c12b49565..b8f9731e9fbe435242d7d3ec54ca65871a763562 100644 +index 90e2e6719c043b133734a5f544f7e80f6a67b2f9..a59f450f6eebaa144377c62a80ccf94c8c040dcc 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -662,6 +662,20 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -654,6 +654,20 @@ public final class CraftMagicNumbers implements UnsafeValues { return org.bukkit.craftbukkit.CraftStatistic.getNMSStatistic(statistic).getName(); } // Paper end diff --git a/patches/server/0980-Rewrite-dataconverter-system.patch b/patches/server/0980-Rewrite-dataconverter-system.patch index efaca8b129..329de44236 100644 --- a/patches/server/0980-Rewrite-dataconverter-system.patch +++ b/patches/server/0980-Rewrite-dataconverter-system.patch @@ -28899,10 +28899,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 b8f9731e9fbe435242d7d3ec54ca65871a763562..96354aeb0ac36b7d2d3370974380c1a0a58c3276 100644 +index a59f450f6eebaa144377c62a80ccf94c8c040dcc..50068b7914e16c043ad31cf40ddc2dafdb33d324 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -517,7 +517,7 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -522,7 +522,7 @@ public final class CraftMagicNumbers implements UnsafeValues { net.minecraft.nbt.CompoundTag compound = deserializeNbtFromBytes(data); final int dataVersion = compound.getInt("DataVersion"); @@ -28911,7 +28911,7 @@ index b8f9731e9fbe435242d7d3ec54ca65871a763562..96354aeb0ac36b7d2d3370974380c1a0 return CraftItemStack.asCraftMirror(net.minecraft.world.item.ItemStack.parse(MinecraftServer.getServer().registryAccess(), compound).orElseThrow()); } -@@ -538,7 +538,7 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -543,7 +543,7 @@ public final class CraftMagicNumbers implements UnsafeValues { net.minecraft.nbt.CompoundTag compound = deserializeNbtFromBytes(data); int dataVersion = compound.getInt("DataVersion"); |