Give back int circuits when loading legacy save #1631
Merged
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.
What
This PR makes int circuits to be moved to one of the vacant machine slots when updating the mod.
Implementation Details
The Ghost Circuit PR (#1458) made circuits to disappear when updating. This can be prevented by moving the circuit item to machine input slot during NBT deserialization. If there's no space left in the machine, the circuit will be set as ghost circuit and the item itself will be voided, like in aforementioned PR.
Although not necessary, numerous implementation details related to ghost circuit was changed, namely the change of ghost circuit inventories to just store one integer value for save/load.
Outcome
Give back int circuits when loading legacy save.
Additional Information
This PR needs to be released along with #1458, otherwise this PR will break.
Potential Compatibility Issues
This PR renames
FakeCircuitSlotWidget
toGhostCircuitSlotWidget
for unifying term for ghost circuits, which is technically an API-breaking change.