Skip to content

Commit

Permalink
Cap tooltip on prot. modifiers at 80%
Browse files Browse the repository at this point in the history
Practically you should never reach that without changing limits, and the sum total cap is more important, but this is something
  • Loading branch information
KnightMiner committed May 23, 2022
1 parent 23137f0 commit c91e10b
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public void onEquip(IToolStackView tool, int level, EquipmentChangeContext conte
*/
public static void addResistanceTooltip(IncrementalModifier modifier, IToolStackView tool, int level, float multiplier, List<Component> tooltip) {
if (tool.hasTag(TinkerTags.Items.ARMOR)) {
tooltip.add(modifier.applyStyle(new TextComponent(Util.PERCENT_BOOST_FORMAT.format(modifier.getScaledLevel(tool, level) * multiplier / 25f))
tooltip.add(modifier.applyStyle(new TextComponent(Util.PERCENT_BOOST_FORMAT.format(Math.min(modifier.getScaledLevel(tool, level) * multiplier / 25f, 0.8f)))
.append(" ")
.append(new TranslatableComponent(modifier.getTranslationKey() + ".resistance"))));
}
Expand Down

0 comments on commit c91e10b

Please sign in to comment.