Derive terrain seed from current day

It's easier to test things when the terrain isn't constantly changing.
This commit is contained in:
Ryan 2022-10-07 00:17:14 -07:00
parent 886d036b97
commit 5a686a0e8b

View file

@ -1,5 +1,6 @@
use std::net::SocketAddr;
use std::sync::atomic::{AtomicUsize, Ordering};
use std::time::SystemTime;
use log::LevelFilter;
use noise::{NoiseFn, Seedable, SuperSimplex};
@ -23,7 +24,12 @@ pub fn main() -> ShutdownResult {
.parse_default_env()
.init();
let seed = rand::random();
let seconds_per_day = 86_400;
let seed = (SystemTime::now()
.duration_since(SystemTime::UNIX_EPOCH)?
.as_secs()
/ seconds_per_day) as u32;
valence::start_server(
Game {