# ChanceMapping

Used to describe vein composition.
Defines rules for replacing base blocks with ore in veins.
**For each block in the vein, the rule is chosen anew.**

## How It Works

For **each block** in the vein:
1. **Random rule selection** from the list based on weights (`chance`)
2. **Replacement check**: look up the block in the selected rule's `mapping`
3. **Apply or skip**: if found — replace, if not — leave as is

### Rule - ChanceMapping
```json
{
  "chance": 1.0,           // Weight of this rule
  "mapping": {            // Replacement dictionary
    "base_block": "target_block"
  }
}
```

### Vein composition - ChanceMapping[]
```json
[
  {
    "chance": 1.0,
    "mapping": {
      "minecraft:stone": "minecraft:iron_ore",
      "minecraft:deepslate": "minecraft:deepslate_iron_ore"
    }
  },
  {
    "chance": 7.0,
    "mapping": {
      "minecraft:stone": "minecraft:gravel"
    }
  },
  {
    "chance": 2.0,
    "mapping": {
      "minecraft:stone": "minecraft:tuff"
    }
  }
]
```

## Algorithm Details



### What Happens Block by Block

Let's say a vein consists of 4 stone blocks:

Block 1:

    Gravel rolled → replace stone with gravel

Block 2:

    Iron rolled → replace stone with iron_ore

Block 3:

    Gravel again → stone to gravel

Block 4:
    
    Tuff rolled → stone to tuff

Result: [gravel, iron_ore, gravel, tuff] — each block was chosen independently!


### Probabilities

For the example above:

- Gravel: 70% (7 out of 10)
- Iron: 10% (1 out of 10)
- Tuff: 20% (2 out of 10)

In a large vein, the distribution will roughly match these percentages.