-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move assets to extras, turn extras into plugin
- Loading branch information
Showing
31 changed files
with
63 additions
and
26 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,28 @@ | ||
//! Default world generators and block definitions. | ||
use std::str::FromStr; | ||
|
||
use bevy::prelude::*; | ||
use infinigen_plugins::assets::DefaultBlockTypes; | ||
use infinigen_plugins::world::WorldInitializer; | ||
use worldgen::WorldGenTypes; | ||
|
||
pub mod blocks; | ||
pub mod worldgen; | ||
|
||
pub struct ExtrasPlugin; | ||
|
||
impl Plugin for ExtrasPlugin { | ||
fn build(&self, app: &mut App) { | ||
tracing::info!("Initializing extras plugin"); | ||
app.insert_resource(DefaultBlockTypes(crate::blocks::block_types().collect())) | ||
.insert_resource(WorldInitializer(Box::new( | ||
move |world_gen_name: &str, seed, palette| { | ||
let world_gen_type = | ||
WorldGenTypes::from_str(world_gen_name).unwrap_or_else(|_| { | ||
panic!("couldn't parse world gen type from {}", world_gen_name) | ||
}); | ||
world_gen_type.as_world_gen(seed, palette) | ||
}, | ||
))); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters