diff --git a/Core/src/main/java/com/plotsquared/core/util/placeholders/PlaceholderRegistry.java b/Core/src/main/java/com/plotsquared/core/util/placeholders/PlaceholderRegistry.java index 86053a826..1015442df 100644 --- a/Core/src/main/java/com/plotsquared/core/util/placeholders/PlaceholderRegistry.java +++ b/Core/src/main/java/com/plotsquared/core/util/placeholders/PlaceholderRegistry.java @@ -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()); } diff --git a/Core/src/main/resources/lang/messages_en.json b/Core/src/main/resources/lang/messages_en.json index 06c740a9d..01e02e323 100644 --- a/Core/src/main/resources/lang/messages_en.json +++ b/Core/src/main/resources/lang/messages_en.json @@ -187,6 +187,7 @@ "core.prefix": "[P2] ", "core.enabled": " is now enabled.", "placeholder.hooked": "PlotSquared hooked into MVdWPlaceholderAPI", + "placeholder.nan": "Not a number", "reload.reloaded_configs": "Translations and world settings have been reloaded successfully.", "reload.reload_failed": "Failed to reload file configurations.", "desc.desc_set": "Plot description set.",