use of org.bukkit.conversations.Conversable in project MagicPlugin by elBukkit.
the class CommandAction method runConversations.
private void runConversations(CastContext context, Queue<String> commands, boolean opPlayer) {
CommandSender sender = context.getMage().getCommandSender();
if (!(sender instanceof Conversable)) {
return;
}
Conversable conversable = (Conversable) sender;
ArgumentsPrompt argumentsPrompt = new ArgumentsPrompt(context, sender, commands, opPlayer);
ConversationFactory factory = new ConversationFactory(context.getController().getPlugin());
factory.withLocalEcho(localEcho).withModality(modal).withFirstPrompt(argumentsPrompt);
if (timeout > 0) {
factory.withTimeout(timeout);
}
if (!escapeSequence.isEmpty()) {
factory.withEscapeSequence(escapeSequence);
}
conversable.beginConversation(factory.buildConversation(conversable));
}
Aggregations