@SBPrime We use threads extensively, but this particular thing won't work too well, because the Lua plugins are not thread-safe (by design), so in order to execute any plugin code, the plugin holds a (plugin-specific) mutex. Unfortunately that means that if the same plugin also registers a hook that comes from the world tick thread, the tick thread must block until the first call releases the mutex. There's no simple way around this, the plugins are forced into this pseudo single-threading. Changing that would require not only a substantial rewrite of the entire API, but also of the plugin writers' mindset - suddenly they'd need to be aware of multithreading issues that were hidden from them before, the learning curve would become too steep.
@NiLSPACE: I'm afraid the Crop operation would become the bottleneck in this - for each chunk you'd need to create a copy of the original area (duplicate it all), then crop it (reallocate and copy) and finally write it. As @worktycho said, it would be easier to create a WritePartial function.
@NiLSPACE: I'm afraid the Crop operation would become the bottleneck in this - for each chunk you'd need to create a copy of the original area (duplicate it all), then crop it (reallocate and copy) and finally write it. As @worktycho said, it would be easier to create a WritePartial function.