TerraFirmaCraft

TerraFirmaCraft

2M Downloads

Damage source tooltip for "Immune to damage" is incorrect

alcatrazEscapee opened this issue ยท 0 comments

commented

final float multiplier = (1 - (float) Math.pow(Math.E, -0.01 * resistance)) * 100;
if (multiplier <= 0.000001)
{
return Helpers.translatable("tfc.tooltip.immune_to_damage");
}
return Helpers.literal(String.format("%.0f%%", multiplier));

This is a correct calculation, but since we already do 1.0 - (damage multiplier), the check for immune should be > 0.999999..., as a 1.0 would mean 100% which is immune.