The issue seems to be that every other tick the mod does a large batch of processing, instead of distributing that processing over several ticks.
it is for the labs and the ice box.
It literally scans every surface, that should be the cause.
Yea Front rider is right. I did this because there was a bug where the cache isn't updated correctly, so I just updated it every 440ms. I'll implement a per surface batch.
EDIT: Per surface batching not necessary. Fixed the bug that caused me to re-validate the cache every couple of seconds.
Fixed. Reason I periodically updated was because of a bug. Turns out I you can't respond to the same event with different filters. You can only respond to a unique event once. If you bind the same event while already bound, you lose whatever functionality you had bound to it. I don't like responding to every built or destroy event, but it is necessary because you can't filter with multiple names. Either way, cache system works correctly now. And removing the pressure lab or ice box won't cause a crash.