use of io.github.nucleuspowered.nucleus.modules.message.handlers.MessageHandler in project Nucleus by NucleusPowered.
the class MessageModule method performEnableTasks.
@Override
public void performEnableTasks() {
createSeenModule(SocialSpyCommand.class, (cs, user) -> {
MessageHandler handler = Nucleus.getNucleus().getInternalServiceManager().getServiceUnchecked(MessageHandler.class);
boolean socialSpy = handler.isSocialSpy(user);
boolean msgToggle = Nucleus.getNucleus().getUserDataManager().get(user).map(y -> y.get(MessageUserDataModule.class).isMsgToggle()).orElse(true);
MessageProvider mp = plugin.getMessageProvider();
List<Text> lt = Lists.newArrayList(mp.getTextMessageWithFormat("seen.socialspy", mp.getMessageWithFormat("standard.yesno." + Boolean.toString(socialSpy).toLowerCase())));
getConfigAdapter().ifPresent(x -> lt.add(mp.getTextMessageWithFormat("seen.socialspylevel", String.valueOf(Util.getPositiveIntOptionFromSubject(user, MessageHandler.socialSpyOption).orElse(0)))));
lt.add(mp.getTextMessageWithFormat("seen.msgtoggle", mp.getMessageWithFormat("standard.yesno." + Boolean.toString(msgToggle).toLowerCase())));
return lt;
});
}
Aggregations