AuctionzOptymalized
适用于 Paper 服务器的玩家间拍卖行。玩家通过图形界面(GUI)上架物品,其他玩家则浏览、搜索并使用服务器货币购买。专为繁忙市场下的流畅体验而构建:玩家看到的每个视图均已缓存,仅在市场实际发生变化时才会重新生成。
- 版本: 1.0 BETA
- 服务器: Paper 26.x (
api-version: 26.1.2)
- 依赖: 需要 Vault 经济插件(如 EssentialsX、CMI 等)——若无此类插件,该插件将无法启动
- 作者: M4rtwy
功能
- 拍卖 GUI - 分页市场视图,左键购买,右键取消你自己的上架。
- 出售菜单 - 将物品放入其中,使用 +/- 按钮设置价格并确认。或者直接使用
/ah sell <price> 命令从手中上架。
- 搜索 - 在聊天栏输入
/ah diamond sword,或使用菜单中的告示牌按钮打开一个打字面板,无需离开 GUI 即可填写内容。支持匹配物品名称、可选地匹配描述文本(lore)、附魔以及卖家名称。
- 分类标签页 - 顶部一行包括:全部 / 建筑方块 / 物品 / PvP 装备 / 工具 / 食物 / 红石。标签页在配置文件中定义,因此你可以添加自定义分类。
- 过期与结算 - 上架在设定时间后过期,并移至
/ah expired,卖家可在此收取物品。出售所得资金也以相同方式发放。
- 税收、价格限制、上架数量限制、物品黑名单 - 均在配置文件中设置。
- 语言支持 -
lang/en.yml、pl.yml、de.yml。放入你自己的 lang/xx.yml 文件即可在语言选择器中显示。缺失的键值将回退到英文。
- 样式 -
styles/default.yml、donutsmp.yml、minimal.yml 定义了所有图标、槽位和布局。你在 styles/ 目录中添加的自定义文件也会出现在选择器中。
文本与外观被有意分离:lang/ 存放文字,styles/ 存放图标和槽位,样式则通过 <lang:some.key> 令牌引入文字。更改语言不会破坏布局,更改样式也不会丢失翻译。
命令
| 命令 |
作用 |
权限 |
/ah |
打开拍卖行 |
auctionzoptymalized.use |
/ah <文本> |
搜索市场,例如 /ah diamond sword |
auctionzoptymalized.search |
/ah search |
打开输入界面 |
auctionzoptymalized.search |
/ah sell |
打开出售菜单 |
auctionzoptymalized.sell |
| /ah sell <价格> | 立即上架你手中的物品 | auctionzoptymalized.sell |
| /ah expired | 收集已过期的商品列表和收益 | auctionzoptymalized.use |
| /ah help | 显示帮助信息 | - |
别名:/auction、/rynek。
管理员命令,全部位于 /ap 下(别名 /auctionzoptymalized、/auctionzoptimalized):
| 命令 |
作用 |
/ap reload |
重新加载配置、语言和样式 |
/ap version |
显示插件版本 |
/ap gui [menu] |
打开当前样式中的任何菜单 |
/ap style [name] |
样式选择器 / 切换外观 |
/ap lang [code] |
语言选择器 / 切换语言 |
/ap auction save |
立即写入 listings.yml |
/ap auction clear |
将所有拍卖物品返还给卖家 |
权限
| 节点 |
默认值 |
授予 |
auctionzoptymalized.use |
所有人 |
打开拍卖行 |
auctionzoptymalized.sell |
所有人 |
上架物品出售 |
auctionzoptymalized.search |
所有人 |
搜索市场 |
auctionzoptymalized.limit.bypass |
op |
忽略上架数量限制 |
auctionzoptymalized.admin |
op |
使用 /ap 命令以及上述所有权限 |
文件
plugins/AuctionzOptymalized/
config.yml 行为设置:持续时间、税费、限制、黑名单、分类、搜索
listings.yml 市场数据 - 服务器运行时请勿编辑
lang/ en.yml, pl.yml, de.yml - 所有消息和菜单中的所有文字
styles/ default.yml, donutsmp.yml, minimal.yml - 图标、槽位、布局
配置亮点
auction:
listing-duration: "48h" # s(秒)/ m(分)/ h(时)/ d(天)
max-listings-per-player: 5 # 0 = 无限制
min-price: 1.0
max-price: 10000000.0
tax-percent: 5.0 # 从卖家的收益中扣除
allow-buying-own: false
broadcast-new-listings: false
blacklist: [BEDROCK, BARRIER, COMMAND_BLOCK, STRUCTURE_BLOCK]
search:
enabled: true
max-length: 48
match-lore: true # 同时搜索描述文本和附魔
match-seller: true # /ah Notch 可以找到他们的上架物品
分类以规则形式编写,而非材料列表:
pvp:
match: ["*_SWORD", "*_AXE", "*_HELMET", "BOW", "SHIELD", "TRIDENT", "*POTION"]
match 和 exclude 可以接受精确的材料名称、带有一个 * 的通配符或标签:
#block、#item、#edible、#record、#fuel、#solid。空的 match 表示“全部”——即 all 选项卡。添加一个选项卡意味着在此处添加条目,在 styles/ 中设置图标和槽位,并在 lang/ 下的 gui.categories.<id> 中设置名称。
如何保持高性能
- 列表仅排序一次并缓存;拍卖管理器上的版本计数器在每次更改时递增,每个派生缓存均检查该计数器而非重新构建。
- 搜索范围(名称、描述、卖家)在每次创建商品时生成一次并重复使用。
- 分类规则在插件启动时解析为材质集合,因此筛选整个市场时仅需对每件商品进行一次集合查找,且此操作在任何文本匹配之前进行。
- 搜索结果按玩家缓存,因此翻页时无需再次扫描。
- Tab 补全、分类计数和排序视图均基于同一计数器。
AuctionzOptymalized
A player-to-player auction house for Paper servers. Players list items from a GUI,
everyone else browses, searches and buys them with server money. Built to stay fast
on a busy market: every view the players see is cached and only rebuilt when the
market actually changes.
- Version: 1.0 BETA
- Server: Paper 26.x (
api-version: 26.1.2)
- Requires: a Vault economy (EssentialsX, CMI, ...) - the plugin will not start without one
- Author: M4rtwy
Features
- Auction GUI - paged market view, left click buys, right click cancels your own listing.
- Sell menu - drop an item in, set the price with +/- buttons, confirm. Or list straight
from your hand with
/ah sell <price>.
- Search -
/ah diamond sword from chat, or the sign button in the menu, which opens a
typing board you fill in without leaving the GUI. Matches item names, and optionally lore,
enchantments and the seller's name.
- Category tabs - Everything / Building blocks / Items / PvP gear / Tools / Food / Redstone
along the top row. Tabs are defined in the config, so you can add your own.
- Expiry and payouts - listings run out after a set time and go to
/ah expired, where the
seller collects them. Sale money is paid out the same way.
- Tax, price limits, listing limits, item blacklist - all in the config.
- Languages -
lang/en.yml, pl.yml, de.yml. Drop in your own lang/xx.yml and it shows
up in the picker. Missing keys fall back to English.
- Styles -
styles/default.yml, donutsmp.yml, minimal.yml hold every icon, slot and
layout. Your own file in styles/ shows up in the picker too.
Texts and looks are kept apart on purpose: lang/ has the words, styles/ has the icons and
slots, and styles pull words in with <lang:some.key> tokens. Changing the language never
breaks a layout, and changing the style never loses a translation.
Commands
| Command |
What it does |
Permission |
/ah |
Opens the auction house |
auctionzoptymalized.use |
/ah <text> |
Searches the market, e.g. /ah diamond sword |
auctionzoptymalized.search |
/ah search |
Opens the typing board |
auctionzoptymalized.search |
/ah sell |
Opens the sell menu |
auctionzoptymalized.sell |
/ah sell <price> |
Lists the item in your hand right away |
auctionzoptymalized.sell |
/ah expired |
Collects your expired listings and payouts |
auctionzoptymalized.use |
/ah help |
Shows the help |
- |
Aliases: /auction, /rynek.
Admin, all under /ap (aliases /auctionzoptymalized, /auctionzoptimalized):
| Command |
What it does |
/ap reload |
Reloads config, languages and styles |
/ap version |
Shows the plugin version |
/ap gui [menu] |
Opens any menu from the active style |
/ap style [name] |
Style picker / switches the look |
/ap lang [code] |
Language picker / switches the language |
/ap auction save |
Writes listings.yml right now |
/ap auction clear |
Returns every listing to its seller |
Permissions
| Node |
Default |
Grants |
auctionzoptymalized.use |
everyone |
Opening the auction house |
auctionzoptymalized.sell |
everyone |
Listing items for sale |
auctionzoptymalized.search |
everyone |
Searching the market |
auctionzoptymalized.limit.bypass |
op |
Ignores the listing limit |
auctionzoptymalized.admin |
op |
The /ap commands, and all of the above |
Files
plugins/AuctionzOptymalized/
config.yml behaviour: duration, tax, limits, blacklist, categories, search
listings.yml the market data - do not edit while the server runs
lang/ en.yml, pl.yml, de.yml - every message and every word in the menus
styles/ default.yml, donutsmp.yml, minimal.yml - icons, slots, layout
Config highlights
auction:
listing-duration: "48h" # s / m / h / d
max-listings-per-player: 5 # 0 = unlimited
min-price: 1.0
max-price: 10000000.0
tax-percent: 5.0 # taken from the seller's payout
allow-buying-own: false
broadcast-new-listings: false
blacklist: [BEDROCK, BARRIER, COMMAND_BLOCK, STRUCTURE_BLOCK]
search:
enabled: true
max-length: 48
match-lore: true # also search lore and enchantments
match-seller: true # /ah Notch finds their listings
Categories are written as rules, not as material lists:
pvp:
match: ["*_SWORD", "*_AXE", "*_HELMET", "BOW", "SHIELD", "TRIDENT", "*POTION"]
match and exclude take an exact material, a wildcard with one *, or a tag:
#block, #item, #edible, #record, #fuel, #solid. An empty match means
"everything" - that is the all tab. Adding a tab means an entry here, an icon and a
slot in styles/, and a name in lang/ under gui.categories.<id>.
How it stays fast
- The listing list is sorted once and cached; a version counter on the auction manager is
bumped on every change, and every derived cache checks that counter instead of rebuilding.
- Search haystacks (name, lore, seller) are built once per listing and reused.
- Category rules are resolved into material sets when the plugin starts, so filtering a full
market is one set lookup per listing, done before any text matching.
- Search results are cached per player, so paging through them is not a second scan.
- Tab completion, category counts and the sorted view all sit on the same counter.
评论 0
登录后参与评分
还没有评论,来抢沙发吧