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


Java Conversation.begin方法代码示例

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


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

示例1: 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

示例2: 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

示例3: 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

示例4: createGroup

import org.bukkit.conversations.Conversation; //导入方法依赖的package包/类
public final void createGroup(Player player, String world)
{
	GroupCreationWizard wizard = new GroupCreationWizard(player, world);
	Conversation conversation = new ConversationFactory(plugin).withFirstPrompt(wizard).withPrefix(new Prefix())
			.withEscapeSequence("exit").addConversationAbandonedListener(wizard).buildConversation(player);
	conversation.begin();
}
 
开发者ID:dmulloy2,项目名称:SwornPermissions,代码行数:8,代码来源:WizardHandler.java

示例5: startTransaction

import org.bukkit.conversations.Conversation; //导入方法依赖的package包/类
public Conversation startTransaction(Player p, NPC n) {
    //Set parameters of the conversation and begin it.
    teller.withFirstPrompt(new WelcomePrompt(this, n, p));
    teller.withEscapeSequence("//");
    teller.withLocalEcho(true);
    teller.withPrefix(new BankPrefix(name));
    Conversation talk = teller.buildConversation(p);

    talk.begin();
    return talk;
}
 
开发者ID:GoldRushMC,项目名称:GoldRushPlugin,代码行数:12,代码来源:Bank.java

示例6: startAdministration

import org.bukkit.conversations.Conversation; //导入方法依赖的package包/类
public static Conversation startAdministration(Player player) {
    // Build the conversation and begin
    Conversation conversation = Demigods.getConversationFactory().withEscapeSequence("/exit").withLocalEcho(false).withInitialSessionData(grabRawContext(player)).withFirstPrompt(new StartAdministration()).buildConversation(player);

    // Save the context
    Util.saveAdministrationContext(player, conversation.getContext());

    // Begin
    conversation.begin();

    return conversation;
}
 
开发者ID:DemigodsRPG,项目名称:Demigods3,代码行数:13,代码来源:Administration.java

示例7: perform

import org.bukkit.conversations.Conversation; //导入方法依赖的package包/类
@Override
public void perform()
{
	InvitePrompt prompt = new InvitePrompt(player, plugin);
	Conversation convo = new ConversationFactory(plugin)
		.withFirstPrompt(prompt)
		.withPrefix(new Prefix(plugin))
		.buildConversation(player);
	convo.begin();
}
 
开发者ID:dmulloy2,项目名称:TeamSparkle,代码行数:11,代码来源:CmdInvite.java


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