Blood Magic

Blood Magic

90M Downloads

Blood Altar only filling Orbs of lower level tiers

tommyTT opened this issue ยท 1 comments

commented

Issue Description:

After upgrading to version 2.3.2-100 of the mod, my blood altar tier 5 no longer fills the Archmage Blood Orb (tier 5).

What happens:

The blood inside the altar no longer fills any blood orb of the same tier, only lower tier orbs work.

What you expected to happen:

Blood orbs of the same tier as the altar will be filled. Higher tier orbs are not filled by the altar.

Steps to reproduce:

  1. Build Altar Tier 5.
  2. Fill Altar with blood.
  3. Bind Archmage Blood Orb (Tier 5) to your player and insert it into the Altar. -> doesn't work
  4. Bind a Master Blood Orb (Tier 4) to your player and insert it into the Altar. -> works

Affected Versions (Do not use "latest"):

  • BloodMagic: 2.3.2-100
  • Minecraft: 1.12.1
  • Forge: 14.23.4.2705

Analysis

This is a direct result of this change and is essentially a "off by one" error. Using the ordinals of the AltarTier enum is 0 based, the BloodOrb class however has a tier property that starts with 1 and therefore this comparison doesn't give the correct result. Looking further into the code, there is a AltarTier.toInt() method that already does this adjustment and should be used everywhere instead of the ordinal. There might be more similar problems in the code base (e.g. here) and a general search for code like this might be necessary.

commented

Bah, I forgot I was stupid and made orbs 1-indexed