Skip to content

Improve EntityAirChangeEvent - #14155

Open
Warriorrrr wants to merge 1 commit into
PaperMC:mainfrom
Warriorrrr:feat/improve-air-change-event
Open

Improve EntityAirChangeEvent#14155
Warriorrrr wants to merge 1 commit into
PaperMC:mainfrom
Warriorrrr:feat/improve-air-change-event

Conversation

@Warriorrrr

Copy link
Copy Markdown
Member

Adds guards to avoid calling the event if it has no listeners, and prevents calling the event if no change occurred. This event is potentially hot since all WaterAnimals call it once every tick (even when no change occurs).

The resend for players when cancelled did not seem to be needed, when using the event to cancel or hardcode the amount of air I had I wasn't able to see any desync occurring

Adds guards to avoid calling the event if it has no listeners, and prevents calling the event if no change occurred. This event is potentially hot since all WaterAnimals call it once every tick (even when no change occurs).

The resend for players when cancelled did not seem to be needed, when using the event to cancel or hardcode the amount of air I had I wasn't able to see any desync occurring
@Warriorrrr
Warriorrrr requested a review from a team as a code owner August 7, 2026 11:20
@github-project-automation github-project-automation Bot moved this to Awaiting review in Paper PR Queue Aug 7, 2026
@papermc-projects papermc-projects Bot moved this from Awaiting review to Full approval in Paper PR Queue Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Full approval

Development

Successfully merging this pull request may close these issues.

2 participants