Blood Magic

Blood Magic

94M Downloads

Living Armor fire protection only cools down when on fire

CplPibald opened this issue ยท 0 comments

commented

Issue Description:

The cooldown timer for Living Armor's fire protection only runs while the player is on fire.
(And yes, I appreciate the irony of this issue title)

Steps to reproduce:

  • Wear living armor with fire protection
  • Catch fire. Note you get a fire protection buff
  • Wait an arbitrary amount of time (longer than the cooldown)
  • Catch fire again.

What happens:

No protection buff. Player takes fire damage. Once player has spent a cumulative total time on fire to match the cooldown, the protection will trigger again.

What you expected to happen:

The poison resistance armor ability cools down even when you're not poisoned. So if you trigger the ability, then wait a while and get poisoned again, the armor protects you the second time. Fire protection should work like this.

Affected Versions (Do not use "latest"):

  • BloodMagic: Verified on 1.16.4-3.1.0-15 and 1.16.4-3.1.1-16
  • Minecraft: 1.16.5
  • Forge: 1.16.5-36.1.0

Analysis

Using an NBT viewer on the armor, I found that the fire_cooldown NBT tag only counts down while the player is on fire. If the fire goes out (timer expires or player touches water) the fire_cooldown tag freezes. It continues counting down next time the player is on fire.

I think the problem is here: https://github.com/WayofTime/BloodMagic/blob/1.16.3/src/main/java/wayoftime/bloodmagic/util/handler/event/GenericHandler.java#L439

All of the cooldown code is wrapped inside of the if (player.getFireTimer() > 0) block. The only code that should be inside that black is the applyNewExperience call. See the poison handling code a few lines below for what I think is the correct implementation.