config.yml
plugins/StarAuction/config.yml 是插件的主设定,第一次启动时自动生成,注释都是中文。
修改后怎么生效
| 设定 | 生效方式 |
|---|---|
database.*、sync.*、mail.retry-seconds | 重启服务器 |
其他全部(包括 menu.cloudui) | /sa reload |
- 没写的键使用默认值:升级后新版本新增的设定不会写进你的文件,直接用默认值;想调整就自己把键加进去。
- 数字会被限制在合理范围:例如
sync.interval-ms最少 250、menu.input-timeout-seconds最少 10、tax-percent在 0 ~ 100 之间。 - 时长写成
30s、10m、12h、3d、1w,可以组合(1d12h)。
数据库(database)
database:
type: sqlite
file: data.db
host: 127.0.0.1
port: 3306
database: starauction
username: root
password: ''
parameters: 'useSSL=false&allowPublicKeyRetrieval=true&characterEncoding=utf8&serverTimezone=UTC'
table-prefix: 'sa_'
pool-size: 8
| 键 | 默认 | 作用 |
|---|---|---|
type | sqlite | sqlite = 单服,数据存在 plugins/StarAuction/data.db;mysql = 多个子服连同一个数据库就能跨服;mariadb = 同 mysql,服务端有 MariaDB 驱动时使用 MariaDB 驱动 |
file | data.db | SQLite 文件名(放在 plugins/StarAuction/ 里) |
host / port | 127.0.0.1 / 3306 | MySQL 地址与端口 |
database | starauction | MySQL 数据库名称(要先建好) |
username / password | root / 空 | MySQL 账号密码 |
parameters | 见上 | 额外的 JDBC 参数 |
table-prefix | sa_ | 表格名称前缀,只能用字母、数字与下划线(最多 32 个字)。同一个数据库里要放好几套互不相通的市集时才需要改 |
pool-size | 8 | MySQL 连接数(最少 2),一般 6 ~ 10 就够 |
表格、连接池与备份见 数据库。
警告
数据库连不上时,插件会在控制台显示原因并停用自己。从 SQLite 换到 MySQL 不会自动搬移旧数据。
跨服(sync)
sync:
enabled: auto
server-id: ''
interval-ms: 1000
full-refresh-seconds: 300
| 键 | 默认 | 作用 |
|---|---|---|
enabled | auto | auto / true / false。跨服同步在连接 MySQL 时就会进行;这个键目前只决定开服时是否显示「跨服已开启(子服 ID:…)」那一行 |
server-id | 空 | 这个子服的名字(例如 lobby、survival),显示在成交记录、/sa log、/sa trades 与 /sa version。每个子服填不同的名字;留空时每次开服自动生成一个(端口 + 随机字符) |
interval-ms | 1000 | 多久读一 次其他子服的变动(毫秒,最少 250)。只查一个有索引的事件表,每秒一次也几乎没有负担 |
full-refresh-seconds | 300 | 每隔几秒完整重新读取一次全部上架中的商品(保险用,最少 30) |
详细说明见 跨服设置。
货币(currencies)
currencies:
default: money
money:
type: vault
name: '金币'
format: '<gold>{amount}</gold> 金币'
decimals: 2
icon: GOLD_INGOT
points:
type: playerpoints
name: '点券'
format: '<aqua>{amount}</aqua> 点券'
icon: EMERALD
diamond:
enabled: false
type: item
name: '钻石'
material: DIAMOND
format: '<aqua>{amount}</aqua> 钻石'
每一段的键(type、name、format、decimals、icon、permission、enabled、material、item)见 货币。
上架(listing)
listing:
sell:
enabled: true
durations: [12h, 24h, 48h, 72h]
default-duration: 48h
allow-partial: true
command-price: total
max-amount: 2304
auction:
enabled: true
durations: [1h, 6h, 12h, 24h]
default-duration: 12h
max-amount: 2304
min-increment-percent: 5
min-increment: 1
anti-snipe:
window: 60s
extend: 60s
allow-cancel-with-bids: false
allow-buyout: true
allow-reserve: true
order:
enabled: true
durations: [1d, 3d, 7d]
default-duration: 3d
max-amount: 2304
refund-fee-on-cancel: false
disabled-worlds: []
block-creative: true
cooldown-ms: 1500
三种类型共通(sell / auction / order):
| 键 | 作用 |
|---|---|
enabled | 是否开放这种交易方式 |
durations | 上架菜单里可以切换的时长;指令可以写任何介于最短与最长之间的时长(超出的会被拉回范围内) |
default-duration | 默认时长(菜单一开始选的、指令没写时长时用的) |
max-amount | 一笔最多几个物品(最少 1;默认 2304 = 36 格 × 64) |
一口价(sell):
| 键 | 默认 | 作用 |
|---|---|---|
allow-partial | true | 新上架的一口价默认允许零买(上架菜单可以逐件切换),见 一口价 · 零买 |
command-price | total | /sa sell 与上架菜单输入的价格:total = 整批的总价;each = 每个的单价 |
拍卖(auction):
| 键 | 默认 | 作用 |
|---|---|---|
min-increment-percent | 5 | 每次至少加价目前出价的百分之几 |
min-increment | 1 | 每次至少加价的固定金额;与上一项取较大者 |
anti-snipe.window | 60s | 结束前多久内有人出价就延长;0s = 关闭防狙击 |
anti-snipe.extend | 60s | 延长到出价后多久 |
allow-cancel-with-bids | false | 已经有人出价时卖家还能不能下架(下架时最高出价退回) |
allow-buyout | true | 能不能设一口价 |
allow-reserve | true | 能不能设保留价 |
其他:
| 键 | 默认 | 作用 |
|---|---|---|
refund-fee-on-cancel | false | 卖家自己下架时退还上架手续费(管理员下架一律退还) |
disabled-worlds | [] | 这些世界不能上架、购买、出价、卖 给收购单(不分大小写) |
block-creative | true | 创造模式不能交易(防刷物品) |
cooldown-ms | 1500 | 两次上架之间的冷却(毫秒) |
权限组(groups)
groups:
default:
priority: 0
permission: ''
max-listings: 10
max-auctions: 3
max-orders: 5
tax-percent: {sell: 5, auction: 5, order: 5}
listing-fee: {flat: 0, percent: 0}
vip:
priority: 10
permission: starauction.group.vip
max-listings: 25
max-auctions: 6
max-orders: 10
tax-percent: {sell: 2, auction: 2, order: 2}
listing-fee: {flat: 0, percent: 0}
每一个键的说明见 权限组与费用。
价格范围(price-range、price-limits)
price-range:
money: {min: 0.01, max: 0}
points: {min: 1, max: 0}
price-limits:
- items: [NETHERITE_INGOT]
currency: money
min: 100
- items: ['*_SHULKER_BOX']
currency: money
min: 10
见 价格与黑名单。
黑名单(blacklist)
blacklist:
materials: [BEDROCK, BARRIER, COMMAND_BLOCK, CHAIN_COMMAND_BLOCK, REPEATING_COMMAND_BLOCK, COMMAND_BLOCK_MINECART,
STRUCTURE_BLOCK, STRUCTURE_VOID, JIGSAW, DEBUG_STICK, LIGHT, KNOWLEDGE_BOOK, SPAWNER, TRIAL_SPAWNER, VAULT]
name-or-lore-contains: ['绑定', '綁定', 'Soulbound', '不可交易']
custom-model-data: []
pdc-keys: []
check-containers: true
block-damaged: false
见 价格与黑名单。