配置
checkStorageConfig
Section titled “checkStorageConfig”- 路径:
world/carpetlmsaddition/checkStorageConfig.json - 用途:被仓储数据 API 与内置网站功能读取。包含端口、是否自动启动网站、是否需要密码、令牌过期天数,以及要处理的仓储列表文件名。
- 若文件不存在,会在世界加载时自动生成。
- 示例:
{ "port": 7000, "autoStartWebsite": false, "customWebsite": false, "noPassword": false, "expireDay": 0, "storageList": ["example.json"]}noPassword: false/api/storage/getData需要Authorization: Bearer <token>。/api/storage/getItem需要Authorization: Bearer <token>。/api/storage/sendGetItemResult需要Authorization: Bearer <token>。
noPassword: true/api/storage/getData可不带 token 访问。/api/storage/getItem可不带 token 访问。/api/storage/sendGetItemResult仍然需要Authorization: Bearer <token>。
- 如果请求里带了 token
/api/storage/getData与/api/storage/getItem会先尝试校验 token。- 当
noPassword: true且 token 校验失败时,这两个 API 会回退为匿名访问。 /api/storage/sendGetItemResult不会回退为匿名访问。
customWebsite: false:使用内置仓储网站。customWebsite: true:从world/carpetlmsaddition/customStorageWebsite/加载文件(模组会自动确保index.html存在)。
checkStorageList
Section titled “checkStorageList”- 路径:
world/carpetlmsaddition/checkStorageList/*.json - 用途:仓储数据 API 读取的坐标列表。具体读取哪些文件由
checkStorageConfig.json中的storageList控制。 - 示例文件:
world/carpetlmsaddition/checkStorageList/example.json - 如果
storageList包含example.json,且该文件不存在,模组会在世界加载时自动生成这个示例文件。 - 示例:
{ "overworld": [[0, 0, 0]], "end": [], "nether": []}