Java Code Examples for org.bukkit.conversations.Conversation#begin()

The following examples show how to use org.bukkit.conversations.Conversation#begin() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: UHPluginListener.java    From KTP with GNU General Public License v3.0 6 votes vote down vote up
@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();
		}
	}
}
 
Example 2
Source File: ConversationTracker.java    From Kettle with GNU General Public License v3.0 5 votes vote down vote up
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;
}
 
Example 3
Source File: ConversationTracker.java    From Thermos with GNU General Public License v3.0 5 votes vote down vote up
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;
}
 
Example 4
Source File: SSHDConversationTracker.java    From Bukkit-SSHD with Apache License 2.0 5 votes vote down vote up
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;
}