From 3f80b3c200d9c72db45e42008f86213cda007c2e Mon Sep 17 00:00:00 2001 From: Michael Gilardi <11632652+mgilardi@users.noreply.github.com> Date: Sun, 22 Nov 2026 23:59:02 -0700 Subject: [PATCH] Bot-test quest unlocks with PlaceholderAPI K604: a quests section in the bot suite covers every tier-unlock mode, unlock and lock, the level placeholder, unknown placeholders and the Yard refused, through PlaceholderAPI 2.12.3. Full suite passed on throwaway Paper 26.2 (215/215) and 26.3 (113/113). A real BetonQuest chapter and a real client are still untested. Task: K604 Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 2 +- README.md | 2 +- test/fetch-jars.mjs | 1 + test/suite.mjs | 33 ++++++++++++++++++++++++++++++++- 4 files changed, 35 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 711c8e4..f87e329 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ Quest chapters. - **New admin commands for quests:** `/mobsquad unlock `, `/mobsquad lock ` and `/mobsquad page `. A quest plugin runs them from the console, for example through BetonQuest's command event. The player is told when a tier or page opens. A quest unlock is saved in the player's file as a `tier` line; older versions skip that line, and older files load with none. - **Placeholders, if PlaceholderAPI is installed:** `%mobsquad_level%`, `critters`, `pages`, `tier_`, `page_`, `has_` and `best_`, for quest conditions. Only the player's own progress, only while they're online, and nothing about anyone else or where they are. - MobSquad doesn't link to BetonQuest's code, so it works with any BetonQuest version (the live server runs a 3.3 development build) and with other quest plugins. -- Tested: unit tests (54: every unlock mode, Yard always open, the setting and a bad value, saving and old files, every placeholder and unknown ones). Not run on a server yet: the commands, the PlaceholderAPI registration and a real BetonQuest chapter. No chapters are written yet; they're server content. +- Tested: unit tests (54: every unlock mode, Yard always open, the setting and a bad value, saving and old files, every placeholder and unknown ones). Bots on throwaway Paper servers (2026-11-22): the full suite passed on 26.2 (215 of 215) and on 26.3 (113 of 113, where the menu sections can't run), including a new quests section with PlaceholderAPI 2.12.3: every unlock mode, `unlock` and `lock`, the level placeholder, an unknown placeholder and the Yard refused. Not tested yet: a real BetonQuest chapter, and anything in a real game client. No chapters are written yet; they're server content. ## 0.8.1 diff --git a/README.md b/README.md index fd1007d..fb9e9db 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Coax mobs into critters for Paper: they follow you, fight only hostile mobs, and live safely in a shared Bunkhouse. No client mods. Gotta coax em all... Pokemob! -**Status:** 0.9.0. Quest chapters (tier and page unlocks, placeholders), checked by unit tests only so far. 0.8.1: pigs, cows, chickens and frogs also glow and worlds can be set to no glow, also unit tests only. 0.8.0 passed with bots on throwaway Paper 26.1.2 and 26.2 servers (the full suite, 197 checks each) and on 26.3 (95 checks), then the Bunkhouse and coats parts again on all three after a last small change (43 checks on 26.1.2 and 26.2, 26 on 26.3). On 26.3 the bots can't use blocks, so the Bunkhouse menu, picking a coat in it and everything sent out from it didn't run there; the coats themselves ran, with the sidekick getting critters out. Bots can't crouch where the server sees it, so the creeper and fox puzzles were tested with a test-only stand-in for crouching; real crouching is untested. The daily sidekick roll is covered by unit tests only, since it needs 10 hours out. Nothing has been seen in a real game client yet, so how the glow, the particle trail and the chicken variants look is unchecked. Wolves, cats, pigs, cows and frogs aren't critters yet; only the chicken's variants ran on a server. The AuraSkills and Multiverse checks from 0.6.0 weren't rerun. +**Status:** 0.9.0. Quest chapters (tier and page unlocks, placeholders) and 0.8.1's glow changes passed the full bot suite on throwaway Paper 26.2 (215 checks) and 26.3 (113; the menu sections need 26.2) on 2026-11-22, with PlaceholderAPI. No real BetonQuest chapter has run yet. 0.8.0 passed with bots on throwaway Paper 26.1.2 and 26.2 servers (the full suite, 197 checks each) and on 26.3 (95 checks), then the Bunkhouse and coats parts again on all three after a last small change (43 checks on 26.1.2 and 26.2, 26 on 26.3). On 26.3 the bots can't use blocks, so the Bunkhouse menu, picking a coat in it and everything sent out from it didn't run there; the coats themselves ran, with the sidekick getting critters out. Bots can't crouch where the server sees it, so the creeper and fox puzzles were tested with a test-only stand-in for crouching; real crouching is untested. The daily sidekick roll is covered by unit tests only, since it needs 10 hours out. Nothing has been seen in a real game client yet, so how the glow, the particle trail and the chicken variants look is unchecked. Wolves, cats, pigs, cows and frogs aren't critters yet; only the chicken's variants ran on a server. The AuraSkills and Multiverse checks from 0.6.0 weren't rerun. ## What it does diff --git a/test/fetch-jars.mjs b/test/fetch-jars.mjs index fe856cc..f897dd9 100644 --- a/test/fetch-jars.mjs +++ b/test/fetch-jars.mjs @@ -37,6 +37,7 @@ for (const [project, name, pick] of [ ['auraskills', 'AuraSkills.jar', { version: '2.4.0' }], // the version the hook is built against; lists 26.1.2 to 26.3 ['multiverse-core', 'Multiverse-Core.jar', { version: '5.8.2' }], // world groups test ['multiverse-inventories', 'Multiverse-Inventories.jar', { version: '5.3.6' }], + ['placeholderapi', 'PlaceholderAPI.jar', { version: '2.12.3' }], // the version the hook is built against ]) { const versions = await json(`https://api.modrinth.com/v2/project/${project}/version`) const v = pick.version ? versions.find(x => x.version_number === pick.version) diff --git a/test/suite.mjs b/test/suite.mjs index cc90fde..eb8655b 100644 --- a/test/suite.mjs +++ b/test/suite.mjs @@ -29,7 +29,7 @@ const skip = name => { if (want(name)) console.log(`\n# ${name}: skipped on ${MC const Y = -60 const dir = freshServer('suite-' + MC, { paper: jar(`paper-${MC}.jar`), - plugins: [jar('ViaVersion.jar'), jar('ViaBackwards.jar'), jar('GriefPrevention.jar'), ...(AURA ? [jar('AuraSkills.jar')] : []), ...(MV ? [jar('Multiverse-Core.jar'), jar('Multiverse-Inventories.jar')] : [])], props: { difficulty: 'easy' } }) + plugins: [jar('ViaVersion.jar'), jar('ViaBackwards.jar'), jar('GriefPrevention.jar'), jar('PlaceholderAPI.jar'), ...(AURA ? [jar('AuraSkills.jar')] : []), ...(MV ? [jar('Multiverse-Core.jar'), jar('Multiverse-Inventories.jar')] : [])], props: { difficulty: 'easy' } }) const s = new Server({ dir, jvm: ['-Dmobsquad.test.sneak-tag=true'] }) // a tagged player counts as crouching; see Puzzles.crouching const cfgFile = path.join(dir, 'plugins/MobSquad/config.yml') const playersDir = path.join(dir, 'plugins/MobSquad/players') @@ -1195,6 +1195,37 @@ else if (want('worlds')) { await config({ 'recovery-minutes': 0 }) } +// ---------- quests open tiers (0.9.0, K604) ---------- +if (want('quests')) { + section('Quests open tiers') + const papi = async (what) => ((await s.ask(`papi parse Wrangler %mobsquad_${what}%`, 600)).find(l => /^(true|false|\d+)$/.test(l.trim())) || '').trim() + await s.ask('mobsquad xp Wrangler 0', 300) + await config({ ' tier-unlock': 'level' }) + check('the Yard is always open', await papi('tier_yard') === 'true') + check('level mode: Yonder is shut at a low level', await papi('tier_yonder') === 'false') + const out = (await s.ask('mobsquad unlock Wrangler yonder', 600)).join(' ') + check('mobsquad unlock answers, and says level mode ignores it', /has the Yonder tier from a quest/.test(out) && /only Wranglin' level counts/.test(out), out) + check('level mode: a quest alone doesn\'t open Yonder', await papi('tier_yonder') === 'false') + check('the quest is saved in the player\'s file', /^tier yonder$/m.test(file('Wrangler')) || /^tier YONDER$/m.test(file('Wrangler')), file('Wrangler').split('\n').filter(l => l.startsWith('tier')).join(' ')) + await config({ ' tier-unlock': 'either' }) + check('either mode: the quest opens Yonder before its level', await papi('tier_yonder') === 'true') + check('either mode: Backcountry stays shut without its quest or level', await papi('tier_backcountry') === 'false') + await config({ ' tier-unlock': 'quest' }) + await s.ask('mobsquad xp Wrangler 15000', 300) // level 25: Yonder's level + check('quest mode: Yonder opens with its quest', await papi('tier_yonder') === 'true') + check('quest mode: Holler stays shut without its quest, even at level 25', await papi('tier_holler') === 'false') + await s.ask('mobsquad lock Wrangler yonder', 600) + check('mobsquad lock takes it back', await papi('tier_yonder') === 'false') + await config({ ' tier-unlock': 'either' }) + check('either mode: level 25 opens Yonder without a quest', await papi('tier_yonder') === 'true') + check('the level placeholder reads the Wranglin\' level', await papi('level') === '25') + check('an unknown placeholder isn\'t answered', !(await papi('nonsense'))) + const bad = (await s.ask('mobsquad unlock Wrangler yard', 600)).join(' ') + check('the Yard can\'t be unlocked by a quest', /isn't a tier a quest can open/.test(bad), bad) + await config({ ' tier-unlock': 'level' }) + await s.ask('mobsquad xp Wrangler 0', 300) +} + const errors = s.exceptions() check('no MobSquad errors in the log', errors.length === 0, errors.slice(0, 5).join('\n')) await quit(me); await quit(other)