421 amulets will not deactivate its subtypes when not equipped 修复四合一护符在未装备时,使得子类型护符失效的问题#3806
421 amulets will not deactivate its subtypes when not equipped 修复四合一护符在未装备时,使得子类型护符失效的问题#3806YocyCraft wants to merge 2 commits into
Conversation
YocyCraft
commented
Jun 22, 2026
- 修复了 [Bug] 猫、狗、寂静护符不生效 #2868 的问题。
- 现在四合一护符在未装备时重置状态,会考虑玩家现有的子类型护符从而不重置对应状态。
- fixed [Bug] 猫、狗、寂静护符不生效 #2868
Reason: Security scan — [HIGH] Pipe to interpreter: curl | python3: Command pipes output from 'curl' directly to interpreter 'python3'. Downloaded content will be executed without inspection. Reply |
| public void inventoryTick(ServerPlayer player, ItemStack amulet, boolean isEnabled) { | ||
| for (AmuletType type : this.types) { | ||
| type.inventoryTick(player, amulet, isEnabled); | ||
| type.inventoryTick(player, amulet, isEnabled |
There was a problem hiding this comment.
'||' should be on a new line.
代码审查摘要PR #3806 — 修复四合一护符在未装备时使子类型护符失效的问题 变更概述修改 🔴 关键问题无。 修复逻辑正确,最小化改动,精准定位问题。 💡 建议1. 不过该行为与原来四合一激活时的逻辑一致(原来也是传四合一的 2. 但如果未来有人直接 ✅ 看起来不错
结论:✅ Approve(合并建议)修复清晰、准确、最小化,正确解决了 #2868 所述的问题。可合并。 |
|
现在我已经获得了足够的上下文,可以进行完整的审查。 代码审查摘要:PR #3806结论:评论(1 条建议,无阻塞性问题) 🎯 变更范围仅修改了一个文件: ✅ 问题理解正确原 bug(#2868):当四合一护符未装备时( 修复逻辑:在 ✅ 代码实现分析变更的核心行(第 17-20 行): // 改前
type.inventoryTick(player, amulet, isEnabled);
// 改后
type.inventoryTick(player, amulet, isEnabled ||
AmuletManager.INSTANCE.getAmuletsFromInventory(player).entries().stream()
.anyMatch(entry -> entry.getKey().value().equals(type)));逐层分析链路的正确性:
💡 建议1. 考虑在四合一护符已装备时跳过库存检查(性能优化)当前代码中,当 当
无需优化,但值得留意。 2. 关于
|