Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Give back int circuits when loading legacy save #1631

Merged
merged 5 commits into from
Mar 23, 2023

Conversation

Tictim
Copy link
Contributor

@Tictim Tictim commented Mar 20, 2023

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 to GhostCircuitSlotWidget for unifying term for ghost circuits, which is technically an API-breaking change.

@Tictim Tictim added the type: feature New feature or request label Mar 20, 2023
@Caedis
Copy link
Contributor

Caedis commented Mar 20, 2023

Looks good from me.

Things I tested:

  • Mold in circuit slot before -> Mold in open input slot after (most possible void scenario due to fluid solidifier having only 1 item slot and some people using the ic slot as storage)
  • Shift right clicking machine with IC changes ghost circuit value to real IC value
  • Left clicking ghost IC slot with real IC changes value to match
  • Scrolling in ghost circuit slot works as expected
  • Left clicking empty IC slot causes ghost IC to appear at config 0
  • Right clicking IC slot cause ghost IC to disappear

@Tictim Tictim requested a review from TechLord22 March 20, 2023 07:54
@ALongStringOfNumbers ALongStringOfNumbers added this to the 2.5.5 milestone Mar 21, 2023
@TechLord22 TechLord22 merged commit 2d38101 into GregTechCEu:master Mar 23, 2023
@Tictim Tictim deleted the give_back_ghost_circuits branch March 23, 2023 04:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants