Prickle is a JSON based config format. This mod allows other mods to use Prickle for their config files! For technical documentation please see the GitHub page.
FaQ
Why is this called Prickle?
Prickle is the collective noun for a group of hedgehogs. Hedgehogs are one of my favourite animals and I think they are a fitting metaphor for config files. For example, they both may seem intimidating at first but can be nice once you get to know and understand them.
Why not use an existing format?
In the past I used standard JSON for my config files but there were several issues such as the lack of comments and default values. Prickle adds these features to JSON while remaining 100% backwards compatible. I have tried several other formats like TOML but I was disappointed with a lot of their Java implementations. They often lack features I found important, has serious bugs, and were no longer being maintained. Minecraft also uses JSON for datapacks and commands, making it a familiar choice for most players.
Format Specifications
In Prickle property values are wrapped in a JSON object. This allows metadata and other properties to be attributed to that property. The actual value that the user edits is held by the value property.
For example in standard JSON a file would look like this.
{ "database_host": "192.168.1.222" }The same JSON as a Prickle file would look like this.
{ "database_host": { "value": "192.168.1.222" } }Comments
The // key is reserved for comments. Comments are only used to provide additional context to the reader and should never influence how the file is parsed. Comments can be a JSON string or an array of JSON strings for multiline comments.
{ "database_host": { "//": "The IP address of the database to connect to.", "value": "192.168.1.0" } "database_host_backup": { "//": [ "A backup IP address to connect to. This is only", "used if the default host can not be reached " ], "value": "192.168.1.0" } }Decorators
Decorators are named comments that convey a specific attribute of the property to the reader. A common example of a decorator is //default which declares the default value for the reader. Like comments, decorators never influence how the file is parsed, they are purely descriptive.
You may encounter some of the following decorators in prickle files.
- //default - The default value of the property.
- //reference - A resource that can be used to learn more, like a wiki/docs page.
- //range - The acceptable range for a numeric value.
- //regex - A regex pattern that the value must match.
- //empty-allowed - If the value can be empty or not.
This project is sponsored by Nodecraft. Use code DARKHAX for 30% off your first month of service!
本站是资源分享站,资源均来自于互联网和用户自发分享,仅供学习和交流使用。如有版权问题,请联系管理员删除。
操作
创作者
待认领资源
成为此资源的创作者
其他链接
最近更新资源
通天之路
热度 307 | 3 天前更新
匠途闲境 - Create Craft & Quiet
热度 203 | 3 天前更新
VERITY.exe
热度 363 | 6 天前更新
咒术回战(咒术战斗)
热度 68950 | 6 天前更新
暮色森林精选 - The Best of Twilight Forest
热度 25601 | 6 天前更新
无限计划 0.1 - Project Infinity 0.1
热度 9743 | 6 天前更新
黑暗RPG - DarkRPG - Forge
热度 9585 | 6 天前更新
[TLWS]末世生辉 The Last World Shines
热度 9399 | 6 天前更新
简易小屋
热度 622 | 1 周前更新
灾厄巫咒
热度 660 | 2 周前更新
阿卡迪亚的天启
热度 2872 | 2 周前更新
寄生仙途
热度 801 | 2 周前更新
评论区 (0)
登录 后才能发表评论
快来发表第一条评论吧!