feat: Allow plot alias in title (#3273)

Fixes #3171
This commit is contained in:
NotMyFault 2021-10-07 10:07:13 +02:00 committed by GitHub
parent 13bc231091
commit 7ee46be2ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -322,12 +322,13 @@ public class PlotListener {
Template plotTemplate = Template.of("plot", lastPlot.getId().toString()); Template plotTemplate = Template.of("plot", lastPlot.getId().toString());
Template worldTemplate = Template.of("world", player.getLocation().getWorldName()); Template worldTemplate = Template.of("world", player.getLocation().getWorldName());
Template ownerTemplate = Template.of("owner", owner); Template ownerTemplate = Template.of("owner", owner);
Template aliasTemplate = Template.of("alias", plot.getAlias());
final Consumer<String> userConsumer = user -> { final Consumer<String> userConsumer = user -> {
if (Settings.Titles.TITLES_AS_ACTIONBAR) { if (Settings.Titles.TITLES_AS_ACTIONBAR) {
player.sendActionBar(header, plotTemplate, worldTemplate, ownerTemplate); player.sendActionBar(header, aliasTemplate, plotTemplate, worldTemplate, ownerTemplate);
} else { } else {
player.sendTitle(header, subHeader, plotTemplate, worldTemplate, ownerTemplate); player.sendTitle(header, subHeader, aliasTemplate, plotTemplate, worldTemplate, ownerTemplate);
} }
}; };