diff --git a/patches/server/Ability-to-apply-mending-to-XP-API.patch b/patches/server/Ability-to-apply-mending-to-XP-API.patch index beaab26622..7f904db5f4 100644 --- a/patches/server/Ability-to-apply-mending-to-XP-API.patch +++ b/patches/server/Ability-to-apply-mending-to-XP-API.patch @@ -27,7 +27,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + ServerPlayer handle = this.getHandle(); + // Logic copied from EntityExperienceOrb and remapped to unobfuscated methods/properties + final var stackEntry = net.minecraft.world.item.enchantment.EnchantmentHelper -+ .getRandomItemWith(net.minecraft.world.item.enchantment.Enchantments.MENDING, handle); ++ .getRandomItemWith(net.minecraft.world.item.enchantment.Enchantments.MENDING, handle, net.minecraft.world.item.ItemStack::isDamaged); + final net.minecraft.world.item.ItemStack itemstack = stackEntry != null ? stackEntry.getValue() : net.minecraft.world.item.ItemStack.EMPTY; + if (!itemstack.isEmpty() && itemstack.getItem().components().has(net.minecraft.core.component.DataComponents.MAX_DAMAGE)) { + net.minecraft.world.entity.ExperienceOrb orb = net.minecraft.world.entity.EntityType.EXPERIENCE_ORB.create(handle.level());