use of io.github.nucleuspowered.nucleus.modules.commandspy.datamodules.CommandSpyUserDataModule in project Nucleus by NucleusPowered.
the class CommandSpyCommand method executeCommand.
@Override
public CommandResult executeCommand(Player src, CommandContext args) throws Exception {
ModularUserService service = Nucleus.getNucleus().getUserDataManager().getUnchecked(src);
CommandSpyUserDataModule c = service.get(CommandSpyUserDataModule.class);
boolean to = args.<Boolean>getOne(truefalse).orElseGet(() -> !c.isCommandSpy());
c.setCommandSpy(to);
MessageProvider mp = plugin.getMessageProvider();
src.sendMessage(mp.getTextMessageWithFormat("command.commandspy.success", mp.getMessageWithFormat(to ? "standard.enabled" : "standard.disabled")));
return CommandResult.success();
}
Aggregations