focamacho / RingsOfAscension

Rings of Ascension is a mod that uses the Curios API/Trinkets API to add 20+ news rings to your minecraft.
https://www.curseforge.com/minecraft/mc-mods/rings-of-ascension
MIT License
13 stars 10 forks source link

Your health does not update immediately if you unequip the `Ring of Max Health` #84

Closed SiverDX closed 1 year ago

SiverDX commented 1 year ago

This affects regenerated hearts (empty hearts get removed) It seems they only update if somethings happens to your health (e. g. you take damage)

Adding something like this in ItemRingHealth.java fixes the problem

@Override
public void onUnequippedCurio(String identifier, LivingEntity livingEntity) {
    if (livingEntity.getHealth() > livingEntity.getMaxHealth()) {
        livingEntity.setHealth(livingEntity.getMaxHealth());
    }
}

(Referenced from https://github.com/ochotonida/artifacts/blob/1.19.x/src/main/java/artifacts/item/wearable/belt/CrystalHeartItem.java)

focamacho commented 1 year ago

Thank you very much for pointing this out!