功能
- 一个可点击的金库菜单,显示玩家可以使用的所有金库。
- 持久化金库:在金库关闭、计时器触发、玩家离开以及服务器关闭时保存内容。
- 每个金库在菜单中均显示自定义名称和图标。
- 独立的排序界面,支持按名称、类型和数量进行排序。
- 跨玩家所有金库搜索物品,搜索结果可点击。
- 使用经济系统购买锁定金库,无需安装 Vault 插件。
- 管理员工具用于备份、清空、只读查看和重新加载配置。
- 每条消息、菜单标题和图标均可在配置文件中更改。
- 金库访问权限可按金库编号单独授予,也可一次性全部授予。
金库工作原理
- 玩家的金库编号从 1 到
max_vaults。
- 通过权限按金库编号授予访问权,或通过 "all vaults"(所有金库)权限一次性授予,或通过购买金库获得访问权。
- 运行
/pv 打开金库菜单。菜单为每个金库显示一个图标、其中持有的物品数量、自定义名称和自定义图标。
- 在菜单中,左键单击金库以打开它,右键单击它以打开其排序界面。
- 锁定的金库以灰色显示。当有可用的经济系统时,可以点击它们来购买,购买后保持解锁状态。
- 打开、排序或清空金库时,金库内容会自动滑入到位,并且所有内容在重启之间安全存储。
命令
| 命令 |
作用 |
/pv |
打开金库菜单。 |
/pv menu |
打开金库菜单。 |
/pv <number> |
按编号打开你的某个金库。 |
/pv list |
列出你可以访问的金库。 |
/pv search <item> |
在所有金库中搜索物品。结果可点击并打开相应的金库。 |
/pv sort <vault> |
打开金库的排序界面。 |
/pv clear <vault> |
清空你的某个金库。 |
/pv buy <vault> |
在有可用经济系统时购买锁定的金库。 |
/pv name <vault> <name> |
重命名金库。使用 clear 作为名称以移除自定义名称。 |
/pv icon <vault> <item> |
设置金库的菜单图标。 |
/pv admin <player> <vault> |
打开其他玩家的金库以便编辑。 |
/pv inspect <player> <vault> |
以只读模式打开其他玩家的金库。 |
/pv backup <player> |
为玩家的金库数据创建带日期的备份副本。 |
/pv wipe <player> [vault] |
清空玩家的一个或所有金库。始终先进行备份。 |
/pv reload |
在不重启服务器的情况下重新加载配置。 |
每个命令都支持 Tab 补全,包括子命令、金库编号、玩家名称和物品名称。
权限
| 权限 |
默认值 |
允许的操作 |
playervaults.use |
所有人 |
使用 /pv 命令和金库菜单。 |
playervaults.vaults.<number> |
仅限金库 1 |
访问特定编号的金库。 |
playervaults.vaults.all |
操作员 |
访问所有金库。 |
playervaults.admin |
操作员 |
打开和编辑任何玩家的金库,以及使用管理员命令。 |
playervaults.clear |
操作员 |
清空金库。 |
playervaults.list |
所有人 |
列出可用金库。 |
playervaults.search |
所有人 |
在金库中搜索物品。 |
playervaults.sort |
所有人 |
对金库进行排序。 |
playervaults.rename |
所有人 |
重命名金库。 |
playervaults.icon |
所有人 |
更改金库的菜单图标。 |
playervaults.economy |
所有人 |
购买锁定的金库。 |
playervaults.inspect |
操作员 |
只读查看其他玩家的金库。 |
playervaults.backup |
操作员 |
创建金库备份。 |
playervaults.wipe |
操作员 |
清除金库数据。 |
playervaults.reload |
操作员 |
重新加载配置。 |
默认情况下提供编号 1 到 10 的金库权限。如果 max_vaults 高于 10,
请给予这些玩家 "all vaults"(所有金库)权限,或添加匹配的金库权限。
经济系统
安装 Vault 插件和经济插件后,可以出售金库。
- 当有可用的经济系统时,菜单中的锁定金库会显示价格,可以通过点击或
/pv buy <vault> 购买。
- 编号为
n 的金库价格为 base_price + price_increase * (n - 1)。
- 已购买的金库对该玩家保持解锁状态,并在重启之间被记住。
- 如果缺少 Vault 或经济插件,插件正常运行。尝试购买金库的玩家会被告知需要 Vault,且锁定金库显示为锁定而非可购买。
配置
所有选项都位于插件的 config.yml 中。颜色代码使用 &,例如 &a 代表绿色。
可用的占位符包括 %prefix%、%player%、%vault%、%name%、%count%、%amount%、
%item%、%price%、%page%、%pages%、%file%、%icon% 和 %max%。
常规
| 选项 |
默认值 |
修改后的效果 |
max_vaults |
10 |
玩家拥有的最高金库编号。金库编号从 1 到此值。 |
vault_size |
54 |
金库中的存储槽数量。必须是 9 的倍数,介于 9 到 54 之间。仅适用于更改后创建的金库;现有金库保留其大小,因此不会丢失物品。 |
save_interval |
300 |
自动保存更改后的金库的频率(秒)。设置为 0 以关闭自动保存;金库在关闭和服务器关闭时仍会保存。 |
preload_offline_vaults |
false |
为 true 时,在启动时加载离线玩家的金库信息。 |
vault_title |
&a%player%'s Vault #%vault% |
金库顶部显示的标题。 |
sound_on_open |
UI_BUTTON_CLICK |
打开金库时播放的声音。接受声音名称或命名空间声音,如 minecraft:ui.button.click。留空则无声音。 |
菜单
| 选项 |
默认值 |
修改效果 |
menu.title |
&8Your Vaults |
金库菜单的标题。 |
menu.vault_icon |
CHEST |
玩家可打开的金库所使用的图标。拥有自定义图标的金库将使用该自定义图标代替。 |
menu.locked_icon |
BARRIER |
玩家既无法打开也无法购买的金库所使用的图标。 |
menu.buy_icon |
GOLD_INGOT |
玩家可以购买的金库所使用的图标。 |
menu.fill_empty_slots |
true |
设为 true 时,未使用的菜单槽位将由填充物物品填满。 |
menu.filler |
GRAY_STAINED_GLASS_PANE |
用于填满未使用菜单槽位的物品。 |
排序与界面
| 选项 |
默认值 |
修改效果 |
sort.title |
&8Sort Vault #%vault% |
排序界面的标题。 |
sort.sound |
UI_BUTTON_CLICK |
对金库进行排序时播放的声音。留空则不播放声音。 |
buy.title |
&8Purchase Vault #%vault% |
购买确认界面的标题。 |
inspect.title |
&8Viewing %player% #%vault% |
/pv inspect 命令使用的只读界面的标题。 |
经济系统
| 选项 |
默认值 |
修改效果 |
economy.enabled |
true |
设为 false 可禁用购买金库功能,即使已安装经济插件也是如此。 |
economy.base_price |
1000.0 |
1号金库的价格。更高级别的金库价格更高。 |
economy.price_increase |
1000.0 |
每高于1号的金库层级所增加的价格。使用默认值时,2号金库价格为 2000。 |
消息
玩家看到的每条消息都可以在 messages 部分进行修改。
| 选项 |
默认值 |
显示时机 |
prefix |
&8[&aVaults&8] &r |
添加在所有下方列出的消息之前。 |
player-only |
&cThis command can only be used by players. |
从控制台执行需要玩家身份的命令时。 |
no-permission |
&cYou don't have permission to do that. |
在没有所需权限的情况下执行命令时。 |
player-not-found |
&cPlayer not found. |
当管理员命令指定了一个未知玩家时。 |
invalid-number |
&cPlease enter a valid vault number. |
当提供的金库编号不是数字时。 |
vault-range |
&cVault number must be between 1 and %max%. |
当金库编号超出允许范围时。 |
vault-locked |
&cYou don't have access to that vault. |
当玩家尝试打开他们无权访问的金库时。 |
cleared |
&aVault #%vault% has been cleared. |
清空金库后。 |
sorted |
&aVault #%vault% has been sorted. |
对金库进行排序后。 |
usage |
&cUsage: /pv [...] |
当命令缺少参数时。 |
list-header |
&aYour available vaults: |
在 /pv list 结果上方。 |
list-entry |
&7- Vault #%vault% %name% |
/pv list 中每个金库对应的一行。 |
search-header |
&aFound items: |
在 /pv search 结果上方。 |
search-entry |
&aVault #%vault% &7- %item% x%amount% |
每个匹配项对应的一个可点击行。 |
search-hover |
&7Click to open vault #%vault% |
鼠标悬停在搜索结果上时显示。 |
search-none |
&cNo items found matching that name. |
当搜索未找到任何内容时。 |
search-hint |
&7Click a result to open that vault. |
在 /pv search 结果下方。 |
menu-page |
&ePage %page%/%pages% |
菜单中的页码指示器。 |
menu-prev |
&aPrevious Page |
菜单中的上一页按钮。 |
menu-next |
&aNext Page |
菜单中的下一页按钮。 |
vault-item-name |
&aVault #%vault% |
金库图标在菜单中的名称(当其没有自定义名称时)。 |
vault-item-lore |
item count and click hints |
金库图标在菜单中的悬停文本。 |
locked-item-name |
&cVault #%vault% &7(Locked) |
锁定金库图标的名称。 |
locked-item-lore |
price and purchase hint |
可购买金库的悬停文本。 |
locked-no-economy-lore |
access hint |
不可购买金库的悬停文本。 |
sort-name |
&aSort by Name |
按名称排序按钮。 |
sort-type |
&aSort by Type |
按类型排序按钮。 |
sort-quantity |
&aSort by Quantity |
按数量排序按钮。 |
sort-close |
&cClose |
排序界面上的关闭按钮。 |
buy-confirm |
&aConfirm Purchase |
购买界面上的确认按钮。 |
buy-confirm-lore |
price line |
确认按钮的悬停文本。 |
buy-cancel |
&cCancel |
购买界面上的取消按钮。 |
buy-success |
&aYou unlocked vault #%vault%! |
购买金库后。 |
buy-failed |
&cYou cannot afford that. |
当购买失败时。 |
buy-already |
&eYou already have access to vault #%vault%. |
当尝试购买已拥有的金库时。 |
buy-no-economy |
&cThis feature requires the Vault plugin... |
在未安装 Vault 的情况下使用经济命令时。 |
name-set |
&aVault #%vault% renamed to &f%name%&a. |
重命名金库后。 |
icon-set |
&aVault #%vault% icon set to &f%icon%&a. |
更改金库图标后。 |
icon-invalid |
&cInvalid item name: %icon% |
当提供未知的物品名称作为图标时。 |
reloaded |
&aConfiguration reloaded. |
执行 /pv reload 后。 |
backup-done |
&aBackup created: &f%file% |
创建备份后。 |
backup-none |
&cNo vault data was found for that player. |
当没有数据可备份时。 |
wipe-done |
&aVault data wiped for &f%player%&a. |
清除金库数据后。 |
安装
- 将插件文件放入服务器的
plugins 文件夹中。
- 启动服务器一次以生成配置文件。
- (可选)安装 Vault 和经济插件以启用购买金库功能。
- 根据需要调整
config.yml 并运行 /pv reload 以使更改生效。
Features
- A clickable vault menu that shows every vault a player can use.
- Persistent vaults: contents are saved when a vault is closed, on a timer, when a player leaves, and on shutdown.
- Per-vault custom names and icons shown in the menu.
- A separate sorting screen with sorting by name, by type and by quantity.
- Item search across a player's vaults with clickable results.
- Buying locked vaults with an economy, without requiring Vault to be installed.
- Administrator tools for backups, wiping, read-only viewing and reloading.
- Every message, menu title and icon can be changed in the configuration.
- Vault access can be handed out per vault number, or all at once.
How vaults work
- A player's vaults are numbered from 1 up to
max_vaults.
- Access is granted per vault number with a permission, or all at once with the "all vaults" permission, or by buying the vault.
- Running
/pv opens the vault menu. The menu shows one icon per vault, how many items it holds, its custom name and its custom icon.
- In the menu, left-click a vault to open it and right-click it to open its sorting screen.
- Locked vaults are shown greyed out. When an economy is available they can be clicked to buy them, and they stay unlocked after purchase.
- Vault contents slide into place automatically when a vault is opened, sorted or cleared, and everything is stored safely between restarts.
Commands
| Command |
What it does |
/pv |
Opens the vault menu. |
/pv menu |
Opens the vault menu. |
/pv <number> |
Opens one of your vaults by number. |
/pv list |
Lists the vaults you can access. |
/pv search <item> |
Searches all your vaults for an item. The results are clickable and open the matching vault. |
/pv sort <vault> |
Opens the sorting screen for a vault. |
/pv clear <vault> |
Empties one of your vaults. |
/pv buy <vault> |
Buys a locked vault when an economy is available. |
/pv name <vault> <name> |
Renames a vault. Use clear as the name to remove a custom name. |
/pv icon <vault> <item> |
Sets the menu icon for a vault. |
/pv admin <player> <vault> |
Opens another player's vault so it can be edited. |
/pv inspect <player> <vault> |
Opens another player's vault as a read-only view. |
/pv backup <player> |
Creates a dated backup copy of a player's vault data. |
/pv wipe <player> [vault] |
Clears one or all of a player's vaults. A backup is always taken first. |
/pv reload |
Reloads the configuration without restarting the server. |
Tab completion is available for every command, sub-command, vault number, player name and item name.
Permissions
| Permission |
Default |
What it allows |
playervaults.use |
Everyone |
Using the /pv command and the vault menu. |
playervaults.vaults.<number> |
Vault 1 only |
Access to one vault number. |
playervaults.vaults.all |
Operators |
Access to every vault. |
playervaults.admin |
Operators |
Opening and editing any player's vault, and the administrator commands. |
playervaults.clear |
Operators |
Clearing a vault. |
playervaults.list |
Everyone |
Listing available vaults. |
playervaults.search |
Everyone |
Searching vaults for items. |
playervaults.sort |
Everyone |
Sorting a vault. |
playervaults.rename |
Everyone |
Renaming a vault. |
playervaults.icon |
Everyone |
Changing a vault's menu icon. |
playervaults.economy |
Everyone |
Buying locked vaults. |
playervaults.inspect |
Operators |
Viewing another player's vault read-only. |
playervaults.backup |
Operators |
Creating vault backups. |
playervaults.wipe |
Operators |
Wiping vault data. |
playervaults.reload |
Operators |
Reloading the configuration. |
Vault permissions are provided for numbers 1 to 10 by default. If max_vaults is higher than 10,
give those players the "all vaults" permission, or add matching vault permissions.
Economy
Vaults can be sold once the Vault plugin and an economy plugin are installed.
- When an economy is available, locked vaults in the menu show their price and can be bought with a click, or with
/pv buy <vault>.
- The price of vault number
n is base_price + price_increase * (n - 1).
- Bought vaults stay unlocked for that player and are remembered between restarts.
- If Vault or an economy plugin is missing, the plugin runs normally. Players who try to buy a vault are simply told that Vault is required, and locked vaults show as locked instead of purchasable.
Configuration
Every option lives in the plugin's config.yml. Colour codes use &, for example &a is green.
Available placeholders are %prefix%, %player%, %vault%, %name%, %count%, %amount%,
%item%, %price%, %page%, %pages%, %file%, %icon% and %max%.
General
| Option |
Default |
What changing it does |
max_vaults |
10 |
The highest vault number a player can have. Vaults are numbered from 1 up to this value. |
vault_size |
54 |
The number of storage slots in a vault. Must be a multiple of 9, between 9 and 54. Applies to vaults created after the change; existing vaults keep their size so no items are lost. |
save_interval |
300 |
How often, in seconds, changed vaults are saved automatically. Set to 0 to turn automatic saving off; vaults are still saved when closed and on shutdown. |
preload_offline_vaults |
false |
When true, vault information for offline players is loaded at startup. |
vault_title |
&a%player%'s Vault #%vault% |
The title shown at the top of a vault. |
sound_on_open |
UI_BUTTON_CLICK |
The sound played when a vault is opened. Accepts a sound name or a namespaced sound such as minecraft:ui.button.click. Leave blank for no sound. |
Menu
| Option |
Default |
What changing it does |
menu.title |
&8Your Vaults |
The title of the vault menu. |
menu.vault_icon |
CHEST |
The icon used for a vault the player can open. Vaults with a custom icon use that instead. |
menu.locked_icon |
BARRIER |
The icon used for a vault the player cannot open and cannot buy. |
menu.buy_icon |
GOLD_INGOT |
The icon used for a vault the player can buy. |
menu.fill_empty_slots |
true |
When true, unused menu slots are filled with the filler item. |
menu.filler |
GRAY_STAINED_GLASS_PANE |
The item used to fill unused menu slots. |
Sorting and screens
| Option |
Default |
What changing it does |
sort.title |
&8Sort Vault #%vault% |
The title of the sorting screen. |
sort.sound |
UI_BUTTON_CLICK |
The sound played when a vault is sorted. Leave blank for no sound. |
buy.title |
&8Purchase Vault #%vault% |
The title of the purchase confirmation screen. |
inspect.title |
&8Viewing %player% #%vault% |
The title of the read-only screen used by /pv inspect. |
Economy
| Option |
Default |
What changing it does |
economy.enabled |
true |
Set to false to disable buying vaults even when an economy is available. |
economy.base_price |
1000.0 |
The cost of vault number 1. Higher vaults cost more. |
economy.price_increase |
1000.0 |
Added to the price for each vault number above 1. With the defaults, vault 2 costs 2000. |
Messages
Every message players see can be changed in the messages section.
| Option |
Default |
When it is shown |
prefix |
&8[&aVaults&8] &r |
Added in front of every message below. |
player-only |
&cThis command can only be used by players. |
When a command that needs a player is run from the console. |
no-permission |
&cYou don't have permission to do that. |
When a command is run without the needed permission. |
player-not-found |
&cPlayer not found. |
When an administrator command names an unknown player. |
invalid-number |
&cPlease enter a valid vault number. |
When a non-number is given as a vault number. |
vault-range |
&cVault number must be between 1 and %max%. |
When a vault number is outside the allowed range. |
vault-locked |
&cYou don't have access to that vault. |
When a player tries to open a vault they cannot access. |
cleared |
&aVault #%vault% has been cleared. |
After clearing a vault. |
sorted |
&aVault #%vault% has been sorted. |
After sorting a vault. |
usage |
&cUsage: /pv [...] |
When a command is missing arguments. |
list-header |
&aYour available vaults: |
Above the /pv list results. |
list-entry |
&7- Vault #%vault% %name% |
One line per vault in /pv list. |
search-header |
&aFound items: |
Above the /pv search results. |
search-entry |
&aVault #%vault% &7- %item% x%amount% |
One clickable line per matching item. |
search-hover |
&7Click to open vault #%vault% |
Shown when hovering a search result. |
search-none |
&cNo items found matching that name. |
When a search finds nothing. |
search-hint |
&7Click a result to open that vault. |
Below the /pv search results. |
menu-page |
&ePage %page%/%pages% |
The page indicator in the menu. |
menu-prev |
&aPrevious Page |
The previous-page button in the menu. |
menu-next |
&aNext Page |
The next-page button in the menu. |
vault-item-name |
&aVault #%vault% |
The name of a vault icon in the menu when it has no custom name. |
vault-item-lore |
item count and click hints |
The hover text of a vault icon in the menu. |
locked-item-name |
&cVault #%vault% &7(Locked) |
The name of a locked vault icon. |
locked-item-lore |
price and purchase hint |
The hover text of a vault that can be bought. |
locked-no-economy-lore |
access hint |
The hover text of a vault that cannot be bought. |
sort-name |
&aSort by Name |
The sort-by-name button. |
sort-type |
&aSort by Type |
The sort-by-type button. |
sort-quantity |
&aSort by Quantity |
The sort-by-quantity button. |
sort-close |
&cClose |
The close button on the sorting screen. |
buy-confirm |
&aConfirm Purchase |
The confirm button on the purchase screen. |
buy-confirm-lore |
price line |
The hover text of the confirm button. |
buy-cancel |
&cCancel |
The cancel button on the purchase screen. |
buy-success |
&aYou unlocked vault #%vault%! |
After buying a vault. |
buy-failed |
&cYou cannot afford that. |
When a purchase fails. |
buy-already |
&eYou already have access to vault #%vault%. |
When buying a vault you already have. |
buy-no-economy |
&cThis feature requires the Vault plugin... |
When an economy command is used without Vault. |
name-set |
&aVault #%vault% renamed to &f%name%&a. |
After renaming a vault. |
icon-set |
&aVault #%vault% icon set to &f%icon%&a. |
After changing a vault icon. |
icon-invalid |
&cInvalid item name: %icon% |
When an unknown item name is given as an icon. |
reloaded |
&aConfiguration reloaded. |
After /pv reload. |
backup-done |
&aBackup created: &f%file% |
After creating a backup. |
backup-none |
&cNo vault data was found for that player. |
When there is nothing to back up. |
wipe-done |
&aVault data wiped for &f%player%&a. |
After wiping vaults. |
Installation
- Place the plugin file in the server's plugins folder.
- Start the server once to create the configuration.
- Optionally install Vault and an economy plugin to enable buying vaults.
- Adjust
config.yml to taste and run /pv reload to apply the changes.
评论 0
登录后参与评分
还没有评论,来抢沙发吧