use common::{ comp::{ inventory::item::MaterialStatManifest, tool::AbilityMap, ControlCommand, ControlCommands, Controller, RemoteController, }, resources::{DeltaTime, GameMode, Time}, terrain::{MapSizeLg, TerrainChunk}, }; use common_ecs::dispatch; use common_net::sync::WorldSyncExt; use common_state::State; use hashbrown::HashSet; use specs::{Builder, Entity, WorldExt}; use std::{error::Error, sync::Arc, time::Duration}; use vek::Vec2; use veloren_common_systems::predict_controller; pub const DTT: f64 = 1.0 / 10.0; pub const DT: Duration = Duration::from_millis(100); const DEFAULT_WORLD_CHUNKS_LG: MapSizeLg = if let Ok(map_size_lg) = MapSizeLg::new(Vec2 { x: 10, y: 10 }) { map_size_lg } else { panic!("Default world chunk size does not satisfy required invariants."); }; pub fn setup() -> State { let pools = State::pools(GameMode::Server); let mut state = State::new( GameMode::Server, pools, DEFAULT_WORLD_CHUNKS_LG, Arc::new(TerrainChunk::water(0)), ); state.ecs_mut().insert(MaterialStatManifest::with_empty()); state.ecs_mut().insert(AbilityMap::load().cloned()); state.ecs_mut().read_resource::