feat: fully data-driven structure generation, dragon cave depth/biome fixes, BigGlobe compat#219
Draft
SavageVictor wants to merge 43 commits into
Draft
feat: fully data-driven structure generation, dragon cave depth/biome fixes, BigGlobe compat#219SavageVictor wants to merge 43 commits into
SavageVictor wants to merge 43 commits into
Conversation
- Add EntitySpawnFeatureConfig record with spawn_chance (floatRange 0-1) and entity_type (Registry codec) fields - Update all 6 spawn features to use EntitySpawnFeatureConfig instead of DefaultFeatureConfig; read spawn_chance and entity_type from JSON config - Collapse 3 DragonSkeletonSpawnFeature registrations (fire/lightning/ice) into a single `spawn_dragon_skeleton` feature type - Update all 9 configured_feature JSON files with explicit config blocks matching the original IafCommonConfig default values" Agent-Logs-Url: https://github.com/SavageVictor/IceAndFire-CE/sessions/5b0e92a1-a850-4772-8122-2e26ede98012 Co-authored-by: SavageVictor <45825013+SavageVictor@users.noreply.github.com>
…entity-spawn-configs feat: [Phase 1] Data-driven entity spawn feature configs
Agent-Logs-Url: https://github.com/SavageVictor/IceAndFire-CE/sessions/e4863ac4-1528-47ce-a07c-9ca7fdc14d2f Co-authored-by: SavageVictor <45825013+SavageVictor@users.noreply.github.com>
Agent-Logs-Url: https://github.com/SavageVictor/IceAndFire-CE/sessions/e4863ac4-1528-47ce-a07c-9ca7fdc14d2f Co-authored-by: SavageVictor <45825013+SavageVictor@users.noreply.github.com>
…nfig Agent-Logs-Url: https://github.com/SavageVictor/IceAndFire-CE/sessions/471251c9-d535-449d-ae30-73307dfb1abd Co-authored-by: SavageVictor <45825013+SavageVictor@users.noreply.github.com>
…spawn chance bug Agent-Logs-Url: https://github.com/SavageVictor/IceAndFire-CE/sessions/019234de-040c-4574-a8f6-175da383695e Co-authored-by: SavageVictor <45825013+SavageVictor@users.noreply.github.com>
…onfig Agent-Logs-Url: https://github.com/SavageVictor/IceAndFire-CE/sessions/33cec538-2178-4962-9c81-a175438b5c2d Co-authored-by: SavageVictor <45825013+SavageVictor@users.noreply.github.com>
Agent-Logs-Url: https://github.com/SavageVictor/IceAndFire-CE/sessions/bfcd9376-a9b4-4aea-8fc3-336bc6b47565 Co-authored-by: SavageVictor <45825013+SavageVictor@users.noreply.github.com>
Agent-Logs-Url: https://github.com/SavageVictor/IceAndFire-CE/sessions/9be801b3-71e7-4029-87bd-3c889ca28f92 Co-authored-by: SavageVictor <45825013+SavageVictor@users.noreply.github.com>
…ng-cyclops-config Parameterize WanderingCyclopsSpawnFeature config and fix double-gate spawn chance bug
…-deathworm-config [Phase 1] Parameterize DeathWormSpawnFeature config
…ameterize-stymphalian-bird-config # Conflicts: # common/src/main/java/com/iafenvoy/iceandfire/registry/IafFeatures.java Co-authored-by: SavageVictor <45825013+SavageVictor@users.noreply.github.com>
…-stymphalian-bird-config [Phase 1] Parameterize StymphalianBirdSpawnFeature config
…pent-config [Phase 1] Parameterize SeaSerpentSpawnFeature config
…e-dragon-skeleton-spawn-feature # Conflicts: # common/src/main/java/com/iafenvoy/iceandfire/registry/IafFeatures.java Co-authored-by: SavageVictor <45825013+SavageVictor@users.noreply.github.com>
…skeleton-spawn-feature Parameterize DragonSkeletonSpawnFeature config (age range, enabled flag)
Agent-Logs-Url: https://github.com/SavageVictor/IceAndFire-CE/sessions/7965a398-ee5e-4496-8ada-828ffe6afbfb Co-authored-by: SavageVictor <45825013+SavageVictor@users.noreply.github.com>
…pusFeatureConfig Co-authored-by: SavageVictor <45825013+SavageVictor@users.noreply.github.com>
…mpus-config [Phase 1] Parameterize HippocampusSpawnFeature config
- Add BlockTransformRule record with CODEC (from/to Block fields) - Rewrite DragonRoostStructure as concrete class with config fields: block_transform, dragon_type, loot_table, treasure_block, pile_block, generate_spires, generate_chance - Replace 3 StructureType registrations with single DRAGON_ROOST - Replace 3 StructurePieceType registrations with single DRAGON_ROOST - Delete FireDragonRoostStructure, IceDragonRoostStructure, LightningDragonRoostStructure subclasses - Update fire/ice/lightning_dragon_roost.json to use new type and include block_transform config Agent-Logs-Url: https://github.com/SavageVictor/IceAndFire-CE/sessions/81f7b165-735f-46ce-833b-6ef5bf5eb9a3 Co-authored-by: SavageVictor <45825013+SavageVictor@users.noreply.github.com>
…-dragonroost-structure [Phase 2] Collapse DragonRoost subclasses into single parameterized structure type
…on NeoForge IafFeatures.init() returns early on NeoForge, leaving all feature additions (dragon skeletons, entity spawns, lilies, ores) completely absent. This adds neoforge:add_features biome modifier JSONs that mirror the Fabric-side BiomeModifications calls, covering all 13 placed features.
…into one parameterized class * Initial plan * Collapse Fire/Ice/Lightning DragonCaveStructure subclasses into single parameterized DragonCaveStructure Agent-Logs-Url: https://github.com/SavageVictor/IceAndFire-CE/sessions/afa50231-7ec2-4e40-96e7-1909b207d208 Co-authored-by: SavageVictor <45825013+SavageVictor@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: SavageVictor <45825013+SavageVictor@users.noreply.github.com>
…cture system The NBT templates (dread_ruin_0-12.nbt, dread_exit_portal.nbt) and processors (DreadRuinProcessor, DreadPortalProcessor) existed but were never registered in the vanilla structure system — no Structure class, no template pools, no structure JSONs, no biome placement. This commit wires everything up end-to-end: - DreadRuinStructure / DreadPortalStructure (IafJigsawStructure subclasses) - Registered in IafStructureTypes (dread_ruin, dread_portal) - Template pools: dread_ruin/start_pool with all 13 variants; dread_portal/start_pool - Processor lists: dread_ruin_processors, dread_portal_processors - structure/ + structure_set/ JSONs with spacing tuned for the dread dimension - Biome tags structure_gen/dread_ruin + structure_gen/dread_portal targeting dread_forest + dread_plain - Config entries generateDreadRuinChance (0.5) + generateDreadPortalChance (0.2)
- Add AmphithereSpawnFeature using the existing generic EntitySpawnFeatureConfig - Register SPAWN_AMPHITHERE feature and PLACED_SPAWN_AMPHITHERE placed feature key in IafFeatures - Wire IafBiomeTags.AMPHITHERE into Fabric biome modifications in IafFeatures.init() - Add configured_feature/spawn_amphithere.json (spawn_chance 0.033, entity iceandfire:amphithere) - Add placed_feature/spawn_amphithere.json (WORLD_SURFACE_WG heightmap + biome placements) - Add NeoForge biome modifier JSON targeting #iceandfire:entity_gen/amphithere - Remove resolved TODO comment from AmphithereEntity.getCanSpawnHere()
…sed for pixie.size)
…haned worldGen config fields Apply StructureGenerationConfig to DreadRuinStructure, DreadPortalStructure, MausoleumStructure, GorgonTempleStructure, and GraveyardStructure, replacing IafCommonConfig.worldGen.generateXxxChance references with codec-driven generation config stored per-structure in JSON. Add explicit generate_chance: 0.2 to dread_portal.json to preserve the original lower spawn rate (default would otherwise be 0.5). Remove all 15 per-structure generate chance fields from IafCommonConfig WorldGenConfig; only dangerousDistanceLimit remains.
Replace hardcoded 'bottomY + 40 + random(30)' formula with two optional codec fields: y_base (default -24) and y_range (default 30). Defaults exactly replicate vanilla behaviour (Y -24..+5) while letting datapacks override placement depth for mods like BigGlobe whose bottomY is ~-1024.
getStructurePosition previously returned a surface Y position, so the biome check happened at surface level. Underground world-height mods (e.g. BigGlobe) assign cave biomes only at depth, making the check always fail and caves never spawn. Fix: compute cave Y (yBase + random * yRange) in getStructurePosition, build cavePos from surface X/Z + cave Y, and return that as the StructurePosition. The biome check now happens at cave level, /locate points to the actual cave entrance, and addPieces uses pos.getY() instead of recomputing Y internally.
Move example-datapack and bigglobe-compat-datapack into a shared datapacks/ directory. Also fixes example-datapack README (y_base/y_range fields added to dragon_cave table) and corrects a misleading comment in dread_portal.json about omitting the generation block.
Owner
|
WorldGenConfig keeps for common players to change generate chance more easily |
Author
|
@IAFEnvoy I can bring it back and overridable by datapacks, is that ok? |
Owner
|
Other stuffs are ok and also i have planned to port to NeoForge only so you don't need to care for Fabric platform |
Owner
|
Too long time no response and i cannot wait for you to do next task: #220 I turn this PR to draft and once you support new code you can mark as ready again. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The primary motivation for this rewrite is to add proper support for Big Globe. Dragon caves previously never generated in Big Globe worlds due to a biome check running at surface Y instead of cave Y, and there was no way to configure cave depth via datapack. This PR addresses both issues and takes the opportunity to make all structure generation fully data-driven while at it.
A built jar (Fabric + NeoForge, MC 1.21.1) is available on the fork for testing: https://github.com/SavageVictor/IceAndFire-CE/releases/tag/v2.0-beta.15
Changes
1. Data-driven structure generation configs
All 15 structures now read their spawn chance and behaviour from their worldgen JSON rather than from
IafCommonConfig. A sharedStructureGenerationConfigrecord (with agenerate_chancefield, default0.5) is codec-decoded by every structure.IafCommonConfig.WorldGenConfigretains onlydangerousDistanceLimit.2. Dragon cave depth fields (
y_base/y_range)DragonCaveStructuregains two new codec fields:y_base-24y_range30y_baseDefaults reproduce the previous hard-coded behaviour. World-gen mods with different height maps can override these per cave type via datapack.
3. Dragon cave biome check anchored to cave Y
getStructurePositionnow returns the cave position (surface X/Z + cave Y) instead of the surface position. The vanilla biome eligibility check therefore runs at cave depth, and/locatepoints to the actual cave entrance. Without this fix, dragon caves never generate in BigGlobe worlds because the surface biome at those coords is not in any dragon biome tag.4. Datapacks (
datapacks/)example-datapack_commentexplanationsbigglobe-compat-datapacky_base/y_rangeoverrides, entity spawn biomes, ore feature dispatchersTesting
v2.0-beta.15on the fork includes both jars./locateconfirmed to return cave-level coordinates.