當前位置: 首頁>>代碼示例>>Java>>正文


Java ConversationAbandonedEvent類代碼示例

本文整理匯總了Java中org.bukkit.conversations.ConversationAbandonedEvent的典型用法代碼示例。如果您正苦於以下問題:Java ConversationAbandonedEvent類的具體用法?Java ConversationAbandonedEvent怎麽用?Java ConversationAbandonedEvent使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ConversationAbandonedEvent類屬於org.bukkit.conversations包,在下文中一共展示了ConversationAbandonedEvent類的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: abandonConversation

import org.bukkit.conversations.ConversationAbandonedEvent; //導入依賴的package包/類
public 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()) {
            ((Conversation) this.conversationQueue.getFirst()).outputNextPrompt();
        }
    }

}
 
開發者ID:CyR1en,項目名稱:Minecordbot,代碼行數:17,代碼來源:ConvoTracker.java

示例2: abandonAllConversations

import org.bukkit.conversations.ConversationAbandonedEvent; //導入依賴的package包/類
public synchronized void abandonAllConversations() {
    LinkedList oldQueue = this.conversationQueue;
    this.conversationQueue = new LinkedList();
    Iterator var2 = oldQueue.iterator();

    while (var2.hasNext()) {
        Conversation conversation = (Conversation) var2.next();

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

}
 
開發者ID:CyR1en,項目名稱:Minecordbot,代碼行數:17,代碼來源:ConvoTracker.java

示例3: conversationAbandoned

import org.bukkit.conversations.ConversationAbandonedEvent; //導入依賴的package包/類
@Override
public void conversationAbandoned(ConversationAbandonedEvent event) {

    if (event.gracefulExit()) {
        event.getContext().getForWhom().sendRawMessage(Col.Grey() + "---------------------------");
        event.getContext().getForWhom().sendRawMessage(Col.Green() + "Setup Closed" + Col.Reset());
        event.getContext().getForWhom().sendRawMessage(Col.Grey() + "---------------------------");


    } else {
        if (event.getCanceller() instanceof InactivityConversationCanceller) {
            event.getContext().getForWhom().sendRawMessage(ChatColor.RED + "Conversation Timed Out");
            return;
        }
        if (event.getCanceller() instanceof ExactMatchConversationCanceller) {
            event.getContext().getForWhom().sendRawMessage(ChatColor.BLUE + "You have ended the conversation");
            return;
        }
        event.getContext().getForWhom().sendRawMessage(ChatColor.RED + event.getCanceller().toString());
    }
}
 
開發者ID:Relicum,項目名稱:SuperSkyBros,代碼行數:22,代碼來源:ConAbandonedEvent.java

示例4: abandonConversation

import org.bukkit.conversations.ConversationAbandonedEvent; //導入依賴的package包/類
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();
        }
    }
}
 
開發者ID:UraniumMC,項目名稱:Uranium,代碼行數:14,代碼來源:ConversationTracker.java

示例5: abandonAllConversations

import org.bukkit.conversations.ConversationAbandonedEvent; //導入依賴的package包/類
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);
            }
        }
    }
 
開發者ID:UraniumMC,項目名稱:Uranium,代碼行數:13,代碼來源:ConversationTracker.java

示例6: abandonAllConversations

import org.bukkit.conversations.ConversationAbandonedEvent; //導入依賴的package包/類
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);
            }
        }
    }
 
開發者ID:DevotedMC,項目名稱:ExilePearl,代碼行數:13,代碼來源:TestConversationTracker.java

示例7: abandonAllConversations

import org.bukkit.conversations.ConversationAbandonedEvent; //導入依賴的package包/類
public synchronized void abandonAllConversations() {

        LinkedList<Conversation> oldQueue = conversationQueue;
        conversationQueue = new LinkedList<Conversation>();
        for(Conversation conversation : oldQueue) {
            conversation.abandon(new ConversationAbandonedEvent(conversation, new ManuallyAbandonedConversationCanceller()));
        }
    }
 
開發者ID:AlmuraDev,項目名稱:Almura-Server,代碼行數:9,代碼來源:ConversationTracker.java

示例8: conversationAbandoned

import org.bukkit.conversations.ConversationAbandonedEvent; //導入依賴的package包/類
@Override
public void conversationAbandoned(ConversationAbandonedEvent abandonedEvent)
{
	this.step = 0;
	this.world = null;
	this.group = null;
	this.flags = null;
}
 
開發者ID:dmulloy2,項目名稱:SwornPermissions,代碼行數:9,代碼來源:WizardHandler.java

示例9: conversationAbandoned

import org.bukkit.conversations.ConversationAbandonedEvent; //導入依賴的package包/類
@Override
public void conversationAbandoned(ConversationAbandonedEvent e) {
    if (!e.gracefulExit()) {
        e.getContext().getForWhom().sendRawMessage(BasicMessage.render(Status.ERROR, "Access conversation ended"));
    } else {
        e.getContext().getForWhom().sendRawMessage(BasicMessage.render(Status.INFO, "Bye!"));
    }
    
}
 
開發者ID:crast,項目名稱:MondoChest,代碼行數:10,代碼來源:CheckerConvo.java


注:本文中的org.bukkit.conversations.ConversationAbandonedEvent類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。