use of io.github.nucleuspowered.nucleus.modules.message.events.InternalNucleusHelpOpEvent in project Nucleus by NucleusPowered.
the class HelpOpCommand method executeCommand.
@Override
public CommandResult executeCommand(Player src, CommandContext args) throws Exception {
String message = args.<String>getOne(messageKey).get();
// that's that.
if (Sponge.getEventManager().post(new InternalNucleusHelpOpEvent(src, message))) {
src.sendMessage(plugin.getMessageProvider().getTextMessageWithFormat("message.cancel"));
return CommandResult.empty();
}
Text prefix = messageConfig.getHelpOpPrefix().getForCommandSource(src);
new PermissionMessageChannel(permissions.getPermissionWithSuffix("receive")).send(src, TextParsingUtils.joinTextsWithColoursFlowing(prefix, Text.of(message)));
src.sendMessage(plugin.getMessageProvider().getTextMessageWithFormat("command.helpop.success"));
return CommandResult.success();
}
Aggregations