mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-25 12:25:46 +01:00
Don't display plot rating placeholder in scientific notation
Fixes #3091
This commit is contained in:
parent
eb11d9e3aa
commit
60c701d20b
@ -45,6 +45,8 @@ import net.kyori.adventure.text.minimessage.MiniMessage;
|
|||||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.math.RoundingMode;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
@ -182,7 +184,12 @@ public final class PlaceholderRegistry {
|
|||||||
if (Double.isNaN(plot.getAverageRating())) {
|
if (Double.isNaN(plot.getAverageRating())) {
|
||||||
return legacyComponent(TranslatableCaption.of("placeholder.nan"), player);
|
return legacyComponent(TranslatableCaption.of("placeholder.nan"), player);
|
||||||
}
|
}
|
||||||
return Double.toString(plot.getAverageRating());
|
BigDecimal roundRating = BigDecimal.valueOf(plot.getAverageRating()).setScale(2, RoundingMode.HALF_UP);
|
||||||
|
if (!Settings.General.SCIENTIFIC) {
|
||||||
|
return String.valueOf(roundRating);
|
||||||
|
} else {
|
||||||
|
return Double.toString(plot.getAverageRating());
|
||||||
|
}
|
||||||
});
|
});
|
||||||
this.createPlaceholder("currentplot_biome", (player, plot) -> plot.getBiomeSynchronous().toString());
|
this.createPlaceholder("currentplot_biome", (player, plot) -> plot.getBiomeSynchronous().toString());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user