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

Snowfall during large explosions creates duplicate block replacement #7

Open
pmdevita opened this issue Feb 21, 2021 · 1 comment
Open

Comments

@pmdevita
Copy link
Owner

In large TNT explosions, Minecraft stages the TNT in turns to prevent simulating every explosion at once, which would be incredibly expensive to calculate in a few ticks.

However, this means the game continues while the rest of the explosions go off. And in snowy biomes this can result in snow layers accumulating on top of an explosion crater, only for another explosion to come along and add it into the merged explosion.

The result then is that both the snow layer and the original block are replaced. Whichever one is last in queue will remove the first block.

This is potentially expensive to correct, this kind of thing can only happen in large explosions so already there are a ton of blocks to check. Before a solution is devised for this, it would be good to get a list of similar situations so a single solution be can designed to cover all of them.

@pmdevita
Copy link
Owner Author

Had an idea:
Older Explosion is A, newer Explosion is B
Prior to merge, check B's bounding box for a biome that can snow.
If found, take the intersection of B and A's locations.
For each block in intersection, double check if B's is a snow block.
If so, delete it and dump out any dependencies into the main block list.

If this is done in async outside of the game thread the performance hit might be fairly acceptable.

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

No branches or pull requests

1 participant