适用于 Paper 1.21 的艾尔岚声望兑换刷新桥接插件。玩家可手动刷新当天的声望兑换商品;插件会根据当天已刷新次数收取阶梯星辉费用,并调用外部轮换脚本更新商店。
- 按
Asia/Shanghai时区记录每名玩家当天的刷新次数。 - 以可配置的阶梯费用限制每日刷新次数,默认依次为免费、10 星辉、20 星辉。
- 通过 PlaceholderAPI 读取货币余额,并以控制台命令扣除或退回货币。
- 异步执行外部轮换脚本:
python3 <rotation-script> shop,最长等待 60 秒。 - 通过文件锁串行化计数、扣费、轮换与状态写入;轮换失败时会尝试自动退款。
- Paper 1.21 与 JDK 21。
- 可执行的 Python 3,以及可接受
shop参数的轮换脚本。 - 若使用默认货币读取配置,需要 PlaceholderAPI 与能提供对应余额占位符的经济插件。
currency-take-command与currency-refund-command必须是服务器控制台可执行的命令。
PlaceholderAPI 是软依赖,但收费刷新需要其正常工作以读取余额。
| 命令 | 说明 | 权限 |
|---|---|---|
/ellanrepshoprefresh [player] |
刷新自己或指定在线玩家当天的声望兑换商品。 | ellan.reputationrefresh.use |
ellan.reputationrefresh.use 默认授予所有玩家。若允许指定其他玩家,建议通过权限插件按服务器治理规则调整权限。
首次启用时插件会释放 plugins/EllanReputationRefresh/config.yml。仓库中的配置为可公开的模板:
rotation-script: plugins/EllanTaskRotation/rotate.py
refresh-state-file: plugins/EllanReputationRefresh/player_shop_refresh.properties
currency-placeholder: "%excellenteconomy_balance_raw_ellan_starlight%"
currency-take-command: "ellan_starlight take %player% %amount% -s -sf"
currency-refund-command: "ellan_starlight give %player% %amount% -s -sf"
refresh-costs: [0, 10, 20]rotation-script:轮换脚本路径;请替换为你的部署路径。refresh-state-file:按 UUID 保存日计数的运行时文件,不应提交到版本库。currency-placeholder:应返回可解析的数值余额。- 扣费和退款命令支持
%player%与%amount%替换。 refresh-costs的长度即每日允许刷新次数;列表第一个值对应第一次刷新。
仅应由受信任的管理员修改脚本路径和控制台命令模板。
需要 JDK 21:
./gradlew build构建产物位于 build/libs/EllanReputationRefresh-0.1.0.jar。仓库不会提交构建产物、运行时计数或服务器路径配置。
本项目以 MIT License 发布。