use of com.velocitypowered.api.plugin.PluginDescription in project Chocolate by GiansCode.
the class ChocolateInfoCommand method perform.
@Override
public void perform(CommandSource commandSource, String[] args) {
StringBuilder commandBuilder = new StringBuilder();
for (ChocolateCommand chocolateCommand : this.chocolatePlugin.getCommandRegister().getChocolateCommands()) {
commandBuilder.append(StringUtils.getInstance().replacePlaceholders(Lang.COMMAND$CHOCOLATE$COMMAND_FORMAT.getString(), "%usage%", chocolateCommand.usage, "%description%", chocolateCommand.description)).append("\n");
}
Optional<PluginContainer> optional = chocolatePlugin.getServer().getPluginManager().getPlugin("chocolate");
if (!optional.isPresent())
return;
PluginDescription pluginDescription = optional.get().getDescription();
sendMessage(commandSource, StringUtils.getInstance().replacePlaceholders(Lang.COMMAND$CHOCOLATE$MSG.getString(), "%authors%", String.join(", ", pluginDescription.getAuthors()), "%commands%", commandBuilder.toString()));
}
use of com.velocitypowered.api.plugin.PluginDescription in project LibertyBans by A248.
the class VelocityCulpritFinderTest method setDescription.
private static void setDescription(PluginContainer pluginMock, String id, String version) {
PluginDescription description = mock(PluginDescription.class);
when(description.getId()).thenReturn(id);
when(description.getVersion()).thenAnswer((i) -> Optional.of(version));
when(pluginMock.getDescription()).thenReturn(description);
}
Aggregations