mirror of
https://github.com/zyllian/classics.git
synced 2025-05-10 02:46:40 -07:00
make world generation configurable
This commit is contained in:
parent
c78303cf44
commit
38164a6cc5
4 changed files with 101 additions and 9 deletions
|
@ -3,8 +3,6 @@ mod network;
|
|||
|
||||
use std::sync::Arc;
|
||||
|
||||
// use parking_lot::RwLock;
|
||||
use rand::Rng;
|
||||
use tokio::{net::TcpListener, sync::RwLock};
|
||||
|
||||
use crate::{level::Level, player::Player};
|
||||
|
@ -50,13 +48,7 @@ impl Server {
|
|||
)
|
||||
};
|
||||
let mut level = Level::new(level_x, level_y, level_z);
|
||||
for x in 0..level.x_size {
|
||||
for y in 0..(level.y_size / 2) {
|
||||
for z in 0..level.z_size {
|
||||
level.set_block(x, y, z, rng.gen_range(0..50));
|
||||
}
|
||||
}
|
||||
}
|
||||
config.generation.generate(&mut level, &mut rng);
|
||||
println!("done!");
|
||||
|
||||
Self::new_with_level(config, level).await
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue