当前位置: 首页>>代码示例>>Java>>正文


Java Conversation类代码示例

本文整理汇总了Java中org.bukkit.conversations.Conversation的典型用法代码示例。如果您正苦于以下问题:Java Conversation类的具体用法?Java Conversation怎么用?Java Conversation使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Conversation类属于org.bukkit.conversations包,在下文中一共展示了Conversation类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: abandonConversation

import org.bukkit.conversations.Conversation; //导入依赖的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.Conversation; //导入依赖的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: dialogMonitor

import org.bukkit.conversations.Conversation; //导入依赖的package包/类
/**
 * In charge of monitoring where the player is during conversations.
 * <p>
 * Determines whether or not a conversation should start, continue, or stop.
 *
 * @param pme The event of Player Movement.
 */
@EventHandler
public void dialogMonitor(PlayerMoveEvent pme) {
    Block from = pme.getFrom().getBlock(), to = pme.getTo().getBlock();
    Player p = pme.getPlayer();

    if(helpedBy.containsKey(p.getName())) {
        //Leaving Conversation
        if(!tellerAreas.containsKey(to) && tellerAreas.containsKey(from)) {
            if(tellerAreas.get(from).equals(helpedBy.get(p.getName()))) {
                Conversation c = conversations.get(p.getName());
                if(c.getState().equals(Conversation.ConversationState.STARTED)) c.abandon();
                conversations.remove(p.getName());
                helpedBy.remove(p.getName());
            }
        }
    }
    //Entering Conversation
    if(tellerAreas.containsKey(to) && !tellerAreas.containsKey(from)) {
        if(helpedBy.get(p.getName()) == null) {
            NPC employee = tellerAreas.get(to);
            helpedBy.put(p.getName(), employee);
            conversations.put(p.getName(), startTransaction(p, employee));
        }
    }
}
 
开发者ID:GoldRushMC,项目名称:GoldRushPlugin,代码行数:33,代码来源:Bank.java

示例4: onInventoryClick

import org.bukkit.conversations.Conversation; //导入依赖的package包/类
@EventHandler
public void onInventoryClick(InventoryClickEvent ev) {
	if (ev.getInventory().getName().equals("- Teams -")) {
		Player pl = (Player) ev.getWhoClicked();
		ev.setCancelled(true);
		if (ev.getCurrentItem().getType() == Material.DIAMOND) {
			pl.closeInventory();
			p.getConversationFactory("teamPrompt").buildConversation(pl).begin();
		} else if (ev.getCurrentItem().getType() == Material.BEACON) {
			pl.closeInventory();
			Conversation c = p.getConversationFactory("playerPrompt").buildConversation(pl);
			c.getContext().setSessionData("nomTeam", ChatColor.stripColor(ev.getCurrentItem().getItemMeta().getDisplayName()));
			c.getContext().setSessionData("color", p.getTeam(ChatColor.stripColor(ev.getCurrentItem().getItemMeta().getDisplayName())).getChatColor());
			c.begin();
		}
	}
}
 
开发者ID:Azenet,项目名称:KTP,代码行数:18,代码来源:UHPluginListener.java

示例5: beginConversation

import org.bukkit.conversations.Conversation; //导入依赖的package包/类
public synchronized boolean beginConversation(Conversation conversation) {
    if (!conversationQueue.contains(conversation)) {
        conversationQueue.addLast(conversation);
        if (conversationQueue.getFirst() == conversation) {
            conversation.begin();
            conversation.outputNextPrompt();
            return true;
        }
    }
    return true;
}
 
开发者ID:UraniumMC,项目名称:Uranium,代码行数:12,代码来源:ConversationTracker.java

示例6: abandonConversation

import org.bukkit.conversations.Conversation; //导入依赖的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

示例7: abandonAllConversations

import org.bukkit.conversations.Conversation; //导入依赖的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

示例8: beginConversation

import org.bukkit.conversations.Conversation; //导入依赖的package包/类
public synchronized boolean beginConversation(Conversation conversation) {
    if (!this.conversationQueue.contains(conversation)) {
        this.conversationQueue.addLast(conversation);
        if (this.conversationQueue.getFirst() == conversation) {
            conversation.begin();
            conversation.outputNextPrompt();
            return true;
        }
    }

    return true;
}
 
开发者ID:CyR1en,项目名称:Minecordbot,代码行数:13,代码来源:ConvoTracker.java

示例9: abandonAllConversations

import org.bukkit.conversations.Conversation; //导入依赖的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


注:本文中的org.bukkit.conversations.Conversation类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。