void OnServerInitialized() { initalized = true; originalDespawnTime = ConVar.Server.itemdespawn; //Just set items not to despawn, and handle removing manually ConVar.Server.itemdespawn = float.MaxValue; settings.Instance.Initialize(); settings.Save(); //settings = new ConfigurationAccessor<Settings>("NoDespawning-Settings"); //Puts($"Worldsize: {ConVar.Server.worldsize}"); halfSize = ConVar.Server.worldsize / 2; itemGrid = new ItemGrid(); itemGrid.Init(); var items = GameObject.FindObjectsOfType <DroppedItem>(); Puts($"Found {items.Length} dropped items"); int loops = 0; try //Just incase shit hits the fan when looping through ALL items { foreach (var item in items) { itemGrid.AssignToGrid(item); loops++; } } catch (Exception ex) { Puts($"FAILED! Only looped through {loops} items\n {ex}"); return; } itemGrid.DeactivateGrids(); //Start them up disabled Puts($"Assigned {items.Length} dropped items into the grid."); _despawnTimer = timer.Every(despawnTimerDelay, DespawnLoop); PrintItemAmounts(); //timer.Every(300f, PrintItemAmounts); }