Skip to content

Commit

Permalink
Add list plugins command
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexProgrammerDE committed Nov 13, 2024
1 parent 4968c18 commit f951615
Showing 1 changed file with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,33 @@ public void postConstruct() {

return Command.SINGLE_SUCCESS;
})));
dispatcher.register(
literal("plugins")
.executes(
help(
"Show all installed plugins",
c -> {
var extensions = SoulFireAPI.getServerExtensions();
if (extensions.isEmpty()) {
c.getSource().sendWarn("No plugins found!");
return Command.SINGLE_SUCCESS;
}

extensions.forEach(
plugin -> {
var pluginInfo = plugin.pluginInfo();
c.getSource()
.sendInfo(
"Plugin: {} | Version: {} | Description: {} | Author: {} | License: {}",
pluginInfo.id(),
pluginInfo.version(),
pluginInfo.description(),
pluginInfo.author(),
pluginInfo.license());
});

return Command.SINGLE_SUCCESS;
})));

// Pathfinding
dispatcher.register(
Expand Down

0 comments on commit f951615

Please sign in to comment.