Search in sources :

Example 1 with NoteHandler

use of io.github.nucleuspowered.nucleus.modules.note.handlers.NoteHandler in project Nucleus by NucleusPowered.

the class NoteModule method performEnableTasks.

@Override
public void performEnableTasks() {
    // Take base permission from /checknotes.
    createSeenModule(CheckNotesCommand.class, (c, u) -> {
        NoteHandler jh = plugin.getInternalServiceManager().getServiceUnchecked(NoteHandler.class);
        int active = jh.getNotesInternal(u).size();
        Text r = plugin.getMessageProvider().getTextMessageWithFormat("seen.notes", String.valueOf(active));
        if (active > 0) {
            return Lists.newArrayList(r.toBuilder().onClick(TextActions.runCommand("/checknotes " + u.getName())).onHover(TextActions.showText(plugin.getMessageProvider().getTextMessageWithFormat("standard.clicktoseemore"))).build());
        }
        return Lists.newArrayList(r);
    });
}
Also used : Text(org.spongepowered.api.text.Text) NoteHandler(io.github.nucleuspowered.nucleus.modules.note.handlers.NoteHandler)

Aggregations

NoteHandler (io.github.nucleuspowered.nucleus.modules.note.handlers.NoteHandler)1 Text (org.spongepowered.api.text.Text)1