pub struct StructureGenerator {
seed: i64,
structure_sets: Vec<(Identifier, StructureSet)>,
structure_set_indices: FxHashMap<Identifier, usize>,
structure_data: FxHashMap<Identifier, StructureRef>,
ring_positions: FxHashMap<Identifier, Vec<ChunkPos>>,
template_pools: FxHashMap<Identifier, TemplatePoolData>,
templates: FxHashMap<Identifier, TemplateData>,
structure_impls: FxHashMap<Identifier, Box<dyn Structure>>,
}Expand description
Runtime equivalent of vanilla’s ChunkGeneratorStructureState plus structure
implementation dispatch.
Fields§
§seed: i64§structure_sets: Vec<(Identifier, StructureSet)>§structure_set_indices: FxHashMap<Identifier, usize>§structure_data: FxHashMap<Identifier, StructureRef>§ring_positions: FxHashMap<Identifier, Vec<ChunkPos>>§template_pools: FxHashMap<Identifier, TemplatePoolData>§templates: FxHashMap<Identifier, TemplateData>§structure_impls: FxHashMap<Identifier, Box<dyn Structure>>Implementations§
Source§impl StructureGenerator
impl StructureGenerator
Sourcepub fn vanilla(
seed: i64,
world_path: Option<&Path>,
biome_provider: &(impl StructureBiomeProvider + Sync),
thread_pool: &ThreadPool,
) -> Self
pub fn vanilla( seed: i64, world_path: Option<&Path>, biome_provider: &(impl StructureBiomeProvider + Sync), thread_pool: &ThreadPool, ) -> Self
Creates a structure generator over all vanilla structure sets.
Sourcepub fn vanilla_with_structure_sets(
seed: i64,
world_path: Option<&Path>,
biome_provider: &(impl StructureBiomeProvider + Sync),
structure_sets: Vec<(Identifier, StructureSet)>,
thread_pool: &ThreadPool,
) -> Self
pub fn vanilla_with_structure_sets( seed: i64, world_path: Option<&Path>, biome_provider: &(impl StructureBiomeProvider + Sync), structure_sets: Vec<(Identifier, StructureSet)>, thread_pool: &ThreadPool, ) -> Self
Creates a generator over an explicit structure-set list while keeping all template pools, templates, and structure implementation dispatch vanilla.
Sourcepub fn vanilla_flat_with_structure_sets(
seed: i64,
world_path: Option<&Path>,
biome_provider: &(impl StructureBiomeProvider + Sync),
structure_sets: Vec<(Identifier, StructureSet)>,
thread_pool: &ThreadPool,
) -> Self
pub fn vanilla_flat_with_structure_sets( seed: i64, world_path: Option<&Path>, biome_provider: &(impl StructureBiomeProvider + Sync), structure_sets: Vec<(Identifier, StructureSet)>, thread_pool: &ThreadPool, ) -> Self
Creates a vanilla superflat structure generator.
Vanilla superflat uses the level seed for random-spread placement and
structure selection, but always seeds concentric-ring positions with
0L.
Sourcepub fn with_assets(
seed: i64,
world_path: Option<&Path>,
biome_provider: &(impl StructureBiomeProvider + Sync),
structure_sets: Vec<(Identifier, StructureSet)>,
assets: StructureGeneratorAssets,
thread_pool: &ThreadPool,
) -> Self
pub fn with_assets( seed: i64, world_path: Option<&Path>, biome_provider: &(impl StructureBiomeProvider + Sync), structure_sets: Vec<(Identifier, StructureSet)>, assets: StructureGeneratorAssets, thread_pool: &ThreadPool, ) -> Self
Creates a generator from explicit structure sets and explicit runtime assets.
fn with_assets_for_ring_seed( seed: i64, ring_position_seed: i64, world_path: Option<&Path>, biome_provider: &(impl StructureBiomeProvider + Sync), structure_sets: Vec<(Identifier, StructureSet)>, assets: StructureGeneratorAssets, thread_pool: &ThreadPool, ) -> Self
Sourcepub const fn template_pools(&self) -> &FxHashMap<Identifier, TemplatePoolData>
pub const fn template_pools(&self) -> &FxHashMap<Identifier, TemplatePoolData>
Template pool registry used by structure contexts.
Sourcepub const fn templates(&self) -> &FxHashMap<Identifier, TemplateData>
pub const fn templates(&self) -> &FxHashMap<Identifier, TemplateData>
Structure templates used by structure contexts.
Sourcepub fn locate_plan_for_structures(
&self,
structures: &[Identifier],
) -> Option<StructureLocatePlan>
pub fn locate_plan_for_structures( &self, structures: &[Identifier], ) -> Option<StructureLocatePlan>
Builds a detached locate plan for one or more structure ids.
Sourcepub fn generate_starts_for_chunk(
&self,
ctx: &mut dyn StructureGenerationContext,
has_existing_start: impl FnMut(&Identifier) -> bool,
) -> Vec<StructureStart>
pub fn generate_starts_for_chunk( &self, ctx: &mut dyn StructureGenerationContext, has_existing_start: impl FnMut(&Identifier) -> bool, ) -> Vec<StructureStart>
Generates structure starts for one chunk.
fn rings_for_set(&self, set_key: &Identifier) -> Option<&[ChunkPos]>
fn is_structure_chunk_for_set( &self, set_key: &Identifier, source_x: i32, source_z: i32, stack: &mut Vec<Identifier>, ) -> bool
fn is_excluded( &self, placement: &StructurePlacement, source_x: i32, source_z: i32, stack: &mut Vec<Identifier>, ) -> bool
fn select_structure( &self, set: &StructureSet, ctx: &mut dyn StructureGenerationContext, ) -> Option<(StructureRef, GenerationStub)>
fn try_generate_entry( &self, entry: &StructureSelectionEntry, ctx: &mut dyn StructureGenerationContext, ) -> Option<(StructureRef, GenerationStub)>
Auto Trait Implementations§
impl !RefUnwindSafe for StructureGenerator
impl !UnwindSafe for StructureGenerator
impl Freeze for StructureGenerator
impl Send for StructureGenerator
impl Sync for StructureGenerator
impl Unpin for StructureGenerator
impl UnsafeUnpin for StructureGenerator
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreArc<SyncMutex<>>