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();
}
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();
}
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();
}
};
}
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;
}
Aggregations