QuickKit v1.0.0
Minecraft 1.21.11 (Fabric)
功能说明
QuickKit 允许你将整个背包保存为命名的快捷包(kits),并在需要时立即恢复。每个快捷包都会保留你背包的完整状态,包括快捷栏、盔甲、副手物品、附魔、组件、描述文本、自定义名称以及所有其他物品数据。
快捷包使用 Minecraft 的 ItemStack.CODEC 进行序列化,确保物品信息的准确存储且具备前瞻性。每位玩家的快捷包存储在位于服务器运行目录下的独立 JSON 文件中:
pvppractice_kits/<uuid>.json
命令
所有命令都需要操作员权限等级 2。
/kit save <name>
将当前背包保存为命名的快捷包。快捷包名称最长可达 64 个字符。
/kit load <name>
清空当前背包并恢复所选快捷包。
/kit delete <name>
永久删除指定的快捷包。
/kit rename <old> <new>
重命名现有快捷包。
/kit list
在聊天栏中显示所有已保存的快捷包。
/kit bind <name>
创建一个特殊的绑定物品,使用时可立即加载所选快捷包。
load、delete、bind 和 rename 命令支持快捷包名称的 Tab 补全。
图形用户界面 (GUI)
按 K 键(可在“控制 → PVP Practice Mod”中配置)打开快捷包管理界面。
GUI 以可滚动列表的形式显示所有已保存的快捷包。
快捷包列表操作
• 左击快捷包 → 立即加载该快捷包并关闭 GUI。
• 右击快捷包 → 选中该快捷包并以蓝色高亮显示,以便执行管理操作。
按钮
加载快捷包 (Load Kit)
• 加载当前选中的快捷包。
保存背包 (Save Inventory)
• 提示输入快捷包名称并保存当前背包。
删除快捷包 (Delete Kit)
• 在永久删除选中的快捷包之前,会弹出确认对话框。
重命名快捷包 (Rename Kit)
• 提示输入新名称并重命名选中的快捷包。
刷新 (Refresh)
• 直接从服务器重新加载快捷包列表。
快捷包绑定物品
运行以下命令:
/kit bind <name>
你会获得一个发光的下界之星,其属性如下:
• 自定义名称:“Kit: <name>”(金色,加粗)
• 描述文本:“Right-click to load kit”(灰色,斜体)
• 隐藏组件:pvppractice:kit_name
右击该绑定物品即可立即加载关联的快捷包。
为了防止意外丢失,如果在加载快捷包时绑定物品会被覆盖,QuickKit 会自动将其移动到下一个可用的背包槽位,从而尽可能确保它保留在你的背包中。
技术细节
• 通过自定义负载使用 Fabric API 网络通信:
• C2SKitActionPayload
• S2CKitListPayload
• 使用自定义数据组件:
• pvppractice:kit_name(字符串类型),用于标识绑定物品。
• 服务器端的快捷包缓存通过每个玩家 UUID 对应的 ConcurrentHashMap 处理,并持久化到磁盘。
• 玩家加入时自动加载快捷包,断开连接时自动保存快捷包。
• 完全基于服务器权威架构 —— 客户端仅发送请求,所有验证、快捷包管理和背包操作均由服务器独家处理。
要求
• Java 21
• Fabric Loader 0.18.4+
• Fabric API 0.141.3+
• Minecraft 1.21.11
QuickKit v1.0.0
Minecraft 1.21.11 (Fabric)
WHAT IT DOES
QuickKit allows you to save your entire inventory as named kits and restore them instantly whenever you need them. Every kit preserves the complete state of your inventory, including your hotbar, armor, offhand items, enchantments, components, lore, custom names, and all other item data.
Kits are serialized using Minecraft's ItemStack.CODEC, ensuring accurate and future-proof storage of item information. Each player's kits are stored in individual JSON files located under:
pvppractice_kits/<uuid>.json
within the server's run directory.
COMMANDS
All commands require Operator Level 2.
/kit save <name>
Saves your current inventory as a named kit. Kit names can be up to 64 characters long.
/kit load <name>
Clears your current inventory and restores the selected kit.
/kit delete <name>
Permanently deletes the specified kit.
/kit rename <old> <new>
Renames an existing kit.
/kit list
Displays all saved kits in chat.
/kit bind <name>
Creates a special binder item that instantly loads the selected kit when used.
Tab completion is available for kit names on the load, delete, bind, and rename commands.
GUI
Press K (configurable under Controls → PVP Practice Mod) to open the kit management interface.
The GUI displays all saved kits in a scrollable list.
Kit List Actions
• Left-click a kit → Instantly loads the kit and closes the GUI.
• Right-click a kit → Selects the kit and highlights it in blue for management actions.
Buttons
Load Kit
• Loads the currently selected kit.
Save Inventory
• Prompts for a kit name and saves your current inventory.
Delete Kit
• Opens a confirmation dialog before permanently deleting the selected kit.
Rename Kit
• Prompts for a new name and renames the selected kit.
Refresh
• Reloads the kit list directly from the server.
KIT BINDERS
Running:
/kit bind <name>
gives you a glowing Nether Star with:
• Custom Name: "Kit: <name>" (gold, bold)
• Lore: "Right-click to load kit" (gray, italic)
• Hidden component: pvppractice:kit_name
Right-clicking the binder instantly loads the linked kit.
To prevent accidental loss, if the binder would be overwritten during kit loading, QuickKit automatically moves it to the next available inventory slot, ensuring it remains in your inventory whenever possible.
TECHNICAL DETAILS
• Uses Fabric API networking through custom payloads:
• C2SKitActionPayload
• S2CKitListPayload
• Uses a custom data component:
• pvppractice:kit_name (String type) for binder identification.
• Server-side kit caching is handled through a ConcurrentHashMap per player UUID and persisted to disk.
• Kits are automatically loaded when a player joins and automatically saved when they disconnect.
• Fully server-authoritative architecture — the client only sends requests, while all validation, kit management, and inventory operations are handled exclusively on the server.
REQUIREMENTS
• Java 21
• Fabric Loader 0.18.4+
• Fabric API 0.141.3+
• Minecraft 1.21.11
评论 0
登录后参与评分
还没有评论,来抢沙发吧