Java Code Examples for org.bukkit.conversations.Conversation#abandon()

The following examples show how to use org.bukkit.conversations.Conversation#abandon() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SSHDConversationTracker.java    From Bukkit-SSHD with Apache License 2.0 6 votes vote down vote up
synchronized void abandonConversation(Conversation conversation, ConversationAbandonedEvent details) {
    if (!this.conversationQueue.isEmpty()) {
        if (this.conversationQueue.getFirst() == conversation) {
            conversation.abandon(details);
        }

        if (this.conversationQueue.contains(conversation)) {
            this.conversationQueue.remove(conversation);
        }

        if (!this.conversationQueue.isEmpty()) {
            this.conversationQueue.getFirst().outputNextPrompt();
        }
    }

}
 
Example 2
Source File: ConversationTracker.java    From Kettle with GNU General Public License v3.0 5 votes vote down vote up
public synchronized void abandonConversation(Conversation conversation, ConversationAbandonedEvent details) {
    if (!conversationQueue.isEmpty()) {
        if (conversationQueue.getFirst() == conversation) {
            conversation.abandon(details);
        }
        if (conversationQueue.contains(conversation)) {
            conversationQueue.remove(conversation);
        }
        if (!conversationQueue.isEmpty()) {
            conversationQueue.getFirst().outputNextPrompt();
        }
    }
}
 
Example 3
Source File: ConversationTracker.java    From Kettle with GNU General Public License v3.0 5 votes vote down vote up
public synchronized void abandonAllConversations() {

        LinkedList<Conversation> oldQueue = conversationQueue;
        conversationQueue = new LinkedList<Conversation>();
        for (Conversation conversation : oldQueue) {
            try {
                conversation.abandon(new ConversationAbandonedEvent(conversation, new ManuallyAbandonedConversationCanceller()));
            } catch (Throwable t) {
                Bukkit.getLogger().log(Level.SEVERE, "Unexpected exception while abandoning a conversation", t);
            }
        }
    }
 
Example 4
Source File: ConversationTracker.java    From Thermos with GNU General Public License v3.0 5 votes vote down vote up
public synchronized void abandonConversation(Conversation conversation, ConversationAbandonedEvent details) {
    if (!conversationQueue.isEmpty()) {
        if (conversationQueue.getFirst() == conversation) {
            conversation.abandon(details);
        }
        if (conversationQueue.contains(conversation)) {
            conversationQueue.remove(conversation);
        }
        if (!conversationQueue.isEmpty()) {
            conversationQueue.getFirst().outputNextPrompt();
        }
    }
}
 
Example 5
Source File: ConversationTracker.java    From Thermos with GNU General Public License v3.0 5 votes vote down vote up
public synchronized void abandonAllConversations() {

        LinkedList<Conversation> oldQueue = conversationQueue;
        conversationQueue = new LinkedList<Conversation>();
        for(Conversation conversation : oldQueue) {
            try {
            conversation.abandon(new ConversationAbandonedEvent(conversation, new ManuallyAbandonedConversationCanceller()));
            } catch (Throwable t) {
                Bukkit.getLogger().log(Level.SEVERE, "Unexpected exception while abandoning a conversation", t);
            }
        }
    }
 
Example 6
Source File: SSHDConversationTracker.java    From Bukkit-SSHD with Apache License 2.0 5 votes vote down vote up
public synchronized void abandonAllConversations() {
    LinkedList<Conversation> oldQueue = this.conversationQueue;
    this.conversationQueue = new LinkedList<>();

    for (Conversation conversation : oldQueue) {
        try {
            conversation.abandon(new ConversationAbandonedEvent(conversation, new ManuallyAbandonedConversationCanceller()));
        } catch (Throwable var5) {
            Bukkit.getLogger().log(Level.SEVERE, "Unexpected exception while abandoning a conversation", var5);
        }
    }

}