Skip to content

Add PreExplodeEvents#1234

Merged
granny merged 9 commits into
PurpurMC:ver/1.19.3from
SageSphinx63920:ver/1.19.3
Mar 2, 2023
Merged

Add PreExplodeEvents#1234
granny merged 9 commits into
PurpurMC:ver/1.19.3from
SageSphinx63920:ver/1.19.3

Conversation

@SageSphinx63920

Copy link
Copy Markdown
Contributor

This pr add PreXExplodeEvents to cancel an explosion before Minecraft calculates all the changes to prevent lag spikes

Comment thread patches/api/0057-Add-PreExplodeEvents.patch Outdated
@JanTuck

JanTuck commented Dec 26, 2022

Copy link
Copy Markdown

@SageSphinx63920

Copy link
Copy Markdown
Contributor Author

We talked about this on the Discord. This event gets called before any calculation of the radius is happing. If you spawn a creeper with a really big explosion radius and cancel the explosion event, the game still calculates every block that needs to be destroyed, which drops the TPS. You can cancel this event to prevent this

@JanTuck

JanTuck commented Dec 26, 2022

Copy link
Copy Markdown

Alright thx.

@SageSphinx63920

Copy link
Copy Markdown
Contributor Author

Do to Billy might not reviewing this, can somebody else do?

@granny granny left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the params & everything is almost identical, have you thought about just extending the BlockExplodeEvent event instead of BlockEvent?

Comment thread patches/server/0310-Add-PreExplodeEvents.patch Outdated
Comment thread patches/api/0057-Add-PreExplodeEvents.patch
@granny

granny commented Mar 1, 2023

Copy link
Copy Markdown
Member

@SageSphinx63920 any updates? do you need help rebasing the branch?

granny
granny approved these changes Mar 2, 2023
@granny granny merged commit 3940c82 into PurpurMC:ver/1.19.3 Mar 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants