Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 0.8.1

- **Pigs, cows, chickens and frogs also glow in their coat.** They have only three looks each, so a look repeats for three or four coats; now they also glow in the coat's color and leave its trail, so every coat looks different. Wolves and cats keep the variant only. The list is `glow-too` in `coats.yml`. A copy of `coats.yml` already in `plugins/MobSquad` without that line gets the built-in list. A name that isn't a variant critter is skipped with a warning.
- **No-glow worlds.** A glow outline shows through walls, so in a kids' world it could lead others to where a kid is building. Worlds listed under `spirit-coats.no-glow-worlds` in `config.yml` show coats without the outline: critters keep their variant and their coat's trail, and particles don't show through blocks. The outline goes off as soon as the owner enters such a world, the trail there is sent only within 32 blocks, and a no-glow world that isn't also a coat world (a likely typo) is warned about in the log. Empty by default.
- Tested: unit tests (46). The bot suite's coat checks were updated for the chicken's glow and no-glow worlds but haven't been rerun yet; that run comes before any live install. Not seen in a real game client.

## 0.8.0

Spirit coats.
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.8.0. Spirit coats. 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.8.1. Spirit coats; in 0.8.1 pigs, cows, chickens and frogs also glow and worlds can be set to no glow, checked by unit tests only so far. 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

Expand All @@ -20,7 +20,7 @@ Coax mobs into critters for Paper: they follow you, fight only hostile mobs, and
- Skeleton: covering fire from 15 blocks, reaching further and shooting faster at each milestone. From level 25 it shares two arrows every 2 minutes while you carry a bow or crossbow.
- Iron golem: takes a quarter of any hostile mob's hit on you within 8 blocks, and throws the mobs it hits back.
- **La Ménagerie.** Your journal, with a page for each critter: its Critterbook number, a line about it, how to coax it and its special. A page opens the first time you're within 10 blocks of that critter and can see it, or when you get one. `/mobsquad journal` or the book in the Bunkhouse menu opens it. Critterbook numbers follow the order each mob first appeared in Minecraft Java Edition, so the creeper is No. 1 and the allay No. 75. Every mob in the game has a number already, and the numbers never change.
- **Spirit coats.** A critter earns a new coat every 10 levels, ten in all, and keeps them. Coats show only in the worlds listed under `spirit-coats.worlds` in `config.yml`, which is empty to start with, so critters look normal everywhere until an admin lists a world. Wolves, cats, pigs, cows, chickens and frogs wear a real variant; every other critter glows in the coat's color and leaves a light particle trail, only for players who haven't turned particles to minimal. Right-click a critter in the Bunkhouse to pick the coat it wears from the ones it has earned; the default is the newest. The names, colors, particles and variants are in `plugins/MobSquad/coats.yml`. The journal lists each critter's coats, with the locked ones as the level that earns them.
- **Spirit coats.** A critter earns a new coat every 10 levels, ten in all, and keeps them. Coats show only in the worlds listed under `spirit-coats.worlds` in `config.yml`, which is empty to start with, so critters look normal everywhere until an admin lists a world. Wolves, cats, pigs, cows, chickens and frogs wear a real variant. Every other critter glows in the coat's color and leaves a light particle trail, and so do pigs, cows, chickens and frogs, whose three looks repeat across coats (`glow-too` in `coats.yml`). The trail shows only for players who haven't turned particles to minimal. Worlds under `spirit-coats.no-glow-worlds` show coats without the glow outline, which shows through walls; list kids' worlds there. Right-click a critter in the Bunkhouse to pick the coat it wears from the ones it has earned; the default is the newest. The names, colors, particles and variants are in `plugins/MobSquad/coats.yml`. The journal lists each critter's coats, with the locked ones as the level that earns them.
- **The sidekick.** A critter that has spent 10 hours out with you has a 1 in 10 chance each day of becoming your sidekick. It goes everywhere with you: it comes out when you join, after a world change and after a rest, and the Bunkhouse menu, its bell and the dinnerbell leave it be. It doesn't count toward your posse. One per player.
- **Vittles.** Right-click them to perk up a tuckered-out critter on the spot. Craft two from bread, a carrot and sweet berries.
- **Bunkhouses.** An admin marks a vault block as a Bunkhouse. Anyone who right-clicks it sees only their own critters. Click one to send it out or call it back. Critters never exist as items, so they can't be dropped, traded or duplicated.
Expand All @@ -36,7 +36,7 @@ Coax mobs into critters for Paper: they follow you, fight only hostile mobs, and

Paper 26.1 or newer, Java 25. Drop `MobSquad-<version>.jar` into `plugins` and restart. To build it yourself: `./gradlew build`, and the jar is in `build/libs`.

Settings are in `plugins/MobSquad/config.yml`: worlds where MobSquad is off, the rest time after tuckering out, the Wranglin' experience for a coax, and `spirit-coats.worlds`, the worlds where spirit coats show. `coats.yml` beside it holds each coat's name, glow color, particle and variants; a line you get wrong is skipped with a warning and the built-in one stays.
Settings are in `plugins/MobSquad/config.yml`: worlds where MobSquad is off, the rest time after tuckering out, the Wranglin' experience for a coax, `spirit-coats.worlds`, the worlds where spirit coats show, and `spirit-coats.no-glow-worlds`, the ones among them where coats show without the glow outline. `coats.yml` beside it holds each coat's name, glow color, particle and variants; a line you get wrong is skipped with a warning and the built-in one stays.

## Commands

Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
}

group = "com.extantape"
version = "0.8.0"
version = "0.8.1"

java {
toolchain.languageVersion.set(JavaLanguageVersion.of(25))
Expand Down
7 changes: 6 additions & 1 deletion docs/decisions.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,16 @@ Dated decisions for this repo, newest last.
- **Spirit coats (0.8.0), from the owner's brief ("Levels and spirit coats").** A coat every 10 levels, coat 1 at level 10 to coat 10 at level 100, shown only in worlds listed under `spirit-coats.worlds` (empty by default). Written by the lead for the owner's say, so they stand unless he changes them:
- The ten names and glow colors: Ember (red), Marigold (gold), Sunbeam (yellow), Meadow (green), Pine (dark green), Lagoon (aqua), Frost (blue), Twilight (dark purple), Blossom (light purple), Starlight (white). Names are plain and always shown with the color. Dark colors are written in a lighter color in text, so every coat name reads on the dark menu.
- The trail particles (flame, wax_on, glow, happy_villager, composter, bubble_pop, snowflake, witch, cherry_leaves, end_rod) are about 4 a second per critter.
- Pigs, cows, chickens and frogs have three variants, so each look lasts for 3 or 4 coats in a row; wolves have nine (coat 10 repeats the pale wolf) and cats eleven. Variant critters get no glow or trail, as the brief says.
- Pigs, cows, chickens and frogs have three variants, so each look lasts for 3 or 4 coats in a row; wolves have nine (coat 10 repeats the pale wolf) and cats eleven. Variant critters got no glow or trail in 0.8.0, as the brief said; see the 2026-11-22 picks below for pigs, cows, chickens and frogs.
- A pick is stored with the critter as a ninth field; 0 means "the newest earned", so older files and critters that never picked keep following new coats. A pick the critter hasn't earned (an admin lowered its level) shows the newest earned instead.
- Choosing is a right-click on the critter in the Bunkhouse. Left-click still sends it out.
- Glow uses scoreboard teams named `ms_coat_1` to `ms_coat_10` on the main scoreboard, removed on start and stop.
- `/mobsquad level` can lower a critter's level, which hides coats it no longer has the level for. Normal play never lowers a level.
- **Spirit coat picks (owner, Simon chat, 2026-11-22), relayed by the chief of staff:**
- Coat names: "Keep them (Recommended)". The ten names and colors above stand.
- Pigs, cows, chickens and frogs: "Add glow and trail (Recommended)". They wear their variant and also glow in the coat's color with its trail, so each coat looks different even where the three looks repeat. Wolves and cats keep the variant only. It's the `glow-too` list in `coats.yml` (0.8.1), so an admin can change it.
- Magic worlds: "We have two magic worlds…? One adult and one kid one." On Sonoran those are `magic` and `ninos_magic` (both exist there; checked 2026-11-22). Listing them in `spirit-coats.worlds` is a live change and waits for the owner's go.
- **No-glow worlds (lead, 2026-11-22, kids first).** The trust-and-safety review found the glow outline shows through walls to everyone tracking the critter in that world, and a coated critter is always near its owner, so in `ninos_magic` it could point to a kid's hidden base. 0.8.1 adds `spirit-coats.no-glow-worlds` (empty by default): coats there keep their variant and trail but get no outline. The outline goes off when the owner enters, before the critter follows; the trail there is sent only within 32 blocks; a no-glow entry that isn't a coat world is warned about at start, since the setting fails open on a typo. The live go request proposes `ninos_magic` there; the owner decides.

## 2026-11-15

Expand Down
2 changes: 2 additions & 0 deletions docs/test-audit.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ Kept by this repo's owning session, per `~/Code/CLAUDE.md`, "Test self-audits".
| Leaving or unlisting a world takes the look off at once; entering applies it | bot: unlist and relist, and the nether hop |
| Real variants for chickens (and the other five, in the data file) | bot (chicken, 26.1.2, 26.2, 26.3); unit data tests for the rest |
| Glow and trail for the others; cheap; none beyond view distance or on minimal | bot: team and glow, packet counts, a far bot, minimal particles |
| Pigs, cows, chickens and frogs also glow (glow-too, 0.8.1); wolves and cats don't; the list can be changed and bad entries are skipped | unit `theBundledCoatsLoadCleanlyAndReadWell`, `glowTooCanBeChangedAndBadEntriesAreSkipped`; bot: the chicken's glow and team (written 2026-11-22, not yet run) |
| No-glow worlds drop only the outline, keeping the coat and trail (kids' safety) | unit `noGlowWorldsTurnOnlyTheOutlineOff`, `theBundledConfigListsNoWorlds`; bot: no-glow on and off with the bee and chicken (written 2026-11-22, not yet run) |
| Bad lines in coats.yml are skipped with a warning, never a crash | unit `badEntriesAreSkippedWithAWarningAndTheRestLoad`, `aFileThatIsNotYamlLeavesTheBuiltInCoats`, `theBundledCoatsLoadCleanlyAndReadWell` |
| Journal shows earned coats by name and locked ones as "Level 30" | unit `CoatJournalTest` |
| Names and menu text readable, never color alone | unit `theBundledCoatsLoadCleanlyAndReadWell` (readable colors, distinct names); every coat line carries its name |
Expand Down
20 changes: 17 additions & 3 deletions src/main/java/com/extantape/mobsquad/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,17 @@
import org.bukkit.configuration.file.FileConfiguration;

/** The settings in config.yml, read once and checked. */
public record Settings(Set<String> disabledWorlds, int recoveryMinutes, int coaxXp, Set<String> coatWorlds) {
public record Settings(Set<String> disabledWorlds, int recoveryMinutes, int coaxXp, Set<String> coatWorlds, Set<String> noGlowWorlds) {
public static Settings read(FileConfiguration c, Logger log) {
return new Settings(new HashSet<>(c.getStringList("disabled-worlds")),
Settings s = new Settings(new HashSet<>(c.getStringList("disabled-worlds")),
clamp(c.getInt("recovery-minutes", 5), 0, 1440, "recovery-minutes", log),
clamp(c.getInt("coax-xp", 100), 0, 100000, "coax-xp", log),
new HashSet<>(c.getStringList("spirit-coats.worlds")));
new HashSet<>(c.getStringList("spirit-coats.worlds")),
new HashSet<>(c.getStringList("spirit-coats.no-glow-worlds")));
for (String w : s.noGlowWorlds)
if (!s.coatWorlds.contains(w))
log.warning("spirit-coats.no-glow-worlds lists \"" + w + "\", which isn't under spirit-coats.worlds. Check the spelling: a world that's misspelled there gets the glow.");
return s;
}

public boolean enabledIn(String world) {
Expand All @@ -23,6 +28,15 @@ public boolean coatsIn(String world) {
return coatWorlds.contains(world);
}

/**
* Whether coats may glow in this world. A glow outline shows through walls, so it can lead others to where a
* critter's owner is; worlds under spirit-coats.no-glow-worlds (such as a kids' world) show the coat's look and
* trail without it.
*/
public boolean glowIn(String world) {
return !noGlowWorlds.contains(world);
}

static int clamp(int v, int min, int max, String key, Logger log) {
if (v >= min && v <= max) return v;
int to = Math.max(min, Math.min(max, v));
Expand Down
37 changes: 31 additions & 6 deletions src/main/java/com/extantape/mobsquad/model/CoatData.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.extantape.mobsquad.model;

import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
Expand All @@ -13,8 +15,10 @@
/**
* What each spirit coat looks like, read from {@code coats.yml} (bundled in the jar, overridable from the plugin
* folder). Each of the ten coats has a plain name, a glow color and a particle; the six critters with real variants
* (wolf, cat, pig, cow, chicken, frog) also name the variant each coat wears. A bad entry is skipped with a warning and
* the rest still load, so a typo in the data file never stops the plugin.
* (wolf, cat, pig, cow, chicken, frog) also name the variant each coat wears, and {@code glow-too} lists the variant
* critters that also get the glow and trail (the owner's pick, 2026-11-22: pigs, cows, chickens and frogs, whose three
* looks repeat across coats). A bad entry is skipped with a warning and the rest still load, so a typo in the data file
* never stops the plugin.
*/
public final class CoatData {
/** The critters that have real data-driven variants. */
Expand All @@ -30,14 +34,16 @@ public interface Validator {
boolean variant(String species, String key);
}

public static final CoatData EMPTY = new CoatData(Map.of(), Map.of());
public static final CoatData EMPTY = new CoatData(Map.of(), Map.of(), Set.of());

private final Map<Integer, Coat> coats;
private final Map<String, Map<Integer, String>> variants;
private final Set<String> glowToo;

private CoatData(Map<Integer, Coat> coats, Map<String, Map<Integer, String>> variants) {
private CoatData(Map<Integer, Coat> coats, Map<String, Map<Integer, String>> variants, Set<String> glowToo) {
this.coats = coats;
this.variants = variants;
this.glowToo = glowToo;
}

/** The coat's data; a plain "Coat 3" with no particle when the file has nothing usable for it. */
Expand All @@ -56,11 +62,16 @@ public String variant(String species, int coat) {
return m == null ? null : m.get(coat);
}

/** Whether a species has any variant set, so it wears variants instead of a glow. */
/** Whether a species has any variant set, so it wears a variant in each coat. */
public boolean hasVariants(String species) {
return variants.containsKey(species);
}

/** Whether a species glows and leaves a trail in its coats: every critter without variants, plus those in glow-too. */
public boolean glows(String species) {
return !hasVariants(species) || glowToo.contains(species);
}

/**
* Reads {@code yaml} over {@code base}: each good entry replaces the base's, each bad one is skipped with a warning.
* A file that isn't YAML at all is skipped whole, leaving the base.
Expand Down Expand Up @@ -92,6 +103,20 @@ public static CoatData parse(String yaml, Validator v, Logger log, CoatData base
}
coats.put(i, new Coat(i, name.strip(), color, particle));
}
Set<String> glowToo = base.glowToo;
if (y.contains("glow-too")) {
if (!y.isList("glow-too")) {
log.warning("coats.yml: glow-too should be a list of critters, such as [pig, cow]. Skipped.");
} else {
Set<String> g = new HashSet<>();
for (String species : y.getStringList("glow-too")) {
String sp = species.strip().toLowerCase(Locale.ROOT);
if (!VARIANT_SPECIES.contains(sp)) { log.warning("coats.yml: glow-too names \"" + species + "\", which isn't a critter with variants (it glows anyway). Skipped."); continue; }
g.add(sp);
}
glowToo = Set.copyOf(g);
}
}
ConfigurationSection vs = y.getConfigurationSection("variants");
if (vs != null) for (String species : vs.getKeys(false)) {
if (!VARIANT_SPECIES.contains(species)) { log.warning("coats.yml: \"" + species + "\" has no variants to set. Skipped."); continue; }
Expand All @@ -107,7 +132,7 @@ public static CoatData parse(String yaml, Validator v, Logger log, CoatData base
}
Map<String, Map<Integer, String>> frozen = new HashMap<>();
variants.forEach((k, m) -> frozen.put(k, Map.copyOf(m)));
return new CoatData(Map.copyOf(coats), Map.copyOf(frozen));
return new CoatData(Map.copyOf(coats), Map.copyOf(frozen), glowToo);
}

private static Integer index(String k) {
Expand Down
Loading
Loading