Fix the tree feature harness and the scene probes

The tree fixture world now applies vanilla's edge shape updates for its
obstacles (faceless vines, unsupported short grass), the vanilla fixture
world answers environment attributes with defaults, and features that
need structure templates or the pale moss registry, directly or through
named features, are left to the decoration harnesses. The scene probes
build their scene with World::test_scene since TestWorld was removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Ludovic Marie
2026-10-09 00:28:31 +02:00
parent ebb1180bd5
commit 2a7f199b5f
6 changed files with 99 additions and 4 deletions
+10 -1
View File
@@ -2,6 +2,7 @@
"""Compare vanilla tree, fallen-tree and ore features block-for-block with vanilla."""
import argparse
import json
import re
import os
from pathlib import Path
import platform
@@ -42,10 +43,18 @@ def corpus(facts,resources):
seeds=[0,1,-1,0x5DEECE66D,0x123456789abcdef,-8070450532247928832]
origins=[[8,65,8],[15,65,0],[0,65,15],[-1,65,-17],[31,65,-16],[100003,65,-4097]]
trees,ores,others=[],[],[]
def needs_level(text,seen=frozenset()):
# Pale moss needs the level's feature registry and server level; templates need structure
# resources. Both are excluded directly or through named features.
if 'pale_moss' in text or '"minecraft:template"' in text:return True
for ref in set(re.findall(r'"(minecraft:[a-z0-9_/]+)"',text))-seen:
for table in ('features','placed'):
if ref in resources.get(table,{}) and needs_level(resources[table][ref],seen|{ref}):return True
return False
for name,text in resources['features'].items():
value=json.loads(text);kind=value['type'].removeprefix('minecraft:')
if needs_level(text):continue
if kind in ('tree','fallen_tree'):
if 'pale_moss' in text:continue # needs the level's feature registry and server level
trees.append(name)
elif kind in ('ore','scattered_ore'):ores.append(name)
elif kind not in ('freeze_top_layer','template','fossil'):others.append(name) # templates need structure resources