use std::time::Duration; use bevy::prelude::*; use starkingdoms_proc::replicable; use crate::replication::{ReplicateExt, Replicated, ReplicationServerPlugin}; pub fn server_plugin(app: &mut App) { app .replicate::() .add_systems(Startup, spawn_test_thingy) .add_systems(FixedUpdate, update_test_thingy) .add_systems(Update, remove_test_thingy); } #[derive(Component)] struct TestComponent2; #[derive(Component)] #[replicable] pub struct TestComponent { hi: i32 } fn spawn_test_thingy(mut commands: Commands) { commands.spawn(( Replicated, TestComponent2, TestComponent { hi: 123 }, )); } fn update_test_thingy(mut query: Query<&mut TestComponent>) { for mut thingy in query.iter_mut() { thingy.hi += 1; } } fn remove_test_thingy(mut commands: Commands, query: Query>, time: Res