WIP: ore nodes, catching rules, bee nest fix, smaller Deep Dark

Done and checked: surface and cave-floor ore nodes (companion mod
ore/OreNodes.kt), bigger and rarer underground veins; template with nodes
passed the world check and the island quick check (node self-tests).

Built, not yet tested: catching rules (catch rate falls with the level
gap to the trainer's strongest Pokemon, failed catch enrages, strong wild
Pokemon hunt weaker trainers; catching/, Fight or Flight config), bee
nests emptied when their bee is turned away.

In progress: the Deep Dark no longer fills the deepslate layer (split by
temperature: cold = Deep Dark, hot = basalt deltas, warm = ordinary caves;
world/biomes.json), zone layout regenerated; cave zone types added to
world/zones.json but tools/zone_spawns.py doesn't use them yet; template
not rebuilt for the new caves.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
claudeandClaude Opus 5.5 committed 2026-10-30 15:44:17 +01:00
1 parent 362d06aa4b
commit 6361636da7
29 files changed
+1733 -357

No files matched your search

+30 -9
View File
@@ -3,15 +3,17 @@
* Ore scan: every block in every stored chunk is checked. Ore ("*_ore",
ancient debris, raw ore blocks from large veins) is only allowed as part of
a regenerating vein (Regenerating Ore Veins' saved data), and each vein's
blocks must lie in the zone of its ore tier (world/zones.json → "ores").
a regenerating vein (Regenerating Ore Veins' saved data: the underground
veins and the companion mod's ore nodes), and each vein's blocks must lie
in the zone of its ore tier (world/zones.json → "ores").
A surface tier's blocks must lie in its zone's grid cells (the mod checks
every block against the zone's boxes; at a cave border a vein can reach
into the cave biome). A cave tier's blocks must lie within two biome cells
(8 blocks) of its cave biome: the mod checks the biome only at a vein's
centre, and Minecraft blends biomes over a few blocks. Untracked ore fails
the check, and so (except with --sample) do an ore tier without any vein
and a chunk the mod never put veins into.
the check, and so (except with --sample) do an ore tier without nodes, a
surface tier without underground veins, and a chunk that never got its
veins and nodes.
* Biome set: every biome stored in any chunk section (surface and caves)
must be listed in world/biomes.json ("allowed" or "water").
* End access: at least one stronghold must start inside the world border.
@@ -231,20 +233,37 @@ def read_veins(world):
return veins, filled
def read_node_chunks(world):
"""The chunks the companion mod has put its ore nodes into (ore/OreNodes.kt)."""
path = Path(world, "data/cobblesurvival_ore_nodes.dat")
if not path.exists():
return set()
import gzip
data = anvil.parse_nbt(gzip.decompress(path.read_bytes()))
done = set()
for packed in data.get("data", data).get("done", []):
packed = int(packed)
x, z = packed & 0xFFFFFFFF, (packed >> 32) & 0xFFFFFFFF
done.add((x - (1 << 32) if x >= 1 << 31 else x, z - (1 << 32) if z >= 1 << 31 else z))
return done
def check_veins(world, ore_at, full_chunks, sample):
"""Every ore block belongs to a tracked vein in its tier's zone; returns (blocks per tier and zone, problems)."""
plan = json.loads((ROOT / "world/zones.json").read_text())
grid = zone_grid.load()
cave_biome = {c["id"]: c["biome"] for c in plan["caves"]}
veins, filled = read_veins(world)
per_tier, untracked, stray = {}, {}, {}
nodes_done = read_node_chunks(world)
per_tier, untracked, stray, kinds = {}, {}, {}, set()
for x, y, z, name, biome, near_caves in ore_at:
vein = veins.get((x, y, z))
if vein is None:
if ORE.search(name): # amethyst outside a vein is a natural geode
untracked[name] = untracked.get(name, 0) + 1
continue
tier = vein.removesuffix("_showcase").removesuffix("_deep")
tier = vein.removesuffix("_node").removesuffix("_deep")
kinds.add((tier, "node" if vein.endswith("_node") else "vein"))
zone = grid.zone_at(x, z, biome) or "none"
counts = per_tier.setdefault(tier, {})
counts[zone] = counts.get(zone, 0) + 1
@@ -257,10 +276,12 @@ def check_veins(world, ore_at, full_chunks, sample):
stray.setdefault((vein, zone, want), []).append((x, y, z))
problems = [f"{n} {name} outside any regenerating vein" for name, n in sorted(untracked.items())]
if not sample:
problems += [f"ore tier {tier} has no vein in the world" for tier in plan["ores"] if tier not in per_tier]
unfilled = [c for c in full_chunks if c not in filled]
problems += [f"ore tier {tier} has no ore nodes in the world" for tier in plan["ores"] if (tier, "node") not in kinds]
problems += [f"ore tier {tier} has no underground veins in the world" for tier, spec in plan["ores"].items()
if "veins" in spec and (tier, "vein") not in kinds]
unfilled = [c for c in full_chunks if c not in filled or c not in nodes_done]
if unfilled:
problems.append(f"{len(unfilled)} chunks never got their ore veins (e.g. chunk {unfilled[0]})")
problems.append(f"{len(unfilled)} chunks never got their ore veins and nodes (e.g. chunk {unfilled[0]})")
problems += [f"{len(at)} blocks of vein {vein} in zone {zone}, not {want or '(no tier)'} (e.g. {at[0]})"
for (vein, zone, want), at in sorted(stray.items(), key=str)]
return per_tier, problems