mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-25 14:46:45 +01:00
Beautify placeholder output for '*' permission
This commit is contained in:
parent
867826759b
commit
bf20b0dd79
@ -78,7 +78,12 @@ public final class PlaceholderRegistry {
|
|||||||
});
|
});
|
||||||
this.createPlaceholder("currentplot_world", player -> player.getLocation().getWorldName());
|
this.createPlaceholder("currentplot_world", player -> player.getLocation().getWorldName());
|
||||||
this.createPlaceholder("has_plot", player -> player.getPlotCount() > 0 ? "true" : "false");
|
this.createPlaceholder("has_plot", player -> player.getPlotCount() > 0 ? "true" : "false");
|
||||||
this.createPlaceholder("allowed_plot_count", player -> Integer.toString(player.getAllowedPlots()));
|
this.createPlaceholder("allowed_plot_count", (player) -> {
|
||||||
|
if (player.getAllowedPlots() >= Integer.MAX_VALUE) { // Beautifies cases with '*' permission
|
||||||
|
return String.valueOf(TranslatableCaption.of("info.infinite"));
|
||||||
|
}
|
||||||
|
return Integer.toString(player.getAllowedPlots());
|
||||||
|
});
|
||||||
this.createPlaceholder("plot_count", player -> Integer.toString(player.getPlotCount()));
|
this.createPlaceholder("plot_count", player -> Integer.toString(player.getPlotCount()));
|
||||||
this.createPlaceholder("currentplot_alias", (player, plot) -> {
|
this.createPlaceholder("currentplot_alias", (player, plot) -> {
|
||||||
if (plot.getAlias() == null) {
|
if (plot.getAlias() == null) {
|
||||||
@ -94,7 +99,8 @@ public final class PlaceholderRegistry {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
return PlayerManager.getName(plotOwner, false);
|
return PlayerManager.getName(plotOwner, false);
|
||||||
} catch (final Exception ignored) {}
|
} catch (final Exception ignored) {
|
||||||
|
}
|
||||||
|
|
||||||
return String.valueOf(TranslatableCaption.of("info.unknown"));
|
return String.valueOf(TranslatableCaption.of("info.unknown"));
|
||||||
});
|
});
|
||||||
|
@ -377,6 +377,7 @@
|
|||||||
"info.unknown": "<gray>Unknown</gray>",
|
"info.unknown": "<gray>Unknown</gray>",
|
||||||
"info.server": "<gray>Server</gray>",
|
"info.server": "<gray>Server</gray>",
|
||||||
"info.everyone": "<gray>Everyone</gray>",
|
"info.everyone": "<gray>Everyone</gray>",
|
||||||
|
"info.infinite": "<gray>Infinite</gray>",
|
||||||
"info.plot_unowned": "<prefix><gray>The current plot must have an owner to perform this action.</gray>",
|
"info.plot_unowned": "<prefix><gray>The current plot must have an owner to perform this action.</gray>",
|
||||||
"info.plot_info_unclaimed": "<prefix><gray>Plot <gold><plot></gold> is not yet claimed.</gray>",
|
"info.plot_info_unclaimed": "<prefix><gray>Plot <gold><plot></gold> is not yet claimed.</gray>",
|
||||||
"info.plot_info_header": "<dark_gray><strikethrough>--------- <reset><gold>INFO </gold><dark_gray><strikethrough>---------</dark_gray><reset>",
|
"info.plot_info_header": "<dark_gray><strikethrough>--------- <reset><gold>INFO </gold><dark_gray><strikethrough>---------</dark_gray><reset>",
|
||||||
|
Loading…
Reference in New Issue
Block a user