mirror of
https://github.com/italicsjenga/valence.git
synced 2024-12-23 14:31:30 +11:00
Derive terrain seed from current day
It's easier to test things when the terrain isn't constantly changing.
This commit is contained in:
parent
886d036b97
commit
5a686a0e8b
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue