Keep the readable renderings out of the world directories

A generated <world>/ is meant to drop straight into a save, and Scribe's smoke
harness copies a data set's contents into a server's world wholesale -- so
anything beside customnpcs/ would be copied in too. The NBTJsonUtil renderings
move to _readable/<world>/ at the output root, which makes each world directory
usable as a cnpc_data_sets overlay with no filtering step.
This commit is contained in:
KAMKEEL committed 2026-08-14 00:21:31 -04:00
1 parent 3fc15091fa
commit b37f57966d
2 files changed
+13 -8

No files matched your search

@@ -30,15 +30,17 @@ public final class Readme {
sb.append("## Layout\n\n");
sb.append("```\n");
for (FixtureWorld world : worlds) {
sb.append(world.name()).append("/\n");
sb.append(" customnpcs/ <- exactly a CustomNPC+ world directory, and nothing else\n");
sb.append(" _readable/ <- NBTJsonUtil renderings of the .dat files, for humans\n");
sb.append(world.name()).append("/customnpcs/ <- a CustomNPC+ world directory, and nothing else\n");
}
sb.append("manifest.json <- which file holds which case, and why\n");
sb.append("_readable/<world>/ <- NBTJsonUtil renderings of the .dat files, for humans\n");
sb.append("manifest.json <- which file holds which case, and why\n");
sb.append("```\n\n");
sb.append("`customnpcs/` can be dropped straight into a save directory. `_readable/` is a\n");
sb.append("debugging aid: it is CustomNPC+'s own JSON rendering, which suffixes scalars\n");
sb.append("with their type (`5b`, `5L`, `1.0f`) and so is deliberately not strict JSON.\n\n");
sb.append("Each `<world>/` holds `customnpcs/` and nothing else, so it drops straight into\n");
sb.append("a save directory -- or, in Scribe, works as-is as a `cnpc_data_sets` overlay.\n");
sb.append("The readable renderings sit outside the world directories for that reason.\n\n");
sb.append("`_readable/` is a debugging aid, not a fixture: it is CustomNPC+'s own JSON\n");
sb.append("rendering, which suffixes scalars with their type (`5b`, `5L`, `1.0f`) and is\n");
sb.append("therefore deliberately not strict JSON. The widths being visible is the point.\n\n");
sb.append("## The worlds\n\n");
for (FixtureWorld world : worlds) {
@@ -47,7 +47,10 @@ public final class WorldWriter {
this.world = world;
this.root = new File(outputRoot, world);
this.customnpcs = new File(root, "customnpcs");
this.readable = new File(root, "_readable");
// Outside the world directory, not inside it. A generated <world>/ is meant to be usable
// as a drop-in overlay -- Scribe's smoke harness copies a set's contents straight into a
// server's world -- so it must contain customnpcs/ and nothing else.
this.readable = new File(new File(outputRoot, "_readable"), world);
this.manifest = manifest;
mkdirs(customnpcs);
mkdirs(readable);