Don't require server when spawning a entity

Makes it much simpler
This commit is contained in:
Alexander Medvedev committed 2025-03-02 16:05:31 +01:00
1 parent 52e48ec0bd
commit be44ccc8df
20 files changed
+86 -199

No files matched your search

+2 -2
View File
@@ -24,12 +24,12 @@ impl ExperienceOrbEntity {
}
}
pub async fn spawn(world: &Arc<World>, server: &Server, position: Vector3<f64>, amount: u32) {
pub async fn spawn(world: &Arc<World>, position: Vector3<f64>, amount: u32) {
let mut amount = amount;
while amount > 0 {
let i = Self::round_to_orb_size(amount);
amount -= i;
let entity = server.add_entity(position, EntityType::EXPERIENCE_ORB, world);
let entity = world.create_entity(position, EntityType::EXPERIENCE_ORB);
let orb = Arc::new(Self::new(entity, i));
world.spawn_entity(orb).await;
}