本文整理汇总了Java中org.bukkit.conversations.Conversation.abandon方法的典型用法代码示例。如果您正苦于以下问题:Java Conversation.abandon方法的具体用法?Java Conversation.abandon怎么用?Java Conversation.abandon使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bukkit.conversations.Conversation
的用法示例。
在下文中一共展示了Conversation.abandon方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: abandonConversation
import org.bukkit.conversations.Conversation; //导入方法依赖的package包/类
public 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()) {
((Conversation) this.conversationQueue.getFirst()).outputNextPrompt();
}
}
}
示例2: abandonAllConversations
import org.bukkit.conversations.Conversation; //导入方法依赖的package包/类
public synchronized void abandonAllConversations() {
LinkedList oldQueue = this.conversationQueue;
this.conversationQueue = new LinkedList();
Iterator var2 = oldQueue.iterator();
while (var2.hasNext()) {
Conversation conversation = (Conversation) var2.next();
try {
conversation.abandon(new ConversationAbandonedEvent(conversation, new ManuallyAbandonedConversationCanceller()));
} catch (Throwable var5) {
Bukkit.getLogger().log(Level.SEVERE, "Unexpected exception while abandoning a conversation", var5);
}
}
}
示例3: dialogMonitor
import org.bukkit.conversations.Conversation; //导入方法依赖的package包/类
/**
* In charge of monitoring where the player is during conversations.
* <p>
* Determines whether or not a conversation should start, continue, or stop.
*
* @param pme The event of Player Movement.
*/
@EventHandler
public void dialogMonitor(PlayerMoveEvent pme) {
Block from = pme.getFrom().getBlock(), to = pme.getTo().getBlock();
Player p = pme.getPlayer();
if(helpedBy.containsKey(p.getName())) {
//Leaving Conversation
if(!tellerAreas.containsKey(to) && tellerAreas.containsKey(from)) {
if(tellerAreas.get(from).equals(helpedBy.get(p.getName()))) {
Conversation c = conversations.get(p.getName());
if(c.getState().equals(Conversation.ConversationState.STARTED)) c.abandon();
conversations.remove(p.getName());
helpedBy.remove(p.getName());
}
}
}
//Entering Conversation
if(tellerAreas.containsKey(to) && !tellerAreas.containsKey(from)) {
if(helpedBy.get(p.getName()) == null) {
NPC employee = tellerAreas.get(to);
helpedBy.put(p.getName(), employee);
conversations.put(p.getName(), startTransaction(p, employee));
}
}
}
示例4: abandonConversation
import org.bukkit.conversations.Conversation; //导入方法依赖的package包/类
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: abandonAllConversations
import org.bukkit.conversations.Conversation; //导入方法依赖的package包/类
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: abandonAllConversations
import org.bukkit.conversations.Conversation; //导入方法依赖的package包/类
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);
}
}
}
示例7: abandonAllConversations
import org.bukkit.conversations.Conversation; //导入方法依赖的package包/类
public synchronized void abandonAllConversations() {
LinkedList<Conversation> oldQueue = conversationQueue;
conversationQueue = new LinkedList<Conversation>();
for(Conversation conversation : oldQueue) {
conversation.abandon(new ConversationAbandonedEvent(conversation, new ManuallyAbandonedConversationCanceller()));
}
}
示例8: remove
import org.bukkit.conversations.Conversation; //导入方法依赖的package包/类
@Override
public void remove() {
//Abandon all conversations, and nullify map.
for(Conversation c : conversations.values()) {
if(!c.getState().equals(Conversation.ConversationState.ABANDONED)) c.abandon();
}
conversations = null;
//Clear all employees, and nullify list.
for(NPC e : employees) {
e.destroy();
}
employees = null;
//Nullify the bank area. This may not matter.
bankArea = null;
//Unregister all related events to this.
PlayerMoveEvent.getHandlerList().unregister(this);
//BlockFinder Class stuff.
BlockBreakEvent.getHandlerList().unregister(this);
BlockDamageEvent.getHandlerList().unregister(this);
BlockPlaceEvent.getHandlerList().unregister(this);
//Remove bank from the master list of banks.
banks.remove(this);
}