Skip to content
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

fix(api): add UserChatEvent #isCancellable and #isModifiable #275

Merged
merged 5 commits into from
Sep 6, 2023

Conversation

joshuasing
Copy link
Member

Summary
Due to changes in Minecraft 1.19.1+, some platforms no longer support cancelling or modifying the chat event.

This pull request adds UserChatEvent#isCancellable() and UserChatEvent#isModifiable() to allow developers to determine whether these operations are supported on the current platform.

If UserChatEvent#isCancellable() returns false, but the event is cancelled, the event will not be cancelled on the platform.

If UserChatEvent#isModifiable() returns false, but the chat message is modified, the event's chat message will not be changed on the platform.

Changes

  • Add UserChatEvent#isCancellable()
  • Add UserChatEvent#isModifiable()

Checklist

Due to changes in Minecraft 1.19.1+, some platforms no longer support
cancelling or modifying the chat event.

Add `UserChatEvent#isCancellable()` and `UserChatEvent#isModifiable()`
to allow developers to determine whether these operations are supported
on the current platform.

If `UserChatEvent#isCancellable()` returns false, but the event is
cancelled, the event will not be cancelled on the platform.

If `UserChatEvent#isModifiable()` returns false, but the chat message is
modified, the event's chat message will not be changed on the platform.
@joshuasing joshuasing added type: enhancement This is a feature request or a pull request that adds a feature area: platform This involves updating, adding or removing a platform area: event This involves updating, adding or removing an event labels Sep 6, 2023
@joshuasing joshuasing self-assigned this Sep 6, 2023
@codecov
Copy link

codecov bot commented Sep 6, 2023

Codecov Report

Merging #275 (ef09721) into main (262d10a) will decrease coverage by 0.48%.
Report is 1 commits behind head on main.
The diff coverage is 0.00%.

Additional details and impacted files
@@             Coverage Diff              @@
##               main     #275      +/-   ##
============================================
- Coverage     71.40%   70.92%   -0.48%     
  Complexity      407      407              
============================================
  Files            72       73       +1     
  Lines          1507     1517      +10     
  Branches         87       87              
============================================
  Hits           1076     1076              
- Misses          397      407      +10     
  Partials         34       34              
Files Changed Coverage Δ
...hypera/chameleon/adventure/AudienceReflection.java 71.56% <ø> (ø)
...v/hypera/chameleon/event/common/UserChatEvent.java 0.00% <0.00%> (ø)
...a/dev/hypera/chameleon/util/PlatformEventUtil.java 0.00% <0.00%> (ø)

@joshuasing joshuasing merged commit d66e527 into main Sep 6, 2023
4 of 5 checks passed
@joshuasing joshuasing deleted the fix/chat-cancellable-modifiable branch September 6, 2023 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: event This involves updating, adding or removing an event area: platform This involves updating, adding or removing a platform type: enhancement This is a feature request or a pull request that adds a feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants