clamp progress just in case

This commit is contained in:
TropheusJ 2025-02-25 19:22:52 -05:00
parent db6d1fdcf9
commit fbbed0893e

View file

@ -18,9 +18,11 @@ public abstract class PercentOrProgressBarDisplaySource extends NumericSingleLin
@Override
protected MutableComponent provideLine(DisplayLinkContext context, DisplayTargetStats stats) {
Float currentLevel = getProgress(context);
if (currentLevel == null)
Float rawProgress = this.getProgress(context);
if (rawProgress == null)
return EMPTY_LINE;
// clamp just in case - #7371
float currentLevel = Mth.clamp(rawProgress, 0, 1);
if (!progressBarActive(context))
return formatNumeric(context, currentLevel);