many worldgen mods and gonna try technic now

This commit is contained in:
tangent committed 2026-09-13 03:30:48 -06:00
1 parent bac6ac94a3
commit 548749cb1a
4811 files changed
+163271 -1

No files matched your search

@@ -0,0 +1,26 @@
local function throttle(callspersecond, fn)
local time = 0
local count = 0
return function(...)
local now = minetest.get_us_time()
if (now - time) > 1000000 then
-- reset time
time = now
count = 0
else
-- check max calls
count = count + 1
if count > callspersecond then
return
end
end
return pcall(fn, ...)
end
end
return throttle