if not SERVER then return end

local function zrmine_Refresh_Ore()
	for k, v in pairs(ents.FindByClass("zrms_ore")) do
		if (IsValid(v)) then
			v:RefreshOre()
		end
	end
end

local function CheckOreRefreshTimerExist()
	if (not timer.Exists("zrmine_orerefresher_id") and zrmine.config.Ore_Refresh) then
		timer.Create("zrmine_orerefresher_id", zrmine.config.Ore_Refreshrate, 0, zrmine_Refresh_Ore)
	end
end

hook.Add("InitPostEntity", "zrmine_spawn_OreRefresh_OnMapLoad", CheckOreRefreshTimerExist)
