stackotter / delta-client

An open source Minecraft Java Edition client built for speed.
https://deltaclient.app
GNU General Public License v3.0
313 stars 33 forks source link

Fix accidental xray hack where you can mine downwards quickly and occasionally see through the blocks below #181

Open stackotter opened 11 months ago

stackotter commented 11 months ago

This issue is only visible very briefly (it quickly disappears as the chunk sections finish regenerating), but it's definitely noticeable.

I have a hunch that this issue is to do with the scheduling of chunk section mesh regeneration. When the block broken is at the bottom of a chunk section, it could be that the section containing the block is generated first and displayed before the section below is regenerated. And because of block face culling (faces between blocks aren't rendered) this causes the block below to be invisible for a frame before the section below is regenerated.

If this is the case, it should be able to be fixed by not committing a regenerated mesh to the WorldMesh before all other related chunk sections (from the same block update) are also finished regenerating. You'll have to update WorldMeshWorker so that getUpdatedMeshes doesn't return meshes which are still waiting on other meshes from the same block update. Feel free to ask me for guidance on the Discord server if you need help.