use of io.github.nucleuspowered.nucleus.modules.note.data.NoteData in project Nucleus by NucleusPowered.
the class ClearNotesCommand method executeCommand.
@Override
public CommandResult executeCommand(CommandSource src, CommandContext args) throws Exception {
User user = args.<User>getOne(playerKey).get();
List<NoteData> notes = handler.getNotesInternal(user);
if (notes.isEmpty()) {
src.sendMessage(plugin.getMessageProvider().getTextMessageWithFormat("command.checknotes.none", user.getName()));
return CommandResult.success();
}
if (handler.clearNotes(user)) {
src.sendMessage(plugin.getMessageProvider().getTextMessageWithFormat("command.clearnotes.success", user.getName()));
return CommandResult.success();
}
src.sendMessage(plugin.getMessageProvider().getTextMessageWithFormat("command.clearnotes.failure", user.getName()));
return CommandResult.empty();
}
Aggregations