主题
这页给出一套 可直接作为起点改造的示例配置。
目标场景:
main:主仓库,普通投递默认进入这里reward:奖励仓库,只接收奖励来源overflow:兜底仓库- 主仓库需要 VIP 才能使用
- 主仓库需要一次性解锁
- 主仓库第 2 页可以额外扩容
- 奖励仓库有基础
item-admission规则
一、config.yml 示例
yml
debug: false
capture:
manual-enabled: true
reward-enabled: true
auto-collect-enabled: false
manual-default-warehouse: main
reward-default-warehouse: reward
auto-collect-default-warehouse: main
storage:
autosave-interval-seconds: 60
summary-cache-ttl-seconds: 3
project-hotbar: false
allow-vanilla-main-inventory-edit: false
gui:
access-display:
accessible:
label: "可访问"
color: "green"
info-material: "CHEST"
action-material: "CHEST"
placeholder-material: "GRAY_STAINED_GLASS_PANE"
locked-title: "%subject%可访问"
locked-prompt: "当前可正常访问"
action-button-title: "当前可访问"
action-button-hint: "当前仓库可直接访问"
action-badge: "[可直接访问]"
info-action-hint: "当前仓库可直接访问"
visual-hint: "当前状态正常"
purchase-required:
label: "未购买"
color: "aqua"
info-material: "EMERALD"
action-material: "EMERALD_BLOCK"
placeholder-material: "LIME_STAINED_GLASS_PANE"
locked-title: "%subject%未购买"
locked-prompt: "请先完成购买后再继续"
action-button-title: "点击购买"
action-button-hint: "左键尝试购买该仓库"
action-badge: "[一次性购买]"
info-action-hint: "点击中间的购买按钮可尝试购买"
visual-hint: "绿色按钮 = 购买入口"
unlock-required:
label: "未解锁"
color: "gold"
info-material: "TRIPWIRE_HOOK"
action-material: "TRIPWIRE_HOOK"
placeholder-material: "ORANGE_STAINED_GLASS_PANE"
locked-title: "%subject%未解锁"
locked-prompt: "请先完成解锁后再继续"
action-button-title: "点击解锁"
action-button-hint: "左键尝试解锁该仓库"
action-badge: "[一次性解锁]"
info-action-hint: "点击中间的解锁按钮可尝试解锁"
visual-hint: "金色钥匙 = 解锁入口"
restricted:
label: "受限"
color: "red"
info-material: "BARRIER"
action-material: "BARRIER"
placeholder-material: "RED_STAINED_GLASS_PANE"
locked-title: "%subject%受限"
locked-prompt: "当前无法访问该目标"
action-button-title: "无法激活"
action-button-hint: "当前状态无法处理"
action-badge: "[访问受限]"
info-action-hint: "当前仓库处于受限状态,无法直接处理"
visual-hint: "红色屏障 = 当前不可处理"说明:
- 普通投递默认进
main - 奖励投递默认进
reward - 自动收纳当前先关闭
- 自动保存间隔 60 秒
- 离线仓库摘要短缓存为 3 秒,用于减少短时间重复查询离线玩家时的数据库读取
二、main.yml 示例
yml
id: main
access:
bypass-permission: hnwarehouse.access.bypass
visible-when-locked: true
purchase:
enabled: false
use-requirements:
- type: permission
permission: group.vip
unlock:
enabled: true
requirements:
- type: economy
currency: gold
amount: 1000
- type: vanilla-item
material: DIAMOND
amount: 16
# 如需使用 HNCore 共享物品库道具,可再加:
# - type: core-item
# source: bi
# item-id: some_library_item
# amount: 1
pages:
page-1:
capacity: 36
auto-collect: true
priority: 200
allowed-sources:
- manual
- auto-collect
page-2:
capacity: 36
auto-collect: true
priority: 100
allowed-sources:
- manual
- auto-collect
expansion:
enabled: true
requirements:
- type: placeholder
placeholder: "%player_level%"
operator: ">="
value: "40"
as: number
message: "需要等级达到 40 级"这份主仓库配置表达的是:
- 玩家必须拥有
group.vip权限,才能正常使用该仓库 - 仓库本身还需要一次性解锁
- 第 2 页扩容需要等级达到 40
- 普通投递优先进入
page-1,不够再尝试page-2
三、reward.yml 示例
yml
id: reward
item-admission:
whitelist:
- material: DIAMOND
- identity:
item-type: warehouse_token
origin: hnwarehouse
token-id: open_remote
blacklist:
- name-contains: 测试禁用
- pdc:
"hnwarehouse:forbidden": "true"
pages:
page-1:
capacity: 54
auto-collect: false
priority: 100
allowed-sources:
- reward这份奖励仓库配置表达的是:
- 只有
reward来源能进入 - 允许进入的物品要么是钻石,要么命中指定
identity.* - 名称包含“测试禁用”或带有
hnwarehouse:forbidden=true的物品会被直接拦截
四、overflow.yml 示例
yml
id: overflow
pages:
page-1:
capacity: 27
auto-collect: false
priority: 100
allowed-sources:
- manual
- reward
- auto-collect这份兜底仓库配置表达的是:
- 三种来源都允许进入
- 当前不启用自动收纳页特性,只作为通用兜底落点
五、一个更贴近线上服的组合思路
主仓库 main
适合放:
- 玩家常规收纳物品
- 手动投递物品
- 自动收纳来源物品
奖励仓库 reward
适合放:
- 签到奖励
- 活动补偿
- 特殊道具
- 需要和普通仓库隔离的业务物品
兜底仓库 overflow
适合放:
- 暂时不想被主仓库 / 奖励仓库接收的剩余物品
- 路由测试期的保护仓库
六、这个示例最适合用来验证什么
你可以直接用这套配置验证:
/hnwarehouse status/hnwarehouse inspect <玩家> access/hnwarehouse routecheck <玩家> main manual/hnwarehouse routecheck <玩家> reward reward/hnwarehouse unlock <仓库>/hnwarehouse expand <仓库> <页>
这样能同时覆盖:
- use 条件
- unlock 条件
- expansion 条件
- reward 路由
item-admission
七、改这套示例时最容易漏改的地方
改了仓库 ID,但没改默认 capture 路由
如果你把 main 改成 storage-main,记得同时改:
manual-default-warehousereward-default-warehouseauto-collect-default-warehouse
奖励仓库只配了 whitelist,忘了来源限制
如果你想让奖励仓库只接收奖励来源,还要保证:
yml
allowed-sources:
- reward开了 auto-collect,但页面没允许来源
即使:
yml
capture.auto-collect-enabled: true页面也仍然要显式允许:
yml
allowed-sources:
- auto-collect