本文整理汇总了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();
}
}
}
示例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;
}
示例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;
}
示例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();
}
示例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;
}
示例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;
}
示例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();
}