关于 Placeholder API
它是一个小型的、可 JIJ 的 API,允许在字符串和 Minecraft 文本组件中创建和解析占位符。
Placeholder API 使用简单的格式 %modid:type% 或 %modid:type data%(1.19 之前为 %modid:type/data%)。
它还包含一个简单、通用的文本格式,旨在简化用户在配置/聊天等场景中的输入。
面向用户
它允许用户以相似的方式配置多个模组,而不会失去模组之间的兼容性。
占位符允许更改兼容模组中任何信息的内容和位置。
此外,简化文本格式允许以可读的方式为它们设置样式,而无需手动编写 JSON 或使用
生成器。
通常使用此 API 的模组应直接将其作为依赖包含,但如有需要,你也可以从此处下载更新版本!
面向开发者
使用 Placeholder API 是一种简单的方式,可以实现良好的模组兼容性,而无需实现
多个模组特定的 API。此外,占位符解析系统可用于替换玩家创建或从配置中读取的
文本中的自身静态(或动态占位符)。这结合简化文本格式,可以创造出色的用户/管理员体验。
*[JIJ]: Jar-in-Jar
About Placeholder API
It's a small, JIJ-able API that allows creation and parsing placeholders within strings and Minecraft Text Components.
Placeholder API uses a simple format of %modid:type% or %modid:type data% (%modid:type/data% prior to 1.19).
It also includes simple, general usage text format indented for simplifying user input in configs/chats/etc.
For users
It allows users to configure multiple mods in similar way without losing compatibility between mods.
Placeholders allow changing what and where any information is present within compatible mods.
Additionally, Simplified Text Format allows to style them in readable way without the requirement of writing JSON manually or using
generators.
Mods generally using this api should just include it directly, but you can downloaded updated version from here if needed!
For developers
Usage of Placeholder API is a simple way to achieve good mod compatibility without having to implement
multiple mod specific apis. Additionally, the placeholder parsing system can be used for replacing
own static (or dynamic placeholders) in Text created by player or read from config. This with combination
of Simplified Text Format allows creating great user/admin experience.
*[JIJ]: Jar-in-Jar
评论 0
登录后参与评分
还没有评论,来抢沙发吧