@@ -6,7 +6,7 @@ mod utils;
66use crate :: dungeon:: door:: DoorType ;
77use crate :: dungeon:: dungeon:: Dungeon ;
88use crate :: dungeon:: dungeon_state:: DungeonState ;
9- use crate :: dungeon:: room:: room_data:: RoomData ;
9+ use crate :: dungeon:: room:: room_data:: { RoomData , RoomType } ;
1010use crate :: dungeon:: room:: secrets;
1111use crate :: dungeon:: room:: secrets:: SecretType :: WitherEssence ;
1212use crate :: dungeon:: room:: secrets:: { DungeonSecret , SecretType } ;
@@ -97,7 +97,8 @@ async fn main() -> Result<()> {
9797 let dungeon_strings = include_str ! ( "dungeon_storage/dungeons.txt" )
9898 . split ( "\n " )
9999 . collect :: < Vec < & str > > ( ) ;
100-
100+
101+ // Check if a custom dungeon str has been given via cli args
101102 let dungeon_str = match args. len ( ) {
102103 0 ..=1 => {
103104 let mut rng = rand:: rng ( ) ;
@@ -127,6 +128,17 @@ async fn main() -> Result<()> {
127128 for room in & dungeon. rooms {
128129 // println!("Room: {:?} type={:?} rotation={:?} shape={:?} corner={:?}", room.segments, room.room_data.room_type, room.rotation, room.room_data.shape, room.get_corner_pos());
129130 room. load_into_world ( & mut server. world ) ;
131+
132+ // Set the spawn point to be inside of the spawn room
133+ if room. room_data . room_type == RoomType :: Entrance {
134+ server. world . set_spawn_point (
135+ room. get_world_pos ( & BlockPos {
136+ x : 15 ,
137+ y : 72 ,
138+ z : 18
139+ } )
140+ ) ;
141+ }
130142 }
131143
132144 for door in & dungeon. doors {
0 commit comments