mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-21 12:46:46 +01:00
Don't open the component GUI if the actor has no permission for a specific preset (#3496)
* fix: Handle an empty component GUI gracefully * Address comments
This commit is contained in:
parent
34f005c244
commit
d7c8715b25
@ -181,6 +181,10 @@ public class ComponentPresetManager {
|
||||
}
|
||||
allowedPresets.add(componentPreset);
|
||||
}
|
||||
if (allowedPresets.isEmpty()) {
|
||||
player.sendMessage(TranslatableCaption.of("preset.empty"));
|
||||
return null;
|
||||
}
|
||||
final int size = (int) Math.ceil((double) allowedPresets.size() / 9.0D);
|
||||
final PlotInventory plotInventory = new PlotInventory(this.inventoryUtil, player, size,
|
||||
TranslatableCaption.of("preset.title").getComponent(player)) {
|
||||
|
@ -464,6 +464,7 @@
|
||||
"preset.preset_lore_economy_disabled": "<gray>Cost: </gray><red>Economy is disabled</red>",
|
||||
"preset.preset_lore_component": "<gray>Component: </gray><gold><component></gold>",
|
||||
"preset.title": "Plot Components",
|
||||
"preset.empty": "<prefix><red>No plot component presets available.</red>",
|
||||
"preset.economy_disabled": "<prefix><red>The component preset '<preset>' has a price set but economy is disabled.</red>",
|
||||
"generic.generic_other": "<gray>other</gray>",
|
||||
"generic.generic_merged": "<gray>merged</gray>",
|
||||
|
Loading…
Reference in New Issue
Block a user