Skip to content

Disable suffocation optimization for withers#1411

Closed
wefhy wants to merge 3 commits into
PurpurMC:ver/1.20.1from
wefhy:purity
Closed

Disable suffocation optimization for withers#1411
wefhy wants to merge 3 commits into
PurpurMC:ver/1.20.1from
wefhy:purity

Conversation

@wefhy

@wefhy wefhy commented Aug 13, 2023

Copy link
Copy Markdown

The enableSuffocationOptimization from pufferfish usually does a great job reducing entity lag on huge servers.
It reduces the rate of checking for suffocation 10 times (which is collision box calculation and getBlock)

However, it also breaks suffocation based wither cages.
I feel like purpur goes mostly against tnt duping, so wither cages seem like the vanilla way to go around block farms.

This simple change would fix suffocation based wither cages on purpur with the optimization enabled, while still removing most of the lag from the suffocation check.

Given that there are usually only a few withers and thousands of other entities on the server, this option should be the best of both worlds on most of the servers.

Also from a practical standpoint, wither cages are the only useful contraptions that are broken by this patch.

@1ByteBit

Copy link
Copy Markdown

Can you perhaps add an option for this instead of forcing it? Some servers may not want this feature.

@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.

This needs to either be in it's own patch or PR'd to Pufferfish. Inline your imports as well

@wefhy

wefhy commented Aug 14, 2023

Copy link
Copy Markdown
Author

This needs to either be in it's own patch or PR'd to Pufferfish. Inline your imports as well

I inlined the imports for now.
Which option do you think would be the best if I were to make it into a separate patch? Patch it the way it is (withers are always not optimized as they're very rare mobs) or add a separate switch for less aggressive optimization so that some servers may still want to optimize all mobs?

If you could propose the name of that additional switch, I can make a PR with that

@granny

granny commented Aug 23, 2023

Copy link
Copy Markdown
Member

This needs to either be in it's own patch or PR'd to Pufferfish. Inline your imports as well

I inlined the imports for now. Which option do you think would be the best if I were to make it into a separate patch? Patch it the way it is (withers are always not optimized as they're very rare mobs) or add a separate switch for less aggressive optimization so that some servers may still want to optimize all mobs?

If you could propose the name of that additional switch, I can make a PR with that

Maybe something like mobs.wither.ignore-suffocation-optimization? Although I'm inclined to include "pufferfish" somewhere in the config name since it's otherwise implied that Purpur adds the optimization, not Pufferfish. But the name might be confusing if it's ignore-pufferfish-suffocation-optimization... i'm not too sure. I'd rather it be PR'd to Pufferfish, tbh, but I don't think it will get merged anytime soon by them.

@granny

granny commented Aug 27, 2023

Copy link
Copy Markdown
Member

looks like the PR you made for pufferfish, pufferfish-gg/Pufferfish#80, is almost ready to be merged into pufferfish. I'll go ahead and close this PR in favor of that one. With the assumption that it will take a while to merge, i've gone ahead and pulled it downstream into it's own patch.

@granny granny closed this Aug 27, 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