mirror of
https://github.com/Creators-of-Create/Create.git
synced 2025-03-04 06:44:40 +01:00
clamp progress just in case
This commit is contained in:
parent
db6d1fdcf9
commit
fbbed0893e
1 changed files with 4 additions and 2 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue