Two optimizations that added up to a significant
time savings in on_generated:
- Replacing calls to area:index(x,y,z) to precalculating
an offset and then using stride math inside the loops
gives us a huge cost savings.
- Prefilling lookup-by-ID tables to force them into
sequential arrays instead of hashmaps speeds up
lookups, for a more moderate savings.
This should cause maps that have the same
seeds to have much more similar results
than before, e.g. sponge deposits will be in
the same places determined by seed and not
random each regeneration of the map.
- Mapgen shared now provides an RNG which
will be deterministic when feasible, for
repeatable mapgen results.
- Make existing rng-using mapgen hooks use
the new deterministic RNG.
- Mapgen shared hooks are also run in
deterministic order too.
- Tidy up mapgen_shared API a little more.
- Register def tables instead of bare funcs.
- Add labels for mod logic use.
- Automatically skip for singlenode mapgens,
e.g. for the skyblock modpack.
- Apply stratification last in shared mapgens, so it can see all
already-placed ores.
- Support stratification for nodes other than plain stone.
- Register lode stone and lode ore for stratification.