From 277081231db6b0802efe75da7f7014ff976c8c78 Mon Sep 17 00:00:00 2001 From: Alexander Brandes Date: Sat, 30 Mar 2024 10:43:56 +0100 Subject: [PATCH] Address feedback Signed-off-by: Alexander Brandes --- .../core/util/placeholders/PlaceholderRegistry.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 e7b33c92d..6892d6787 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 @@ -200,8 +200,9 @@ public final class PlaceholderRegistry { this.createPlaceholder("currentplot_biome", (player, plot) -> plot.getBiomeSynchronous().toString()); this.createPlaceholder("currentplot_size", (player, plot) -> String.valueOf(plot.getConnectedPlots().size())); this.createPlaceholder("total_grants", player -> { - final MetaDataAccess metaDataAccess = player.accessPersistentMetaData(PlayerMetaDataKeys.PERSISTENT_GRANTED_PLOTS); - return Integer.toString(metaDataAccess.get().orElse(0)); + try (final MetaDataAccess metaDataAccess = player.accessPersistentMetaData(PlayerMetaDataKeys.PERSISTENT_GRANTED_PLOTS)) { + return Integer.toString(metaDataAccess.get().orElse(0)); + } }); }