MDX 标签
GuideNH 的 Markdown 支持 MDX 风格的运行时标签——在 Markdown 正文里写
<TagName arg="...">,由 guide/internal/syntax/BuiltinSyntaxContributor.java
在编译期解析成场景图节点。
完整清单 119 个,由
grep -oE '"[A-Z][A-Za-z0-9]*"' src/main/java/com/hfstudio/guidenh/guide/internal/syntax/BuiltinSyntaxContributor.java | sort -u
实测得出(119 是去重后的唯一字符串数,不是「数调用点」的结果)。
该文件共 1562 行,119 个标签名全部在同一文件内声明。
完整清单(119,按字母序)
下面 119 个名字即上述 grep 的原样输出(按 ASCII 字母序排列):
Arg BarChart Block BlockAnnotation BlockAnnotationTemplate
BlockImage BlockStat BlockStats Bold BoxAnnotation
Case Category Channel Color Column
ColumnChart CommandLink Comment ContentTabs CsvTable
Default DiamondAnnotation Else Entity
Explode Expr Facing FileTree Flip
FloatingImage FootnoteList Function FunctionGraph
GameScene GregTechActiveController GregTechPlaceHatches
GtActiveController GtPlaceHatches Highlight
If IfEq IfExist Image ImageAnnotation
ImportPonder ImportStructure ImportStructureLib
IncludeOnly InputAnnotation IsometricCamera
Italic ItemGrid ItemIcon ItemImage ItemLink
KeyBind Latex Len LineAnnotation LineChart
LinePoint LineSeries Link Lower Mermaid
NoInclude NodeContent OnlyInclude Orientation PadLeft
PadRight Param Particle PieChart PieInset
PlaceBlock PlaySound Plot Point Pos
QuestCard QuestLink Quote Recipe RecipeFor
RecipeUsage RecipesFor RecipesUsage RemoveBlocks
RemoveEntity Replace ReplaceBlock Rotation
Row ScatterChart Scene Series Slice
SoundArea SoundLink Special Spoiler Strikethrough
Structure Sub SubPages Switch Tab
Table Template TextAnnotation Tier
Tooltip Trim Underline Upper UrlEncode
Usage Weather
按用途归类
下表是对上面 119 个的重新分组,每个标签名都取自上面的实测清单; 没有出现在清单里的名字一律不写。
| 分类 | 标签 |
|---|---|
| 物品与配方(11) | ItemLink ItemImage ItemIcon ItemGrid Recipe RecipeFor RecipeUsage RecipesFor RecipesUsage Tier Usage |
| 方块与实体(13) | Block BlockImage BlockStat BlockStats Entity Structure PlaceBlock ReplaceBlock RemoveBlocks RemoveEntity Scene GameScene Template |
| 3D 场景控制(11) | IsometricCamera Orientation Facing Rotation Pos NodeContent ImportStructure ImportStructureLib ImportPonder Point LinePoint |
| 标注(8) | BlockAnnotation BlockAnnotationTemplate BoxAnnotation DiamondAnnotation ImageAnnotation InputAnnotation LineAnnotation TextAnnotation |
| 排版(17) | Bold Italic Underline Strikethrough Highlight Color Sub Lower Upper Trim PadLeft PadRight Quote Spoiler Special Len UrlEncode |
| 链接与引用(5) | Link CommandLink QuestCard QuestLink FootnoteList |
| 结构化内容(12) | ContentTabs Tab Table Row Column CsvTable FileTree Category Template OnlyInclude IncludeOnly SubPages |
| 图表(14) | BarChart ColumnChart LineChart LineSeries PieChart PieInset ScatterChart FunctionGraph Plot Series Slice Point Particle |
| 控制流 / 逻辑(11) | If IfEq IfExist Switch Case Else Function Expr Replace Weather Explode |
| 媒体与声音(8) | Image FloatingImage Latex Mermaid PlaySound SoundArea SoundLink Flip |
| 杂项(9) | Arg Param Default Channel Comment NoInclude KeyBind Tooltip |
「方块与实体」与「结构化内容」都列了 Template(按用途跨两类),
故各分类之和大于 119。
GregTech 专用标签(4)
GregTechActiveController GregTechPlaceHatches
GtActiveController GtPlaceHatches
这 4 个是 GT 机器预览的快捷标签,与 GregTech 的 hatch 元素构建器配合,
由 模组兼容 里的 gregtech 集成提供。
与 mod 集成的接线点
部分标签的行为不是硬编码的,而是走
com/hfstudio/guidenh/integration/api/GuideNhIntegrationRegistry.java 的可插拔 provider。
该注册中心共 28 个 register* 方法(不止下表这 5 个),
下表是与方块显示直接相关的部分:
| 标签 / 能力 | 注册方法(GuideNhIntegrationRegistry) |
|---|---|
<Block> / <BlockImage> 的方块显示 |
registerBlockDisplayProvider(BlockDisplayProvider) |
| 方块显示名 | registerBlockDisplayNameProvider(BlockDisplayNameProvider) |
<BlockStats> |
registerBlockStatsProvider(BlockStatsProvider) |
| 导出用方块 ID | registerBlockExportIdProvider(BlockExportIdProvider) |
| 物品堆栈归一化(如 GT 的 oreDict 统一) | registerItemStackNormalizationProvider(ItemStackNormalizationProvider) |
⚠️ 这些方法名与 GameRegistry.registerBlock 无关——
grep -rn 'registerBlock' 在 GuideNH 的 18 处命中里,16 处是上表这些
integration API 方法名,另 2 处是
BuiltinSyntaxContributor.registerBlockLayoutAttributes(同文件 :975,991)
这个私有语法辅助方法(详见分类页的「猜测裁定」)。