-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add separate events for local and global chat #4683
Conversation
Essentials/src/main/java/net/ess3/api/events/LocalChatSpyEvent.java
Outdated
Show resolved
Hide resolved
842e9fb
to
45a0678
Compare
45a0678
to
bc14df3
Compare
Essentials/src/main/java/net/ess3/api/events/LocalChatSpyEvent.java
Outdated
Show resolved
Hide resolved
...tialsChat/src/main/java/com/earth2me/essentials/chat/EssentialsChatPlayerListenerNormal.java
Outdated
Show resolved
Hide resolved
EssentialsChat/src/main/java/com/earth2me/essentials/chat/ChatStore.java
Outdated
Show resolved
Hide resolved
...tialsChat/src/main/java/com/earth2me/essentials/chat/EssentialsChatPlayerListenerNormal.java
Outdated
Show resolved
Hide resolved
18f24f7
to
f9e6f52
Compare
Hello and thanks for the review! Sorry it took some time, but all noted issues should be fixed now. |
f9e6f52
to
1bf775e
Compare
1bf775e
to
a0fc04c
Compare
Essentials/src/main/java/net/essentialsx/api/v2/events/ChatEvent.java
Outdated
Show resolved
Hide resolved
Essentials/src/main/java/net/essentialsx/api/v2/events/GlobalChatEvent.java
Outdated
Show resolved
Hide resolved
Essentials/src/main/java/net/essentialsx/api/v2/events/LocalChatEvent.java
Outdated
Show resolved
Hide resolved
21b8556
to
0cd4898
Compare
Rebased and moved new event classes to |
Hey, apologies for the slow response on this. We recently refactored EssentialsX Chat, so this PR will need need to be updated this PR accordingly (ie moving the |
0cd4898
to
c162217
Compare
Heyo! I have rebased this on |
EssentialsChat/src/main/java/com/earth2me/essentials/chat/processing/AbstractChatHandler.java
Outdated
Show resolved
Hide resolved
8977e3f
to
3c60995
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
final few things, otherwise approved for 2.20!
Essentials/src/main/java/net/essentialsx/api/v2/events/chat/ChatEvent.java
Outdated
Show resolved
Hide resolved
Essentials/src/main/java/net/essentialsx/api/v2/events/chat/LocalChatEvent.java
Show resolved
Hide resolved
This commit adds two new events: GlobalChatEvent and LocalChatEvent, which allow other plugin developers to know whether the message sent is a global or local one and act accordingly. If either of those events is cancelled, then the source event is cancelled too. Since all chat-related events share the same structure, a new abstract class ChatEvent is created with change made for LocalChatSpyEvent to use it without breaking its API.
3c60995
to
7bd890d
Compare
Information
This PR helps DiscordSRV/DiscordSRV#1223.
Details
Proposed feature:
This PR adds two new events: GlobalChatEvent and LocalChatEvent, which allow other plugin developers to know whether the message sent is a global or local one and act accordingly. If either of those events is cancelled, then the source event is cancelled too.
Since all chat-related events share the same structure, a new abstract class ChatEvent is created with the change made for LocalChatSpyEvent to use it without breaking its API.
Environments tested:
OS: Windows 10 20H2.
Java version:
Demonstration:
Following this pull request, a draft pull request with the use of that API in Essentials Discord module was created — #4684.