Search in sources :

Example 1 with NucleusTextTemplateMessageSender

use of io.github.nucleuspowered.nucleus.internal.text.NucleusTextTemplateMessageSender in project Nucleus by NucleusPowered.

the class BroadcastCommand method executeCommand.

@Override
public CommandResult executeCommand(CommandSource src, CommandContext args) throws Exception {
    String m = args.<String>getOne(message).get();
    NucleusTextTemplate textTemplate = NucleusTextTemplateFactory.createFromAmpersandString(m);
    Text p = bc.getPrefix().getForCommandSource(src);
    Text s = bc.getSuffix().getForCommandSource(src);
    new NucleusTextTemplateMessageSender(textTemplate, src, t -> TextParsingUtils.joinTextsWithColoursFlowing(p, t, s)).send();
    return CommandResult.success();
}
Also used : NoModifiers(io.github.nucleuspowered.nucleus.internal.annotations.command.NoModifiers) NucleusTextTemplateFactory(io.github.nucleuspowered.nucleus.internal.text.NucleusTextTemplateFactory) CommandResult(org.spongepowered.api.command.CommandResult) RegisterCommand(io.github.nucleuspowered.nucleus.internal.annotations.command.RegisterCommand) RemainingStringsArgument(io.github.nucleuspowered.nucleus.argumentparsers.RemainingStringsArgument) AdminConfig(io.github.nucleuspowered.nucleus.modules.admin.config.AdminConfig) CommandSource(org.spongepowered.api.command.CommandSource) AdminConfigAdapter(io.github.nucleuspowered.nucleus.modules.admin.config.AdminConfigAdapter) TextParsingUtils(io.github.nucleuspowered.nucleus.internal.text.TextParsingUtils) NonnullByDefault(org.spongepowered.api.util.annotation.NonnullByDefault) AdminModule(io.github.nucleuspowered.nucleus.modules.admin.AdminModule) CommandElement(org.spongepowered.api.command.args.CommandElement) GenericArguments(org.spongepowered.api.command.args.GenericArguments) RunAsync(io.github.nucleuspowered.nucleus.internal.annotations.RunAsync) Reloadable(io.github.nucleuspowered.nucleus.internal.interfaces.Reloadable) AbstractCommand(io.github.nucleuspowered.nucleus.internal.command.AbstractCommand) CommandContext(org.spongepowered.api.command.args.CommandContext) Text(org.spongepowered.api.text.Text) NucleusTextTemplate(io.github.nucleuspowered.nucleus.api.text.NucleusTextTemplate) NucleusTextTemplateMessageSender(io.github.nucleuspowered.nucleus.internal.text.NucleusTextTemplateMessageSender) BroadcastConfig(io.github.nucleuspowered.nucleus.modules.admin.config.BroadcastConfig) EssentialsEquivalent(io.github.nucleuspowered.nucleus.internal.docgen.annotations.EssentialsEquivalent) Permissions(io.github.nucleuspowered.nucleus.internal.annotations.command.Permissions) NucleusTextTemplateMessageSender(io.github.nucleuspowered.nucleus.internal.text.NucleusTextTemplateMessageSender) NucleusTextTemplate(io.github.nucleuspowered.nucleus.api.text.NucleusTextTemplate) Text(org.spongepowered.api.text.Text)

Aggregations

NucleusTextTemplate (io.github.nucleuspowered.nucleus.api.text.NucleusTextTemplate)1 RemainingStringsArgument (io.github.nucleuspowered.nucleus.argumentparsers.RemainingStringsArgument)1 RunAsync (io.github.nucleuspowered.nucleus.internal.annotations.RunAsync)1 NoModifiers (io.github.nucleuspowered.nucleus.internal.annotations.command.NoModifiers)1 Permissions (io.github.nucleuspowered.nucleus.internal.annotations.command.Permissions)1 RegisterCommand (io.github.nucleuspowered.nucleus.internal.annotations.command.RegisterCommand)1 AbstractCommand (io.github.nucleuspowered.nucleus.internal.command.AbstractCommand)1 EssentialsEquivalent (io.github.nucleuspowered.nucleus.internal.docgen.annotations.EssentialsEquivalent)1 Reloadable (io.github.nucleuspowered.nucleus.internal.interfaces.Reloadable)1 NucleusTextTemplateFactory (io.github.nucleuspowered.nucleus.internal.text.NucleusTextTemplateFactory)1 NucleusTextTemplateMessageSender (io.github.nucleuspowered.nucleus.internal.text.NucleusTextTemplateMessageSender)1 TextParsingUtils (io.github.nucleuspowered.nucleus.internal.text.TextParsingUtils)1 AdminModule (io.github.nucleuspowered.nucleus.modules.admin.AdminModule)1 AdminConfig (io.github.nucleuspowered.nucleus.modules.admin.config.AdminConfig)1 AdminConfigAdapter (io.github.nucleuspowered.nucleus.modules.admin.config.AdminConfigAdapter)1 BroadcastConfig (io.github.nucleuspowered.nucleus.modules.admin.config.BroadcastConfig)1 CommandResult (org.spongepowered.api.command.CommandResult)1 CommandSource (org.spongepowered.api.command.CommandSource)1 CommandContext (org.spongepowered.api.command.args.CommandContext)1 CommandElement (org.spongepowered.api.command.args.CommandElement)1