[Bleeding] Added ConversationAbandonedEvent and supporting infrastructure. Whenever a conversation exits, the ConversationAbandonedEvent is triggered with details about how the conversation ended and what, if anything caused it to end. Fixes BUKKIT-986

By: rmichela <deltahat@gmail.com>
This commit is contained in:
CraftBukkit/Spigot
2012-03-04 16:30:14 -05:00
parent 110a32b647
commit 5aeda06c72
3 changed files with 19 additions and 5 deletions

View File

@@ -39,6 +39,8 @@ import org.bukkit.World;
import org.bukkit.block.BlockFace;
import org.bukkit.configuration.serialization.DelegateDeserialization;
import org.bukkit.conversations.Conversation;
import org.bukkit.conversations.ConversationAbandonedEvent;
import org.bukkit.conversations.ManuallyAbandonedConversationCanceller;
import org.bukkit.craftbukkit.conversations.ConversationTracker;
import org.bukkit.craftbukkit.CraftEffect;
import org.bukkit.craftbukkit.CraftOfflinePlayer;
@@ -707,7 +709,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
public void abandonConversation(Conversation conversation) {
conversationTracker.abandonConversation(conversation);
conversationTracker.abandonConversation(conversation, new ConversationAbandonedEvent(conversation, new ManuallyAbandonedConversationCanceller()));
}
public void abandonConversation(Conversation conversation, ConversationAbandonedEvent details) {
conversationTracker.abandonConversation(conversation, details);
}
public void acceptConversationInput(String input) {