Search in sources :

Example 1 with Conversation

use of org.bukkit.conversations.Conversation in project Citizens2 by CitizensDev.

the class NPCCommandSelector method start.

public static void start(Callback callback, Conversable player, List<NPC> possible) {
    final Conversation conversation = new ConversationFactory(CitizensAPI.getPlugin()).withLocalEcho(false).withEscapeSequence("exit").withModality(false).withFirstPrompt(new NPCCommandSelector(callback, possible)).buildConversation(player);
    conversation.begin();
}
Also used : ConversationFactory(org.bukkit.conversations.ConversationFactory) Conversation(org.bukkit.conversations.Conversation)

Example 2 with Conversation

use of org.bukkit.conversations.Conversation in project TriggerReactor by wysohn.

the class ScriptEditManager method startEdit.

@Override
public void startEdit(ICommandSender sender, String title, String script, SaveHandler saveHandler) {
    ConversationFactory factory = new ConversationFactory(plugin.getMain());
    EditingPrompt prompt = new EditingPrompt(plugin.getMain(), sender.get(), new ScriptEditor(title, script, saveHandler));
    Conversation conv = factory.thatExcludesNonPlayersWithMessage("Sorry, this is in-game only feature!").withFirstPrompt(new UsagePrompt(prompt)).addConversationAbandonedListener(this).buildConversation(sender.get());
    conv.getContext().setSessionData("edit", prompt);
    conv.begin();
}
Also used : EditingPrompt(io.github.wysohn.triggerreactor.bukkit.tools.prompts.EditingPrompt) UsagePrompt(io.github.wysohn.triggerreactor.bukkit.tools.prompts.UsagePrompt) ConversationFactory(org.bukkit.conversations.ConversationFactory) Conversation(org.bukkit.conversations.Conversation) ScriptEditor(io.github.wysohn.triggerreactor.tools.ScriptEditor)

Example 3 with Conversation

use of org.bukkit.conversations.Conversation in project Citizens2 by CitizensDev.

the class Text method getEditor.

public Editor getEditor(final Player player) {
    final Conversation conversation = new ConversationFactory(plugin).addConversationAbandonedListener(this).withLocalEcho(false).withEscapeSequence("/npc text").withEscapeSequence("exit").withModality(false).withFirstPrompt(new TextStartPrompt(this)).buildConversation(player);
    return new Editor() {

        @Override
        public void begin() {
            Messaging.sendTr(player, Messages.TEXT_EDITOR_BEGIN);
            conversation.begin();
        }

        @Override
        public void end() {
            Messaging.sendTr(player, Messages.TEXT_EDITOR_END);
            conversation.abandon();
        }
    };
}
Also used : ConversationFactory(org.bukkit.conversations.ConversationFactory) Conversation(org.bukkit.conversations.Conversation) Editor(net.citizensnpcs.editor.Editor)

Example 4 with Conversation

use of org.bukkit.conversations.Conversation in project Citizens2 by CitizensDev.

the class TriggerEditPrompt method start.

public static Conversation start(Player player, WaypointEditor editor) {
    final Conversation conversation = new ConversationFactory(CitizensAPI.getPlugin()).withLocalEcho(false).withEscapeSequence("exit").withEscapeSequence("triggers").withEscapeSequence("/npc path").withModality(false).withFirstPrompt(new TriggerEditPrompt(editor)).buildConversation(player);
    conversation.begin();
    return conversation;
}
Also used : ConversationFactory(org.bukkit.conversations.ConversationFactory) Conversation(org.bukkit.conversations.Conversation)

Aggregations

Conversation (org.bukkit.conversations.Conversation)4 ConversationFactory (org.bukkit.conversations.ConversationFactory)4 EditingPrompt (io.github.wysohn.triggerreactor.bukkit.tools.prompts.EditingPrompt)1 UsagePrompt (io.github.wysohn.triggerreactor.bukkit.tools.prompts.UsagePrompt)1 ScriptEditor (io.github.wysohn.triggerreactor.tools.ScriptEditor)1 Editor (net.citizensnpcs.editor.Editor)1