Skip to content

[1.18.2 API] OreDimensionDefinition.Builder cannot express supported biome filters #268

Closed

Description

@SkyBlade1978

Environment

  • Minecraft: 1.18.2
  • OreSpawn candidate: 4.0.12.118021
  • OreSpawn commit: 7c82ecc844ae9d241a108f4417c6c3b5b0bc29a2
  • OreSpawn JAR SHA-256: 0478D611A96020DAAE794B72E64EFD677B49A5B63BCB6179330D63317B16D6A6
  • Consumer: CakeWorld master-1.18.2 at 0a3fb0dd6788d2fcad78f82d20154a772ff93d05

Shortcoming

OreSpawn schema/profile JSON and runtime baking support these ore-placement fields:

  • biome_ids
  • excluded_biome_ids
  • biome_dictionary
  • excluded_biome_dictionary

However, the public WorldgenProvider.OreDimensionDefinition model and its Builder expose none of them. A mod using the supported Forge IMC builder API therefore cannot create the same ore rule that a packaged JSON provider can create.

This is especially visible now that 4.0.12 fixes dynamic-registry biome matching: CakeWorld tried to add an isolated public-IMC regression for exact-ID and dictionary include/exclude behavior, but the public builder cannot express the regression.

The equivalent public FluidDepositDimensionDefinition already has the expected parity: fields, immutable getters, JSON serialization, and builder methods for all four filters.

Minimal reproduction

WorldgenProvider.builder("examplemod", 1)
    .ore(new ResourceLocation("examplemod", "filtered_ore"),
         new ResourceLocation("minecraft", "coal_ore"), ore -> ore
        .dimensionSelector(OreDimensionSelector.ALL_EXCEPT_NETHER_AND_END,
            placement -> placement
                .yRange(32, 47)
                .attempts(1.0D)
                .quantity(8)
                .pattern(OrePattern.CLUSTERS)
                .hostBlock(new ResourceLocation("minecraft", "stone"))
                .biome(new ResourceLocation("minecraft", "plains"))
                .biomeDictionary("FOREST")
                .excludeBiome(new ResourceLocation("minecraft", "dark_forest"))
                .excludeBiomeDictionary("SPOOKY")))
    .build();

Compilation stops at the first filter:

error: cannot find symbol
    .biome(new ResourceLocation(...))
    ^
  symbol:   method biome(ResourceLocation)
  location: class Builder

Current API gap

OreDimensionDefinition currently stores/serializes hosts and geome weights, but has no biome-filter state. Its toJson() therefore cannot emit the four fields either. This affects both explicit .dimension(...) and .dimensionSelector(...) because both consumers receive the same builder type.

By contrast, FluidDepositDimensionDefinition.Builder already exposes:

biome(ResourceLocation)
excludeBiome(ResourceLocation)
biomeDictionary(String)
excludeBiomeDictionary(String)

Expected public contract

Give OreDimensionDefinition parity with fluid deposits:

  • immutable storage and getters for the four filter sets;
  • toJson() output using the schema field names;
  • the same four fluent builder methods;
  • validation/normalization consistent with JSON provider loading;
  • coverage for explicit dimensions and dimension selectors;
  • detached/immutable built definitions remain immutable through toJson().

Suggested acceptance test

A public IMC provider should be able to compile and generate a diagnostic rule with:

  • exact-ID included biome: output present;
  • dictionary-included biome: output present;
  • exact-ID excluded biome that otherwise matches: zero output;
  • dictionary-excluded biome that otherwise matches: zero output;
  • neutral biome: zero output;
  • explicit disabled Overworld override still winning over a matching selector.

Activity

  1. SkyBlade1978 commented on Aug 29, 2026

    @SkyBlade1978
    ContributorAuthor

    Runtime clarification from the 4.0.12 CakeWorld retest: this is API-builder parity only, not a JSON/runtime filter defect.

    Using packaged provider JSON, the new cakeworld_sampler_biome_filters regression passed fresh and same-save reload with exact include/exclude and dictionary include/exclude controls:

    • exact: Candy Plains 148, excluded Cookie Forest 0, neutral Peppermint Pinewoods 0
    • dictionary: CakeWorld Peppermint Pinewoods 193, vanilla Forest 180, excluded DENSE Cookie Forest 0, neutral Candy Plains 0

    The compile reproduction in this ticket still fails because OreDimensionDefinition.Builder cannot emit those same fields. FluidDepositDimensionDefinition.Builder remains the working parity reference.

  2. SkyBlade1978 commented on Sep 9, 2026

    @SkyBlade1978
    ContributorAuthor

    Closing as completed. Fixed in the 4.0.13 portion of 4.0.16.118021 via #270. OreDimensionDefinition and its builder now expose immutable exact-biome and dictionary/tag include/exclude contracts, serialized through the existing provider fields without changing API major or schemas.

    Public-builder JSON round trips and include/exclude controls are covered on every target. The API parity repair is now merged across the full Forge and NeoForge campaign, ending with #300.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions