Skip to content

feat(tiling): exempt Epic 13 item textures by vanilla stem (#175) - #233

Merged
BharathASL merged 1 commit into
mainfrom
feat/tiling-rules-matrix
Sep 23, 2026
Merged

BharathASL merged 1 commit into
mainfrom
feat/tiling-rules-matrix

Conversation

@BharathASL

@BharathASL BharathASL commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Description

Registers the Epic 13 item textures as tiling-exempt ahead of their masters, so the blocking seam audit does not treat handheld icons as toroidal terrain when #175–#177 land. Every id is a vanilla 1.21 texture stem, checked against the textures/item/ listing of the 1.21.6 client jar: the six tool materials (wooden, stone, iron, golden, diamond, netherite) × sword, pickaxe, axe, shovel, hoe; bow and bow_pulling_0..2; crossbow_standby, crossbow_pulling_0..2, crossbow_arrow, crossbow_firework; trident, mace; golden_carrot, baked_potato, bread, apple, cooked_porkchop. The shield has no item texture, so its entity textures shield_base and shield_base_nopattern are listed instead.

categorizeTexture in tools/test-tiling.mjs now rebuilds the name it matches as <stem>.svg, so a .png, upper-case or extensionless id resolves exactly as its .svg master does (previously grass_block_side.png fell through to toroidal). A resolveTilingCategory helper is exported for callers that need only the category name. The built-in fallback rules are kept in step with tools/tiling-rules.json, including the existing grass.svg alias.

No glob patterns are added. Each pattern lands with the first master it matches, and the unreachable-pattern guard from #199 stays without an allowlist. Logs are not narrowed to Y only: the shipped textures/block/oak_log.svg keeps its X+Y audit, which #88 depends on, and a test pins it. Negative fixtures stop a broad *_stem.svg rule from catching pumpkin_stem, melon_stem, attached_pumpkin_stem, attached_melon_stem and mushroom_stem.

Refs #175, Refs #176, Refs #177, Refs #88

Affected Assets

  • tools/tiling-rules.json: itemIds extended with the Epic 13 texture stems
  • tools/test-tiling.mjs: stem-based name resolution, resolveTilingCategory export, fallback rules synced
  • tools/test/tiling-rules.test.mjs: new sections [12]–[15] covering extension and case variants, oak_log both-axis coverage, stem negative fixtures, Epic 13 item stems and exact-stem matching

Type of Change

  • feat: New vector texture master, blockstate, or compiler capability
  • fix: Tiling fix, palette correction, or bugfix
  • docs: Documentation improvement
  • chore / refactor: Maintenance, dependencies, or codebase cleanup

Contributor Checklist

Please check all applicable boxes before requesting review:

Vector Texture Standards (if adding/modifying SVGs)

  • Authored as a clean $512\times512$ SVG (viewBox="0 0 512 512"). Not applicable: no SVG changed.
  • Primary shapes are aligned to the $32\text{px}$ texel grid ($16\times16$ grid). Not applicable: no SVG changed.
  • Seamless Toroidal Tiling: Checked and verified that elements wrapping across $X$ and $Y$ edges align perfectly without seams or chopped shapes. npm test seam audit: 24 passed, 0 failed, 6 exempt; block/oak_log.svg passes on X+Y.
  • Ore Consistency: If adding an ore texture, the stone background geometry and corner radius (rx) match textures/block/stone.svg exactly. Not applicable: no ore texture.
  • Free of leftover AI generation comments, unnecessary editor namespaces, or embedded raster images. Not applicable: no SVG changed.

Build & Verification

  • Ran npm run build locally and verified that the pack compiles successfully.
  • Verified textures in-game or inspected the rasterized PNG outputs in dist/. Not applicable: no texture output changes.

Git Hygiene & Standards

  • Commit message(s) follow Conventional Commits (e.g., feat(textures): ...).
  • Every commit is signed off with the Developer Certificate of Origin (git commit -s).
  • Branch is rebased cleanly onto latest main with no merge commits.
  • Formatting complies with .editorconfig (2-space indent, LF endings, trailing newline).

@ninja6-agent ninja6-agent Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blockers

  • tools/tiling-rules.json:L53: *_log.svg → y-only moves the shipped textures/block/oak_log.svg from an X+Y audit to Y only. On main it is audited on both axes and passes, and #88 requires oak_log's toroidal tiling to be verified. Logs placed side by side show the X seam, so this change removes coverage from the blocking audit and gets nothing back. Drop the rule, or keep logs toroidal and use y-only only for textures that really cannot tile on X.
  • tools/tiling-rules.json:L58: *_stem.svg → y-only also matches the vanilla pumpkin_stem, melon_stem, attached_pumpkin_stem and attached_melon_stem (crop cutouts, which should be exempt) and mushroom_stem (a full cube, which should be toroidal). Narrow the rule to crimson_stem.svg, warped_stem.svg and stripped_*_stem.svg, and add these names as negative fixtures in tools/test/tiling-rules.test.mjs.
  • tools/tiling-rules.json:L68, L73: vanilla has no basalt or polished_basalt texture. The textures are basalt_side and basalt_top, and polished_basalt_side and polished_basalt_top. As things stand, basalt_side.svg resolves to x-only through *_side.svg, the opposite axis to the one this rule is for. Target the _side names with a rule that comes before *_side.svg, or remove both rules.
  • tools/tiling-rules.json:L83, L103, L118: flower_*.svg, *_spores.svg and *_wall_fan.svg match no vanilla block texture (only flower_pot, which is a model and not a cross-quad; wall fans reuse the *_coral_fan texture). The fixtures that "validate" them are made-up names: tools/test/tiling-rules.test.mjs:L397 flower_tulip, L409 spore_blossom_spores, L410 crimson_spores, and L377 golden_rail (vanilla uses powered_rail). Remove any pattern that has no real texture target, and use real texture names in the fixtures.
  • tools/test/tiling-rules.test.mjs:L328: the PREPOPULATED_PATTERNS allowlist exempts 14 patterns from the unreachable-pattern guard. That guard exists to catch dead rules (#199), and the allowlist is how the dead patterns above get through CI. Remove the allowlist. Add a pattern in the same PR as the first master it matches, the way grass.svg already does.
  • tools/tiling-rules.json:L130-L148: the Epic 13 itemIds do not match what #175–#177 ship. steak is not a texture id (it is cooked_beef, already listed). porkchop is the raw item, but #177 ships cooked_porkchop. crossbow has no texture: the vanilla ids are crossbow_standby, crossbow_pulling_0..2, crossbow_arrow and crossbow_firework. bow_pulling_0..2 are missing. Also missing: the stone, golden and netherite tool variants, all shovels and hoes, golden_carrot and baked_potato. As written, these masters would fall through to toroidal and fail the blocking audit when they land. Use the real texture stems, or exempt item textures structurally instead of by enumerating them.
  • tools/test-tiling.mjs:L125: nameWithExt appends .svg to base, so oak_log.png becomes oak_log.png.svg and resolves to toroidal, while oak_log resolves to y-only. The endsWith(".svg") check is also case-sensitive, but the stem regex is not. Use const nameWithExt = stem + ".svg";. After that, matchGlob(stem, ...) at L164 is dead code, because every pattern ends in .svg, so remove it.
  • PR body: it does not use .github/pull_request_template.md (checklist missing) and links no issue. CONTRIBUTING.md §4 requires the checklist. Restore the template and reference the tasks this work serves (#88, #175–#177).

Nits

  • tools/test-tiling.mjs:L44-L72: the built-in fallback rules duplicate tiling-rules.json. Update them together with the JSON fixes above so the two do not diverge.
  • tools/test/tiling-rules.test.mjs:L456: the comment says "Shovels", but the list has none.
  • tools/test/tiling-rules.test.mjs:L494: apple_log is not a real texture. Assert the substring-safety case with a real name.
  • tools/tiling-rules.json:L93: mangrove_roots is a full transparent cube, not a cross-quad cutout (unlike hanging_roots and crimson_roots). Check whether it should be exempt.
  • Commit 6ee3b9b: body lines run past 72 columns and the body repeats the PR description (CONTRIBUTING.md §3.5, N6-COMMIT-05).

Resolve .png, upper-case and bare ids through their .svg name.

Signed-off-by: Bharath <bharathasl74185@gmail.com>
@BharathASL
BharathASL force-pushed the feat/tiling-rules-matrix branch from 6ee3b9b to 41c12e0 Compare September 23, 2026 19:15
@BharathASL BharathASL changed the title feat(tiling): expand tiling pattern rules and item exclusions feat(tiling): exempt Epic 13 item textures by vanilla stem (#175) Sep 23, 2026

@ninja6-agent ninja6-agent Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nits

  • tools/test-tiling.mjs:L186: the new exported resolveTilingCategory has the same name as tools/lib/pbr-generator.mjs:L145 but gives different results. The pbr copy still builds base + ".svg", so grass_block_side.png and grass_block_side.SVG resolve to toroidal there and to x-only here, and grass_block_side_overlay.png resolves to toroidal there and to exempt here. Only tests call the new helper. Have the pbr version delegate to categorizeTexture, or drop the new export, so there is one resolver.
  • tools/test/tiling-rules.test.mjs:L441: enchanted_golden_apple is not a vanilla texture (its item model uses item/golden_apple), which contradicts the "Real vanilla item textures" comment at L437. Drop the entry.
  • tools/test/tiling-rules.test.mjs:L447: this line requires the real item textures bowl, carrot, potato and porkchop to be toroidal. When any of them is later added to itemIds, the test will fail even though the substring rule still holds. Run the exact-stem check against a local rules fixture (for example { ...rules, itemIds: ["bow", "golden_carrot", "baked_potato", "cooked_porkchop"] }) and not against the shipped list.
  • tools/test-tiling.mjs:L117, tools/test/tiling-rules.test.mjs:L338: "upper-case id" overstates what the code does. Only the extension is case-folded, so GRASS_BLOCK_SIDE.png still resolves to toroidal. Change the wording to "upper-case extension".

@BharathASL
BharathASL added this pull request to the merge queue Sep 23, 2026
Merged via the queue into main with commit fe27b0e Sep 23, 2026
5 checks passed
@BharathASL
BharathASL deleted the feat/tiling-rules-matrix branch September 23, 2026 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant