Add a few more conveinence helpers to the API

This commit is contained in:
2026-05-19 13:30:49 -04:00
parent 8a6c695e10
commit 3eec245b6a
2 changed files with 42 additions and 0 deletions
@@ -179,6 +179,12 @@ public abstract class PlexCommand extends Command
return requireRuntime().messageComponent(s, objects);
}
@Override
public Component permissionMessage()
{
return messageComponent("noPermissionNode", getPermission());
}
protected String messageString(String s, Object... objects)
{
return requireRuntime().messageString(s, objects);
@@ -237,6 +243,21 @@ public abstract class PlexCommand extends Command
return requireRuntime().miniMessage(s);
}
protected void broadcast(String miniMessage)
{
requireRuntime().broadcast(miniMessage);
}
protected void broadcast(Component component)
{
requireRuntime().broadcast(component);
}
protected List<String> onlinePlayerNames()
{
return requireRuntime().onlinePlayerNames();
}
public CommandMap getMap()
{
return Bukkit.getCommandMap();
@@ -258,5 +279,8 @@ public abstract class PlexCommand extends Command
Component messageComponent(String entry, Component... objects);
String messageString(String entry, Object... objects);
Component miniMessage(String input);
void broadcast(String miniMessage);
void broadcast(Component component);
List<String> onlinePlayerNames();
}
}