类org.bukkit.conversations.Conversation源码实例Demo

下面列出了怎么用org.bukkit.conversations.Conversation的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: KTP   文件: UHPluginListener.java
@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 项目: Bukkit-SSHD   文件: SSHDConversationTracker.java
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()) {
            this.conversationQueue.getFirst().outputNextPrompt();
        }
    }

}
 
源代码3 项目: Kettle   文件: ConversationTracker.java
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;
}
 
源代码4 项目: Kettle   文件: ConversationTracker.java
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();
        }
    }
}
 
源代码5 项目: Kettle   文件: ConversationTracker.java
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);
            }
        }
    }
 
源代码6 项目: Kettle   文件: ConversationTracker.java
public synchronized void acceptConversationInput(String input) {
    if (isConversing()) {
        Conversation conversation = conversationQueue.getFirst();
        try {
            conversation.acceptInput(input);
        } catch (Throwable t) {
            conversation.getContext().getPlugin().getLogger().log(Level.WARNING,
                    String.format("Plugin %s generated an exception whilst handling conversation input",
                            conversation.getContext().getPlugin().getDescription().getFullName()
                    ), t);
        }
    }
}
 
源代码7 项目: Thermos   文件: ConversationTracker.java
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;
}
 
源代码8 项目: Thermos   文件: ConversationTracker.java
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();
        }
    }
}
 
源代码9 项目: Thermos   文件: ConversationTracker.java
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);
            }
        }
    }
 
源代码10 项目: Bukkit-SSHD   文件: SSHDConversationTracker.java
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;
}
 
源代码11 项目: Bukkit-SSHD   文件: SSHDConversationTracker.java
public synchronized void abandonAllConversations() {
    LinkedList<Conversation> oldQueue = this.conversationQueue;
    this.conversationQueue = new LinkedList<>();

    for (Conversation conversation : oldQueue) {
        try {
            conversation.abandon(new ConversationAbandonedEvent(conversation, new ManuallyAbandonedConversationCanceller()));
        } catch (Throwable var5) {
            Bukkit.getLogger().log(Level.SEVERE, "Unexpected exception while abandoning a conversation", var5);
        }
    }

}
 
源代码12 项目: Bukkit-SSHD   文件: SSHDConversationTracker.java
synchronized void acceptConversationInput(String input) {
    if (this.isConversing()) {
        Conversation conversation = this.conversationQueue.getFirst();

        try {
            conversation.acceptInput(input);
        } catch (Throwable var4) {
            conversation.getContext().getPlugin().getLogger().log(Level.WARNING, String.format("Plugin %s generated an exception whilst handling conversation input", conversation.getContext().getPlugin().getDescription().getFullName()), var4);
        }
    }

}
 
源代码13 项目: Kettle   文件: CraftPlayer.java
@Override
public boolean beginConversation(Conversation conversation) {
    return conversationTracker.beginConversation(conversation);
}
 
源代码14 项目: Kettle   文件: CraftPlayer.java
@Override
public void abandonConversation(Conversation conversation) {
    conversationTracker.abandonConversation(conversation, new ConversationAbandonedEvent(conversation, new ManuallyAbandonedConversationCanceller()));
}
 
源代码15 项目: Kettle   文件: CraftPlayer.java
@Override
public void abandonConversation(Conversation conversation, ConversationAbandonedEvent details) {
    conversationTracker.abandonConversation(conversation, details);
}
 
源代码16 项目: Kettle   文件: CraftConsoleCommandSender.java
public boolean beginConversation(Conversation conversation) {
    return conversationTracker.beginConversation(conversation);
}
 
源代码17 项目: Kettle   文件: CraftConsoleCommandSender.java
public void abandonConversation(Conversation conversation) {
    conversationTracker.abandonConversation(conversation, new ConversationAbandonedEvent(conversation, new ManuallyAbandonedConversationCanceller()));
}
 
源代码18 项目: Kettle   文件: CraftConsoleCommandSender.java
public void abandonConversation(Conversation conversation, ConversationAbandonedEvent details) {
    conversationTracker.abandonConversation(conversation, details);
}
 
源代码19 项目: DiscordSRV   文件: SingleCommandSender.java
@Override
public void abandonConversation(Conversation arg0) {
    sender.abandonConversation(arg0);
}
 
源代码20 项目: DiscordSRV   文件: SingleCommandSender.java
@Override
public void abandonConversation(Conversation arg0, ConversationAbandonedEvent arg1) {
    sender.abandonConversation(arg0, arg1);
}
 
源代码21 项目: DiscordSRV   文件: SingleCommandSender.java
@Override
public boolean beginConversation(Conversation arg0) {
    return sender.beginConversation(arg0);
}
 
源代码22 项目: Thermos   文件: CraftPlayer.java
public boolean beginConversation(Conversation conversation) {
    return conversationTracker.beginConversation(conversation);
}
 
源代码23 项目: Thermos   文件: CraftPlayer.java
public void abandonConversation(Conversation conversation) {
    conversationTracker.abandonConversation(conversation, new ConversationAbandonedEvent(conversation, new ManuallyAbandonedConversationCanceller()));
}
 
源代码24 项目: Thermos   文件: CraftPlayer.java
public void abandonConversation(Conversation conversation, ConversationAbandonedEvent details) {
    conversationTracker.abandonConversation(conversation, details);
}
 
源代码25 项目: Thermos   文件: CraftConsoleCommandSender.java
public boolean beginConversation(Conversation conversation) {
    return conversationTracker.beginConversation(conversation);
}
 
源代码26 项目: Thermos   文件: CraftConsoleCommandSender.java
public void abandonConversation(Conversation conversation) {
    conversationTracker.abandonConversation(conversation, new ConversationAbandonedEvent(conversation, new ManuallyAbandonedConversationCanceller()));
}
 
源代码27 项目: Thermos   文件: CraftConsoleCommandSender.java
public void abandonConversation(Conversation conversation, ConversationAbandonedEvent details) {
    conversationTracker.abandonConversation(conversation, details);
}
 
源代码28 项目: Bukkit-SSHD   文件: SSHDCommandSender.java
public boolean beginConversation(Conversation conversation) {
    return this.conversationTracker.beginConversation(conversation);
}
 
源代码29 项目: Bukkit-SSHD   文件: SSHDCommandSender.java
public void abandonConversation(Conversation conversation) {
    this.conversationTracker.abandonConversation(conversation, new ConversationAbandonedEvent(conversation, new ManuallyAbandonedConversationCanceller()));
}
 
源代码30 项目: Bukkit-SSHD   文件: SSHDCommandSender.java
public void abandonConversation(Conversation conversation, ConversationAbandonedEvent details) {
    this.conversationTracker.abandonConversation(conversation, details);
}
 
 类所在包
 同包方法