This repository has been archived by the owner on Sep 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7b9a7f0
commit 80a9cf2
Showing
2 changed files
with
66 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
src/main/java/io/github/darkkronicle/advancedchatcore/interfaces/IChatMessageProcessor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package io.github.darkkronicle.advancedchatcore.interfaces; | ||
|
||
import io.github.darkkronicle.advancedchatcore.chat.ChatMessage; | ||
|
||
/** | ||
* A processor that will get updated whenever an event in {@link io.github.darkkronicle.advancedchatcore.chat.ChatHistory} happens. | ||
* This gets triggered for specific {@link ChatMessage}. | ||
*/ | ||
public interface IChatMessageProcessor { | ||
|
||
/** | ||
* Types of chat message events that can be referenced | ||
*/ | ||
enum UpdateType { | ||
/** | ||
* A new message is sent. This still gets triggered even if the message is stacked. | ||
*/ | ||
NEW, | ||
|
||
/** | ||
* A message is added to the history. This does not get called on stack. | ||
*/ | ||
ADDED, | ||
|
||
/** | ||
* A previous message has been stacked. The stack number has changed. | ||
*/ | ||
STACK, | ||
|
||
/** | ||
* A message is removed. This does not get called on clear, but only if a specific message was called to remove. | ||
*/ | ||
REMOVE | ||
} | ||
|
||
/** | ||
* A method to handle a {@link ChatMessage} update. | ||
* @param message Message that was updated | ||
* @param type Type of the update | ||
*/ | ||
void onMessageUpdate(ChatMessage message, UpdateType type); | ||
|
||
} |