mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-11 17:51:04 +00:00
Crafting speedup
This greatly increases crafting performance, especially in worlds with many mods. Approved by @kwolekr. Introduces a hash-type-layered fall-through mechanism, where every layer specifies one hash algorithm, and the "deeper the fall", the more collisions to expect for the algorithm. One Craft definition only resides at one layer, which improves speed for lower layers (and a complete fail), due to most craft definitions residing at high layers. Due to the fall-through design, the undocumented behaviour that later craft recipes override older ones had to be weaked up a bit, but craft recipes with the same hash and layer will still override.
This commit is contained in:
parent
fedbbc8883
commit
334e70455b
3 changed files with 349 additions and 88 deletions
|
@ -334,6 +334,9 @@ Server::Server(
|
|||
// Perform pending node name resolutions
|
||||
m_nodedef->runNodeResolverCallbacks();
|
||||
|
||||
// init the recipe hashes to speed up crafting
|
||||
m_craftdef->initHashes(this);
|
||||
|
||||
// Initialize Environment
|
||||
m_env = new ServerEnvironment(servermap, m_script, this, m_path_world);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue