此 Fabric 模组仅应在服务器上安装。它将检测玩家死亡并缓存其物品栏一段时间。在此期间,服务器管理员可以轻松地将物品恢复给该玩家。
该插件完全通过命令 API 进行交互。所有操作均为 recov 命令的子命令。
命令列表如下:
/recov list [<player>]
/recov list [<onlyOnlinePlayers>] [<filter>]
/recov clear [<player>]
/recov restore <player> [<deathNumber>] [<sourcePlayer>]
/recov printDeathInventory <player> [<deathNumber>]
/recov setTicksUntilExpired <ticksUntilExpired>
/recov setTickUpdatePeriod <tickUpdatePeriod>
/recov setMaxInventoriesPerPlayer <maxInventoriesPerPlayer>
/recov setRequirePermissionToCache <requirePermissionToCache>
不带任何参数调用 list 命令时,将列出拥有已存储物品栏的玩家,包括离线玩家。传入玩家的用户名时,将列出该玩家的死亡物品栏。
list 命令的第二组可选参数允许仅查看在线玩家的物品栏,并指定一个可选过滤器。
由此产生的一种情况是,如果希望列出用户名为 true 或 false 的玩家的死亡物品栏,则必须将它们全部大写。因此,
/recov list TRUE 将列出用户名为 true 的玩家的物品栏,而 /recov list true 将列出在线且具有死亡物品栏的玩家。
clear 命令不带参数时,
将清除所有死亡物品栏。传入玩家用户名时,仅清除该玩家的死亡物品栏。
restore 命令将恢复玩家的物品栏。deathNumber 字段指定从哪次死亡中恢复。如果你想将一个玩家的死亡物品栏恢复到另一个玩家身上,可以使用 sourcePlayer 参数。
printDeathInventory 命令将打印玩家死亡时其物品栏中的物品。
setTicksUntilExpired 将设置模组在删除玩家死亡物品栏条目之前等待的刻数。
默认情况下,此值设置为 48000。
setTickUpdatePeriod 将设置模组在检查是否有过期的死亡物品栏需要移除之前等待的时间(以刻为单位)。
默认情况下,此值设置为 8000。
setMaxInventoriesPerPlayer 将设置每个玩家的最大物品栏数量。如果发生更多死亡,最早的物品栏将被提前删除。
默认情况下,此值设置为 10。
setRequirePermissionToCache 将设置插件是否在缓存玩家死亡时的物品栏之前检查玩家是否具有 recov.cacheinventory 权限。
默认情况下,此值设置为 false。
!!! 如果服务器没有权限模组/插件,请勿启用 setRequirePermissionToCache。否则任何玩家死亡都会导致崩溃 !!!
权限等级至少为 3 的玩家可以使用所有 recov 命令,但他们不具备 recov.cacheinventory 权限。
如果你正在使用权限模组,以下权限分别对应
各个命令。
| 权限 |
描述 |
recov.command.recov.list |
使用 list 子命令所需。 |
recov.command.recov.clear |
使用 clear 子命令所需。 |
recov.command.recov.restore |
使用 restore 子命令所需。 |
recov.command.recov.printDeathInventory |
使用 printDeathInventory 子命令所需。 |
recov.command.recov.configure |
使用任何配置子命令所需,即 setTicksUntilExpired、setTickUpdatePeriod、setMaxInventoriesPerPlayer 和 setRequirePermissionToCache。 |
recov.cacheinventory |
当 requirePermissionToCache 设置为 true 时,缓存物品栏所需。 |
从玩家处移除 recov.cacheinventory 权限不会清除他们当前已有的缓存物品栏。
This fabric mod is meant to be installed on the server only. It will detect player deaths and cache their inventories for some period of time. During this period, a server administrator can easily restore the items to the player.
The plugin is interacted with entirely through a command API. The actions are all subcommands of the recov command.
The commands are listed below.
/recov list [<player>]
/recov list [<onlyOnlinePlayers>] [<filter>]
/recov clear [<player>]
/recov restore <player> [<deathNumber>] [<sourcePlayer>]
/recov printDeathInventory <player> [<deathNumber>]
/recov setTicksUntilExpired <ticksUntilExpired>
/recov setTickUpdatePeriod <tickUpdatePeriod>
/recov setMaxInventoriesPerPlayer <maxInventoriesPerPlayer>
/recov setRequirePermissionToCache <requirePermissionToCache>
The list command, with no arguments passed, will list players who have stored inventories, including offline players. When passing a player's username, it will list the death inventories of that player.
The second set of optional arguments for the list command will allow one to only view the inventories of online players, and specify an optional filter.
A consequence of this is that, if one wants to list the death inventories of players whose names are either true or false, one must specify them in all uppercase. So,
/recov list TRUE will list the inventories of the player whose username is true, which /recov list true will list the players who are online and who have death inventories.
The clear command, with zero parameters,
will clear all death inventories. When passing a player's username, it will only clear that player's death inventories.
The restore command will restore a player's inventory. The deathNumber field specifies which death to restore from. If you want to restore the death inventory of one player to a different one, you can use the sourcePlayer parameter.
The printDeathInventory command will print the items in a player's inventory at the time of their death.
The setTicksUntilExpired will set the amount of ticks the mod will wait before deleting a player death inventory entry.
By default, this is set to 48000.
The setTickUpdatePeriod will set the amount of time the mod will wait before checking if there are any expired death inventories to remove.
By default, this is set to 8000.
The setMaxInventoriesPerPlayer will set the maximum inventories per player. If any more deaths occur, the oldest inventories are deleted early.
By default, this is set to 10.
The setRequirePermissionToCache will set whether the plugin will check if a player has the recov.cacheinventory permission before caching their inventory on death.
By default, this is set to false.
!!! DO NOT ENABLE setRequirePermissionToCache IF THE SERVER DOES NOT HAVE A PERMISSIONS MOD/PLUGIN. IT WILL CRASH ON ANY PLAYER DEATH !!!
Players with permission level of at least 3 have access to all recov commands, but they do not have the recov.cacheinventory permission.
If you are using a permissions mod, the following permissions correspond to
each command.
| Permission |
Description |
recov.command.recov.list |
Required to use the list subcommand. |
recov.command.recov.clear |
Required to use the clear subcommand. |
recov.command.recov.restore |
Required to use the restore subcommand. |
recov.command.recov.printDeathInventory |
Required to use the printDeathInventory subcommand. |
recov.command.recov.configure |
Required to use any of the configuration subcommands, which are setTicksUntilExpired, setTickUpdatePeriod, setMaxInventoriesPerPlayer, and setRequirePermissionToCache. |
recov.cacheinventory |
Required to have inventory cached if requirePermissionToCache is set to true. |
Removing the recov.cacheinventory permission from a player will not clear their currently-existing cached inventories.
评论 0
登录后参与评分
还没有评论,来抢沙发吧