Skip to content

[v6.0 - BREAKING] Config Format v2.0 #53

@null2264

Description

@null2264

CobbleGen v6.0 will use TOML formatting with support for JSON5 to load config format v1.x.

JSON5

This new format could potentially reduce confusion when trying to define custom gen while keeping it very similar to the old one.

customGen will be removed and merged with "normal gens" (cobbleGen, stoneGen, basaltGen). Users will only need to set "modifier" to whatever block ID they want the modifier to be and set it to empty or * for wildcard (any block).

y level will no longer defined with maxY and minY, it'll be merged into range string instead. The old maxY and minY will still work, but will soon be removed in the future. REF: https://maven.apache.org/enforcer/enforcer-rules/versionRanges.html

{
  <...Gen>: [
    {
      "id": "minecraft:stone",
      "weight": 1.0,
      "modifier": "minecraft:bedrock",  // empty will be default (cobble/stone gen use wildcard, basalt use soul soil) or '*' will be seen as "wildcard"
      "yLevel": "[0,)",  // range is defined from max to min, in this example y level is defined as y level 0 until bedrock.
    },
    {
      "id": "minecraft:basalt",
      "weight": 1.0,
      "modifier": "",  // you can either explicitly set it to empty or remove this line entirely to use default.
    },
    {
      "id": "minecraft:cobblestone",
      "weight": 1.0,
      "modifier": "*",
    },
  ],
}

TOML

Completely change the config formatting. Could be transformed into JSON in the backend to support both TOML and JSON.

[[cobblegen]]  # same as JSON, you can use 'cobblegen', 'basaltgen' and 'stonegen', except they should be written in lowercase.
id = "minecraft:cobblestone"
weight = 1.0
modifier = "*"  # empty will be default (cobble/stone gen use wildcard, basalt use soul soil) or '*' will be seen as "wildcard"

[[cobblegen]]
id = "minecraft:cobbled_deepslate"
weight = 1.0
modifier = "*"
yLevel = "[0,)"  # range is defined from max to min, in this example y level is defined as y level 0 until bedrock.

[[basaltgen]]
id = "minecraft:basalt"
weight = 1.0
modifier = ""  # you can either explicitly set it to empty or remove this line entirely to use default.

# a bit of mouthful, but this is basically means "if lava touch water" (aka cobblegen behaviour).
# [[advancedgen.<source>.<target>]]
[[advancedgen."minecraft:lava"."minecraft:water"]]
id = "minecraft:basalt"
weight = 1.0
modifier = "*"
# Types:
# - cobble: lava touches water (cobblegen)
# - stone: lava touches water from above or water source touched by lava (stonegen)
# - obsidian: lava source touched by water (failed cobblegen)
#
# Will be ignored if target is started with b:, this will cause the generator to turn into basalt type by default. See next example.
type = "stone"

[[advancedgen."minecraft:lava"."b:minecraft:blue_ice"]]
id = "minecraft:basalt"
weight = 1.0
modifier = ""
type = "stone"  # this is ignored, become basalt by default under the hood.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions