mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-15 04:05:50 -07:00
[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:
@@ -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;
|
||||
}
|
||||
|
@@ -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.");
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user