fix: 修复异步线程中,MagicBlock被放置的同时切换手持物品,触发事件的方块被防刷机制删除的问题 - #1
Open
IllTamer wants to merge 1 commit into
Open
Conversation
Author
|
如果需要,我可以提供稳定复现的视频 |
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.
问题描述
在异步线程中,当 MagicBlock 被放置的同时切换手持物品,此时触发 removeDuplicatesFromCurrentPlayerInventory 方法检测时,玩家 主手/副手 物品不等于触发事件的 MagicBlock ,且由于方块被放置,原 MagicBlock meta 更新,导致 equals 比较失效,从而产生触发事件的 MagicBlock 本身被防刷机制错误删除的问题
解决措施
在检测触发玩家自身背包时,传入触发物品对应的 slot,判定时跳过该 slot(Player#getInventory#getContents 无法获取到副手槽位,所以传参为 -1)