创建 描述模板 authored by SharkGirl kunjang's avatar SharkGirl kunjang
-----
描述模板能够在物品生成时为物品读取配置好的描述模块并解析自定义占位符
![1791954f931f508c7247d11c1c577513_image](uploads/dc6d9672c1d46287ad77c0d3f8a18d4a/1791954f931f508c7247d11c1c577513_image.png)
描述模板
---
描述模板目前不会生成示例文件, 请在配置包文件夹内手动创建 `lore-templates.yml` 文件
该文件的内容示例
```yaml
测试:
Width: 54 #character width length before text wraps
Separator:
- "-"
LineOffsets:
- 1;2
- 3;4
Lines:
- "<placeholder.1234>"
- '<lore.Description{wrap=10}>'
物品可以通过选项来调用模板, 示例:
```yaml
小钻石:
Id: diamond
Display: '这是一颗MM钻石'
Lore:
Template: BASICWEAPON
Description: '测试<&nl>123'
- '123'
```
如你所见, `Description` 可在模板文件内通过 `<lore.Description{wrap=10}>` 读取
**最重要的一点** Description 相当于旧版物品配置的Lore, 其名称改变后必须通过
描述模块占位符
---
<placeholder.*>
Other Information about Lore Templates
Every node under Lore other than Template will be passed to the template as a <lore.*> placeholder (where * is the node you specify.)
Templates can use any other applicable placeholders supported by drop tables.
A line with <lore.stats> will be iterated and replicated for each stat using the tooltip formats configured in stats.yml.
More features for this are planned as well.
Lore Attributes
Attributes are formatted similarly to how skills are. In our previous example, wrap is considered an Attribute.
<lore.node{attribute=value}>
Attribute Aliases Description Default
wrap How many characters are displayed before wrapping text to the next line N/A
\ No newline at end of file