fix(cover): 修正末影紅石鏈接在沒有訊號來源時仍輸出 15 - #60
Open
dead53216 wants to merge 1 commit into
Open
Conversation
EnderRedstoneLinkCover 的輸出取自頻道內所有成員值的最大值,但成員值在數個路徑上 會被孤立,而 redstoneSignalOutput 又只有 transfer() 的 OUT 分支會寫, 導致它一旦被寫成 15 就再也降不下來。 - 建構子在 NBT 還原「之前」就用隨機 UUID 註冊到預設頻道 FFFFFFFF:此時 uuid 與 colorStr 都還沒還原,於是每次區塊載入都留下一個永遠不會被移除的成員, 也讓 canRemove() 永遠為 false、頻道再也無法回收。改到 onLoad()(欄位已還原、 level 已設定)再註冊。 - onUnload() 沒有 removeMember():區塊卸載後該成員最後讀到的值會永久留在頻道裡, 其他 OUT 覆蓋板會一直讀到一個早已沒有來源的訊號。 - setIo() 與 setWorkingEnabled(false) 不會清掉 redstoneSignalOutput:切換成 IN 或關閉工作開關之後,機器那一面會永遠卡在最後一次的輸出值,且會存進 NBT。 新增 onTransferStopped() hook 一併歸零輸出與自己的頻道值。 - getSignalInput() 傳入 attachedSide.getOpposite(),但 Level#getSignal 的 Direction 語意是「接收方 -> 來源」,應為 attachedSide;對照 MachineControllerCover#getInputSignal 與 ControlPartMachine 皆是如此。 - setChannelName()/setPermission() 在把自己移出舊頻道之前就呼叫 deleteEntryIf, 舊頻道永遠通不過 canRemove()。改為先加入新頻道,再回收舊的。 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
EnderRedstoneLinkCover 的輸出取自頻道內所有成員值的最大值,但成員值在數個路徑上 會被孤立,而 redstoneSignalOutput 又只有 transfer() 的 OUT 分支會寫, 導致它一旦被寫成 15 就再也降不下來。