本文整理匯總了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();
}