@@ -204,6 +204,9 @@ private void registerDefault() {
204204 this .createPlaceholder ("currentplot_x" , (player , plot ) -> Integer .toString (plot .getId ().getX ()));
205205 this .createPlaceholder ("currentplot_y" , (player , plot ) -> Integer .toString (plot .getId ().getY ()));
206206 this .createPlaceholder ("currentplot_xy" , (player , plot ) -> plot .getId ().toString ());
207+ this .createPlaceholder ("currentplot_abs_x" , (player , plot ) -> Integer .toString (plot .getId ().getX ()), true );
208+ this .createPlaceholder ("currentplot_abs_y" , (player , plot ) -> Integer .toString (plot .getId ().getY ()), true );
209+ this .createPlaceholder ("currentplot_abs_xy" , (player , plot ) -> plot .getId ().toString (), true );
207210 this .createPlaceholder ("currentplot_rating" , (player , plot ) -> {
208211 if (Double .isNaN (plot .getAverageRating ())) {
209212 return legacyComponent (TranslatableCaption .of ("placeholder.nan" ), player );
@@ -253,7 +256,23 @@ public void createPlaceholder(
253256 final @ NonNull String key ,
254257 final @ NonNull BiFunction <PlotPlayer <?>, Plot , String > placeholderFunction
255258 ) {
256- this .registerPlaceholder (new PlotSpecificPlaceholder (key ) {
259+ this .createPlaceholder (key , placeholderFunction , false );
260+ }
261+
262+ /**
263+ * Create a functional placeholder
264+ *
265+ * @param key Placeholder key
266+ * @param placeholderFunction Placeholder generator. Cannot return null
267+ * @param requireAbsolute If the plot given to the placeholder should be the absolute (not base) plot
268+ * @since TODO
269+ */
270+ public void createPlaceholder (
271+ final @ NonNull String key ,
272+ final @ NonNull BiFunction <PlotPlayer <?>, Plot , String > placeholderFunction ,
273+ final boolean requireAbsolute
274+ ) {
275+ this .registerPlaceholder (new PlotSpecificPlaceholder (key , requireAbsolute ) {
257276 @ Override
258277 public @ NonNull String getValue (final @ NonNull PlotPlayer <?> player , final @ NonNull Plot plot ) {
259278 return placeholderFunction .apply (player , plot );
0 commit comments