InventorySync 将玩家物品栏存储于数据库中,并在玩家加入服务器时恢复。它还提供管理员图形界面(GUI),可打开并编辑离线玩家的物品栏或末影箱。
功能
- 在数据库中存储玩家的物品栏、末影箱、饥饿值和生命值。
- 当玩家加入服务器时恢复已保存的数据。
- 自动为新玩家创建数据库条目。
- 通过命令打开离线玩家的物品栏。
- 允许在游戏中编辑离线玩家的物品栏和末影箱。
- 如果在编辑过程中目标玩家上线,则不会保存数据。
工作原理
当玩家首次加入时,其当前数据会被写入数据库。
在后续加入时,插件会根据配置加载存储的数据,并重新应用物品栏、末影箱、饥饿值和生命值。
当玩家离开时,其当前状态会再次被保存。
管理员可以通过图形界面打开离线玩家的物品栏,并从中切换到该玩家的末影箱。只要目标玩家保持离线,关闭 GUI 时更改将会保存。
设置
- 在 Paper 服务器上安装本插件。
- 在
database.yml 中填写数据库凭据。
- 在
config.yml 中选择需要同步的数据:
inventory(物品栏)
enderchest(末影箱)
food(饥饿值)
health(生命值)
- 为工作人员分配所需的权限。
- 启动服务器或重载插件。
命令
/isa <player> - 打开离线玩家的物品栏
/isa reload - 重载插件配置
权限
inventorysync.use
inventorysync.reload
inventorysync.edit.inventory
inventorysync.edit.enderchest
注意事项
- 仅在目标玩家离线时才能进行编辑。
- 玩家数据存储于 SQL 数据库中。
InventorySync stores player inventories in a database and restores them when players join the server. It also provides an admin GUI that can open and edit the inventory or ender chest of offline players.
Features
- Stores player inventory, ender chest, food level, and health in a database.
- Restores saved data when a player joins the server.
- Automatically creates a database entry for new players.
- Opens the inventory of offline players through a command.
- Allows editing offline inventories and offline ender chests in-game.
- Prevents saving if the target player comes online during editing.
How it works
When a player joins for the first time, their current data is written to the database.
On future joins, the plugin loads the stored data and reapplies inventory, ender chest, food, and health depending on the configuration.
When the player leaves, their current state is saved again.
Admins can open an offline player's inventory through a GUI and switch from there to the player's ender chest. Changes are saved when the GUI is closed, as long as the target player stays offline.
Setup
- Install the plugin on a Paper server.
- Fill in the database credentials in
database.yml.
- Choose which data should be synchronized in
config.yml:
inventory
enderchest
food
health
- Assign the required permissions to staff.
- Start the server or reload the plugin.
Commands
/isa <player> - Opens an offline player's inventory
/isa reload - Reloads the plugin configuration
Permissions
inventorysync.use
inventorysync.reload
inventorysync.edit.inventory
inventorysync.edit.enderchest
Important Notes
- Editing only works while the target player is offline.
- Player data is stored in an SQL database
评论 0
登录后参与评分
还没有评论,来抢沙发吧