[Bug] 修复在多人联机状态下,连接到服务器的玩家,在查询携带nbt的无尽之箱的tooltip会造成崩端问题#344
Merged
cnlimiter merged 1 commit intoJun 10, 2026
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checks / 检查
我确认在报告之前我已经搜索了现有的问题或者拉取请求,以避免重复报告。
我确认我已经检查,如果我不按照说明进行操作,该问题可能会被直接关闭。
Related Issues / 相关的 GitHub 问题
Fix #338
Description / 描述
修复了在多人联机状态下,连接到服务器的玩家,在查询携带nbt标签的 无尽之箱(Infinity Chest) 的tooltip时,客户端会崩端的问题。
Cause Of The Problem / 问题原因
在玩家查询 无尽之箱(Infinity Chest) 的tooltip时,当目标物品携带
owner和channelID标签时,客户端就会尝试获取箱子的内容,在多人联机状态下,连接到服务器的玩家的客户端,在使用ServerChestManager.getInstance().getChest(owner, channelID)获取箱子实例的时候,会调用ServerChestManager的getInstance,其中会使用instance = new ServerChestManager(ServerLifecycleHooks.getCurrentServer());创建实例,没有检测ServerLifecycleHooks.getCurrentServer()为空的情况,导致load使用server.getWorldPath(LevelResource.ROOT)时调用的server变量为空值,抛出NPE。Solution / 解决方案
修复
ServerLifecycleHooks.getCurrentServer()和ServerChestManager.getInstance()的空值判断。Other Problem / 其它问题
没有找到
ServerLifecycleHooks.getCurrentServer()通过了空值判断,但实际使用时仍为空值的原因。