Open 13rac1 opened 4 years ago
I've been thinking about how to best implement this. BlockStates can store the numbers 0 to 15, which isn't enough resolution in this case.
Sadly, abstractions are lies at their core. We still have the responsibility of translating every IBlockState back into a number between 0 and 15 inclusive that will be stored in the world and vice versa for loading.
First idea is an LRU Cache of the last X water blocks updated. Java LRU implementation. Mixin injection into World.setBlockState()
to update the timestamps might be enough. Or perhaps the BlockState for a position can be checked to be the same and the timer starts at first randomTick()
.
From https://github.com/13rac1/Minecraft-Water-Erosion/issues/12#issuecomment-590490008
randomTick()
is called on all water blocks, this can result in erosion occurring moments after water flows in an area. This is unrealistic because the erosion process needs time to start soaking the soil/sand before any erosion occurs. Erosion should not occur turn the first X minutes/hours? of a water block's existence.Gameplay benefit: This enables water-based automatic farms to not erode the farmland soil. Quick flows will just "wash" over the land and never erode anything.