feat: add placeholder for plot size

- PlaceholderRegistry and for /plot list entries
 - fixes #4149
This commit is contained in:
dordsor21 2023-09-30 16:39:01 +01:00
parent e138dc0267
commit e5a4026a2a
No known key found for this signature in database
GPG Key ID: 1E53E88969FFCF0B
2 changed files with 2 additions and 0 deletions

View File

@ -517,6 +517,7 @@ public class ListCmd extends SubCommand {
}
}
finalResolver.tag("players", Tag.inserting(builder.asComponent()));
finalResolver.tag("size", Tag.inserting(Component.text(plot.getConnectedPlots().size())));
caption.set(TranslatableCaption.of("info.plot_list_item"));
caption.setTagResolvers(finalResolver.build());
}

View File

@ -187,6 +187,7 @@ public final class PlaceholderRegistry {
}
});
this.createPlaceholder("currentplot_biome", (player, plot) -> plot.getBiomeSynchronous().toString());
this.createPlaceholder("currentplot_size", (player, plot) -> String.valueOf(plot.getConnectedPlots().size()));
}
/**