Phase 4: veins in every chunk, drops for the mobs the island lacks

Ore veins: make_world.py loads the island again row by row until
Regenerating Ore Veins has filled every chunk (/cobblesurvival veins
unfilled), cave tiers sit at their biome's depths, small zones get denser
veins, showcase veins are full size. The world report checks surface
tiers against the zone grid, cave tiers within two biome cells of their
cave, and fails on unfilled chunks; the template passes (37,689 chunks).

Drops: tools/drop_audit.py checks every creature drop a recipe or brewing
needs (docs/pokemon-drops.md). Blaze rods, ghast tears, breeze rods,
shulker shells and nether stars now drop from Pokemon through species
additions (self-test drop_additions_apply). The field guide counts vanilla
mobs as absent, applies species additions and reads the veins as sources.

Cobblebase tried (loads, self-tests pass) and left out until Adrian
decides its scope. Phase 4 checklist with the open questions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
claudeandClaude Opus 5.5 committed 2026-10-30 03:36:50 +01:00
1 parent 5d275e4e14
commit 1a1fb93da8
33 files changed
+1279 -126

No files matched your search

+5 -2
View File
@@ -18,7 +18,8 @@ Writes build/field-guide/:
Usage: tools/fieldguide/build.py [--out DIR] [--no-icons] [--no-server] [--from-json FILE] [--extra FILE ...]
--no-server never start Minecraft: use the last KubeJS recipe export even if the pack changed since
--from-json skip extraction and render an existing fieldguide.json (e.g. one a runtime exporter wrote)
--extra add sources from a JSON file (format in docs/field-guide.md), e.g. ore veins or trades
--extra add sources from a JSON file (format in docs/field-guide.md), e.g. trades; the ore veins
(world/vein-sources.json, written by tools/zone_ores.py) are always added
"""
import argparse
import json
@@ -33,6 +34,7 @@ from fieldguide.icons import Icons # noqa: E402
from fieldguide.model import Model # noqa: E402
ROOT = Path(__file__).resolve().parent.parent.parent
VEIN_SOURCES = ROOT / "world/vein-sources.json" # the regenerating ore veins (tools/zone_ores.py), always read
def main():
@@ -52,7 +54,8 @@ def main():
else:
print("reading the pack's data")
stack = datasource.build_stack(log=_log_once())
model = Model(stack, log=lambda msg: print(" " + msg), extras=args.extra, kubejs=_kubejs(args.no_server))
extras = [VEIN_SOURCES] + args.extra if VEIN_SOURCES.exists() else args.extra
model = Model(stack, log=lambda msg: print(" " + msg), extras=extras, kubejs=_kubejs(args.no_server))
icons = {}
if not args.no_icons:
wanted = set(model.mod_items) | _vanilla_mentions(model)
+12 -1
View File
@@ -193,6 +193,14 @@ class Model:
}
for e in (d.get("drops") or {}).get("entries", []):
self.referenced.add(norm_id(e["item"]))
# Species additions (data/<ns>/species_additions/) replace the fields they set; drops is the one the guide shows.
for _, rel in sorted(self.stack.ids("species_additions").items()):
d = self.stack.json(rel) or {}
target = self.species.get(norm_id(d.get("target", "")))
if target is not None and "drops" in d:
target["drops"] = d["drops"]
for e in d["drops"].get("entries", []):
self.referenced.add(norm_id(e["item"]))
def species_name(self, sid):
return self.species.get(sid, {}).get("name") or sid.split(":")[-1].title()
@@ -563,9 +571,12 @@ class Model:
text = {"biome": "Spawns in " + _join([self.biome_name(b) for b in where]),
"structure": "Spawns in " + _join([self.structure_name(s) for s in where]),
"special": _join(where).capitalize()}[e["kind"]]
if not self.island.mob_allowed(mob):
text += " (but only Pokémon live on the island)"
self.add(f"mob:{mob}", e["kind"], text, base=e["status"])
for mob, (item, note) in self.island.item_mobs.items():
self.add(f"mob:{mob}", "item", note.capitalize(), needs=[[f"item:{item}"]])
if self.island.mob_allowed(mob):
self.add(f"mob:{mob}", "item", note.capitalize(), needs=[[f"item:{item}"]])
def _spawn_nodes(self):
self.spawn_by_species = defaultdict(list)
+10
View File
@@ -515,6 +515,16 @@ class Island:
self._add_mob(mob, "special", note, st)
elif kind == "item":
self.item_mobs[mob] = (req, note)
# The companion mod lets only Cobblemon's entities join a world (world/OnlyPokemon.kt), apart from the
# entity type tag cobblesurvival:allowed_vanilla_mobs; every other mob never appears, whatever spawns it.
self.allowed_mobs = self.tags["entity_type"].resolve("#cobblesurvival:allowed_vanilla_mobs")
for mob, entries in self.mobs.items():
if not self.mob_allowed(mob):
for e in entries:
e["status"] = "unavailable"
def mob_allowed(self, mob):
return mob.startswith("cobblemon:") or mob in self.allowed_mobs
def _add_mob(self, mob, kind, where, status):
lst = self.mobs.setdefault(mob, [])