ViewInventory
ViewInventory 是一款功能强大的 Minecraft Spigot/Paper 插件,专为服务器管理员和版主设计。它允许你实时无缝地查看和管理其他在线玩家的物品栏和末影箱。无论你是需要进行调查、提供支持,还是仅仅进行观察,ViewInventory 都能提供流畅、直观且交互性强的体验。
主要特性
-
实时同步:对目标玩家物品栏所做的任何更改(无论是他们自己还是你做的)都会立即反映在你正在查看的 GUI 中,反之亦然。
-
离线玩家支持(仅查看):由于数据完整性问题,不支持直接编辑离线玩家的物品栏,但你仍然可以查看他们的物品栏内容。
-
自定义 GUI 布局:提供了一个用户友好的 6x9 GUI,清晰地显示目标玩家的盔甲、副手和主物品栏槽位。
-
创造模式工具:在创造模式下,你可以使用鼠标中键(方块选择)将物品从目标玩家的物品栏复制到你的光标上,模仿原版行为。你还可以拾取目标玩家的头颅。
-
直观的控制:标准的物品栏点击操作(左键单击、右键单击、Shift+点击)按预期工作,用于移动和管理物品。
Tab 补全:易于使用的命令,支持子命令和玩家名称的 Tab 补全。
命令
/viewinventory <inventory|enderchest> <player>
别名: /vi <in|ec> <player>
权限
该插件采用权限系统(在版本 1.1-beta~ 中引入),能够对功能进行细粒度控制。拥有 OP 权限的玩家默认获得所有权限。
1. GUI 显示更新的过程(将目标玩家的物品栏复制到 GUI)
2. 点击动作反映的过程(将查看者在 GUI 中点击的内容复制到目标玩家的物品栏中)
当快速点击时,过程 1 会覆盖过程 2。这导致 GUI 在更改保存之前回退,从而导致物品消失。
解决方案
为了消除这种冲突,我们从根本上改变了方法。
优先处理点击操作
查看者在 GUI 内执行的有效点击操作(例如物品移动)现在由 Bukkit 的标准功能处理。这确保了与 Minecraft 正常物品栏操作完全相同的处理逻辑,防止物品消失。
稍后同步更改
修改后的 GUI 内容现在在 Bukkit 完成点击操作后的一个 tick 内复制到目标玩家的物品栏中。这完全消除了处理冲突,并确保更改安全地反映出来。
仅控制自定义槽位
插件干预现在仅限于对垃圾桶或玻璃板等特殊槽位的点击。这些操作会取消事件并由插件安全处理。
这种方法——“将处理留给 Bukkit,稍后反映结果”——既实现了稳定性,又保持了原版的触感,消除了物品消失的错误。
ViewInventory
ViewInventory is a powerful Minecraft Spigot/Paper plugin designed for server administrators and moderators. It allows you to seamlessly view and manage the inventories and ender chests of other online players in real-time. Whether you need to conduct investigations, provide support, or simply observe, ViewInventory offers a smooth, intuitive, and interactive experience.
Key Features
-
Real-time Synchronization: Any changes made to the target player's inventory (by them or you) are instantly reflected in the GUI you are viewing, and vice-versa.
-
Offline Player Support (View Only): While direct editing of offline players' inventories is not supported due to data integrity concerns, you can still view their inventory contents.
-
Custom GUI Layout: A user-friendly 6x9 GUI is provided, clearly displaying the target player's armor, offhand, and main inventory slots.
-
Creative Mode Utilities: In creative mode, you can use the middle-click (block selection) to copy items from the target's inventory to your cursor, mimicking vanilla behavior. You can also pick up the target player's head.
-
Intuitive Controls: Standard inventory click actions (left-click, right-click, shift-click) work as expected to move and manage items.
Tab Completion: Easy-to-use command with tab completion for subcommands and player names.
Commands
/viewinventory <inventory|enderchest> <player>
Aliases: /vi <in|ec> <player>
Permissions
This plugin employs a permission system (adopted in version 1.1-beta~), enabling granular control over features. Players with OP permissions are granted all permissions by default.
1. The process of updating the GUI display (copying the target player's inventory to the GUI)
2. The process reflecting click actions (copying what the viewer clicked in the GUI to the target's inventory)
When clicking rapidly, process 1 would overwrite process 2. This caused the GUI to revert before changes were saved, resulting in items disappearing.
Solution
To eliminate this conflict, we fundamentally changed the approach.
Prioritize Click Operations
Valid click operations performed by the viewer within the GUI (such as item movement) are now handled by Bukkit's standard functionality. This ensures the exact same processing as Minecraft's normal inventory operations, preventing item disappearance.
Synchronize Changes Later
The modified GUI contents are now copied to the target player's inventory one tick after Bukkit completes the click operation. This completely eliminates processing conflicts and ensures changes are reflected safely.
Control Only Custom Slots
Plugin intervention is now limited solely to clicks on special slots like the trash can or glass panes. These operations cancel the event and are safely handled by the plugin.
This approach—“leave processing to Bukkit and reflect results later”—achieves both stability and a vanilla-like feel, eliminating the item disappearance bug.
评论 0
登录后参与评分
还没有评论,来抢沙发吧