Blood Magic

Blood Magic

90M Downloads

Incompatibility with Unmending mod

AfterRebelion opened this issue ยท 2 comments

commented

Issue Description:

When Blood Magic is installed, Unmending functionality breaks, and any item that had mending enchantment can be repaired.

Since this is a intermod compatibility issue, I also created an issue report in the Unmending project:
VazkiiModsArchive/Unmending#3

What happens:

You can find a item with mending (loot chest, for example), and the mending enchantment will work, repairing the item.

What you expected to happen:

Unmending should prevent the item from getting durability, even when mending enchantment is applied to the item.

Steps to reproduce:

  1. Have an instance with Blood Magic and Unmending
  2. Give yourself an damaged item, and apply mending enchantment to it with creative
  3. Splash a bottle o' enchanting, and you can see the item you are holding repaired
    ...

Affected Versions (Do not use "latest"):

  • BloodMagic: 1.12.2-2.4.0-102
  • Minecraft: 1.12.2
  • Forge: 14.23.5.2822
  • Unmending: 1.0-2
commented

At first I though this would be because the mod cancels the event before it gets to Unmending, but looking at the code, the reason is much simple... but strange...

if (!itemstack.isEmpty() && itemstack.isItemDamaged()) {
int i = Math.min(xpToDurability(event.getOrb().xpValue), itemstack.getItemDamage());
event.getOrb().xpValue -= durabilityToXp(i);
itemstack.setItemDamage(itemstack.getItemDamage() - i);
}

Blood Magic for some reason circumvents the whole Mending system. It seems to be made to let the mending enchantment do it's thing before the experience tome...
Is that really necessary?

commented

Something along those lines is necessary. If the XP is eaten by Mending, the tome should not be able to consume it as well.