InZan17 / Unloaded-Activity

When certain blocks such as crops or furnaces get out of simulation distance this mod will keep track of that so once the blocks get in again the mod will apply the changes it would have gotten if it never left the simulation distance.
https://modrinth.com/mod/unloaded-activity
GNU Lesser General Public License v3.0
17 stars 6 forks source link

Unloaded-Activity-Fabric

When things such as crops get out of simulation distance, normally they wouldn't grow. This mod changes that by doing a calculation once they get within simulation distance and update them so it's like they never left the simulation distance. So now you can explore while waiting for crops to grow or furnaces to cook.

This also works similarly when skipping the night, crops will have grown and furnaces will have cooked as if you were awake the entire time waiting for the day.

Here is a video showcasing the mod.

The video showcasing the mod

Currently supported blocks/entities (if you use the latest version):

Currently planned:

Inspiration

I got this idea from a video by DigiDigger where he talks about how Terraria can handle all of its tiles. Even though the video isn't really accurate to how Terraria actually works, he did bring up an optimisation which I feel like could also be implemented to Minecraft. The timestamp where he talks about this optimisation is at 5:11.

Simulation accuracy:

Instead of using bruteforce and repeatedly ticking blocks/entities for the amount it was unloaded, the mod instead has a simulation function for every supported block/entity which will calculate the state of a block/entity after a certain amount of time. The most complicated things to simulate are blocks which use randomness in their ticks. To be able to simulate these we randomly sample from a binomial distribution and sometimes also a negative binomial distribution to get what state the blocks should be in after a certain amount of time. By doing this, you will get pretty accurate results without bruteforce.

However, some blocks do stuff that I am not able to find a good way to simulate. Because of this, certain blocks will not be accurately simulated.\ Here's a list of those blocks:

Anything that didn't get mentioned here most likely has a pretty accurate simulation function with no issues at all.

Feedback / Suggestions

If you got any feedback or suggestions for this mod, feel free to join my discord server!

Contributing

You are free to contribute so feel free to open issues and pull requests. When you submit a pull request, you agree to license your contribution under the terms of the LGPL-3.0 license.