mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-21 11:45:19 +01:00
Make "NaN" in placeholders translatable
This commit is contained in:
parent
f0cbc4f23e
commit
942d799c9c
@ -178,7 +178,12 @@ public final class PlaceholderRegistry {
|
||||
this.createPlaceholder("currentplot_x", (player, plot) -> Integer.toString(plot.getId().getX()));
|
||||
this.createPlaceholder("currentplot_y", (player, plot) -> Integer.toString(plot.getId().getY()));
|
||||
this.createPlaceholder("currentplot_xy", (player, plot) -> plot.getId().toString());
|
||||
this.createPlaceholder("currentplot_rating", (player, plot) -> Double.toString(plot.getAverageRating()));
|
||||
this.createPlaceholder("currentplot_rating", (player, plot) -> {
|
||||
if (Double.isNaN(plot.getAverageRating())) {
|
||||
return legacyComponent(TranslatableCaption.of("placeholder.nan"), player);
|
||||
}
|
||||
return Double.toString(plot.getAverageRating());
|
||||
});
|
||||
this.createPlaceholder("currentplot_biome", (player, plot) -> plot.getBiomeSynchronous().toString());
|
||||
}
|
||||
|
||||
|
@ -187,6 +187,7 @@
|
||||
"core.prefix": "<dark_gray>[</dark_gray><gold>P2</gold><dark_gray>] </dark_gray>",
|
||||
"core.enabled": "<prefix><gold><value> is now enabled.</gold>",
|
||||
"placeholder.hooked": "<prefix><gold>PlotSquared hooked into MVdWPlaceholderAPI</gold>",
|
||||
"placeholder.nan": "Not a number",
|
||||
"reload.reloaded_configs": "<prefix><gold>Translations and world settings have been reloaded successfully.</gold>",
|
||||
"reload.reload_failed": "<prefix><red>Failed to reload file configurations.</red>",
|
||||
"desc.desc_set": "<prefix><gray>Plot description set.</gray>",
|
||||
|
Loading…
Reference in New Issue
Block a user