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)); + } }); }