[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:
Bukkit/Spigot
2012-03-04 16:29:56 -05:00
parent 819611b351
commit 4b5a0b8ed8
9 changed files with 149 additions and 6 deletions

View File

@@ -14,6 +14,7 @@ public class FakeConversable implements Conversable {
public String lastSentMessage;
public Conversation begunConversation;
public Conversation abandonedConverstion;
public ConversationAbandonedEvent abandonedConversationEvent;
public boolean isConversing() {
return false;
@@ -33,6 +34,11 @@ public class FakeConversable implements Conversable {
abandonedConverstion = conversation;
}
public void abandonConversation(Conversation conversation, ConversationAbandonedEvent details) {
abandonedConverstion = conversation;
abandonedConversationEvent = details;
}
public void sendRawMessage(String message) {
lastSentMessage = message;
}

View File

@@ -10,6 +10,7 @@ import java.util.UUID;
import org.bukkit.*;
import org.bukkit.block.Block;
import org.bukkit.conversations.Conversation;
import org.bukkit.conversations.ConversationAbandonedEvent;
import org.bukkit.entity.Arrow;
import org.bukkit.entity.Egg;
import org.bukkit.entity.Entity;
@@ -739,4 +740,8 @@ public class TestPlayer implements Player {
public void abandonConversation(Conversation conversation) {
throw new UnsupportedOperationException("Not supported yet.");
}
public void abandonConversation(Conversation conversation, ConversationAbandonedEvent details) {
throw new UnsupportedOperationException("Not supported yet.");
}
}