TwelveIterationMods/CookingForBlockheads

Improve Multiblock Scanning for better performance

Opened this issue · 0 comments

Right now, the kitchen has to check its surrounding blocks whenever the cooking table is opened, which can cause a lagspike on large setups (e.g. many kitchen floors or storage drawers).

Idea so far:

  • The multiblock should remain in memory and not be persisted, to avoid external edits or other factors resulting in an inconsistent state
  • Cooking Table should scan its surroundings upon load, spread out across ticks to avoid spiking
  • If the Cooking Table is opened before it has completed scanning, force it to complete in a single tick (this would still result in an initial lagspike but should be extremely rare)
  • Track which chunks are involved in the multiblock, and invalidate it if any changes are made to those chunks (at which point we repeat from above)