Phase 8 begins: quest and JEI add-ons, checked against the pack

Adrian's Phase 8 answers (2026-11-03): Cobblemon tasks from Cobblemon Quests
Reloaded; JEI gets the Cobblemon Info for REI/JEI/EMI add-on, its spawn info
checked against the pack, plus our own pages; no quest rewards; quests
generated from docs/quests.yaml with in-game node moves read back.

- Cobblemon Quests Reloaded 2.0.2+1.8 (CF only, CC-BY-NC-4.0): declares
  Cobblemon 1.8+ and FTB Quests 2101+; adds cobblemon_tasks:cobblemon_task.
  Its bundled MongoDB client is an optional storage backend, off by default.
- Cobblemon Info for REI/JEI/EMI 2.32.14 (MIT, both sides): reads the live
  spawn pool, so it shows the zone pools' species, levels and rarity; it lists
  biomes, not zones (our pages will add the zone). Without it on the server a
  client falls back to Cobblemon's own spawn files.
- crosslink.py found the same Cobblebase and Cobblemon HMs files on CF.
- Self-tests quests_have_cobblemon_tasks and jei_addon_shows_island_spawns
  (every entry the add-on shows is one of the pack's, at the zone's levels,
  none missing). Smoke test, self-tests and the island check pass.
- Docs: design.md Phase 8 section and plan, checklists/phase-8.md,
  addon-status.md, licenses.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
claudeandClaude Opus 5.5 committed 2026-11-03 10:37:57 +01:00
1 parent fe6b8dfe57
commit 9fb5e9895e
12 files changed
+142 -9

No files matched your search

@@ -0,0 +1,47 @@
package dev.cobblesurvival.selftest
import com.cobblemon.mod.common.api.spawning.CobblemonSpawnPools
import com.cobblemon.mod.common.api.spawning.detail.PokemonSpawnDetail
import dev.cobblesurvival.zone.Zones
/**
* Roadmap Phase 8 (Adrian, 2026-11-03): the add-ons the quest book and JEI lean on work with the pack. Read by
* reflection, so the companion mod needs neither at compile time.
*/
object QuestTests {
fun all() = listOf(
SelfTestCase("quests_have_cobblemon_tasks", 20, ::cobblemonTasks),
SelfTestCase("jei_addon_shows_island_spawns", 20, ::addonSpawns),
)
/** Cobblemon Quests Reloaded adds its task type (catch, defeat, evolve, level up, ...) to FTB Quests. */
private fun cobblemonTasks(s: Scenario) {
val types = Class.forName("dev.ftb.mods.ftbquests.quest.task.TaskTypes").getField("TYPES").get(null) as Map<*, *>
s.check(types.keys.any { it.toString() == "cobblemon_tasks:cobblemon_task" }) { "FTB Quests has no Cobblemon task type: ${types.keys}" }
s.helper.succeed()
}
/**
* Cobblemon Info for REI/JEI/EMI shows what the pack's own spawn pools say (Adrian: check that its spawn info is
* right for the pack): every entry it lists is one of the zone pools' entries, at the zone's levels, and it lists
* all of them. It can't show the zone itself, only the zone's biomes (docs/design.md, Phase 8).
*/
private fun addonSpawns(s: Scenario) {
val loader = Class.forName("com.cobbledex.SpawnDataLoader")
val shown = (loader.getMethod("loadFromRuntime").invoke(loader.getField("INSTANCE").get(null)) as Map<*, *>).values.flatMap { it as List<*> }
fun field(info: Any?, name: String) = info!!.javaClass.getMethod("get" + name.replaceFirstChar { it.uppercase() }).invoke(info) as String
val ours = CobblemonSpawnPools.WORLD_SPAWN_POOL.details.filterIsInstance<PokemonSpawnDetail>().associateBy { it.id }
s.check(shown.isNotEmpty()) { "the JEI add-on shows no spawns" }
val strangers = shown.map { field(it, "id") }.filter { it !in ours }
s.check(strangers.isEmpty()) { "the JEI add-on shows ${strangers.size} spawns the pack doesn't have, e.g. ${strangers.take(5)}" }
val wrongLevels = shown.filter { info ->
val zone = Zones.byId[field(info, "id").substringBefore('-')] ?: return@filter true
val (low, high) = field(info, "levelRange").split("-").map { it.toInt() }
low < zone.minLevel || high > zone.maxLevel
}
s.check(wrongLevels.isEmpty()) { "the JEI add-on shows levels outside the zone's band: ${wrongLevels.take(5).map { field(it, "id") + " " + field(it, "levelRange") }}" }
val missing = ours.keys - shown.map { field(it, "id") }.toSet()
s.check(missing.isEmpty()) { "the JEI add-on leaves out ${missing.size} of the pack's spawns, e.g. ${missing.take(5)}" }
s.helper.succeed()
}
}