File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change 1
- use std:: { cell:: RefCell , rc:: Rc , sync:: Arc } ;
1
+ use std:: {
2
+ cell:: RefCell ,
3
+ collections:: hash_map:: DefaultHasher ,
4
+ hash:: { Hash , Hasher } ,
5
+ rc:: Rc ,
6
+ sync:: Arc ,
7
+ } ;
2
8
3
9
use anyhow:: Context ;
4
10
use base:: anvil:: level:: SuperflatGeneratorOptions ;
@@ -64,7 +70,11 @@ fn init_world_source(game: &mut Game, config: &Config) {
64
70
// world otherwise. This is a placeholder:
65
71
// we don't have proper world generation yet.
66
72
67
- let seed = 42 ; // FIXME: load from the level file
73
+ let seed = config. world . seed . parse ( ) . unwrap_or_else ( |_| {
74
+ let mut hasher = DefaultHasher :: new ( ) ;
75
+ config. world . seed . hash ( & mut hasher) ;
76
+ hasher. finish ( )
77
+ } ) ;
68
78
69
79
let generator: Arc < dyn WorldGenerator > = match & config. world . generator [ ..] {
70
80
"flat" => Arc :: new ( SuperflatWorldGenerator :: new (
You can’t perform that action at this time.
0 commit comments