feat: add placeholder for plot size (#4181)

This commit is contained in:
Jordan 2023-10-02 20:37:00 +01:00 committed by GitHub
parent ee68bc3d9e
commit 26c55a318f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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()));
}
/**