Skip to content

Conversation

@Swedz
Copy link
Collaborator

@Swedz Swedz commented Nov 25, 2024

Contains some parts of #900

It might make sense to also add the CableTierHolder interface to electric machines and get the tier from their casing component. That can easily be done. Doing it for multi blocks is a little ambiguous since a multi block electric machine can have multiple types of hatches on it. It could just use the highest tier, though. Would either of these changes be acceptable?

@Technici4n
Copy link
Contributor

Technici4n commented Nov 25, 2024

What is the motivation behind these changes? I.e. how are they helpful?

@Swedz
Copy link
Collaborator Author

Swedz commented Nov 26, 2024

I use it quite a bit for my tesla coil machines I've been working on for EI.

It lets me make an anonymous instance of CasingComponent to track when the casing changes and do some updates to the network when that happens.

Plus, it makes grabbing the cable tier of a tesla coil block/multiblock much more straightforward (I was previously using a mixin to do this) - and I need that to be able to wirelessly transfer power on a specific voltage.

@Technici4n
Copy link
Contributor

It lets me make an anonymous instance of CasingComponent to track when the casing changes and do some updates to the network when that happens.

It would be cleaner to add an optional change notification callback IMO.

@Swedz
Copy link
Collaborator Author

Swedz commented Dec 1, 2024

I made those changes. I didn't add CableTierHolder to AbstractStorageMachineBlockEntity (and thus TransformerMachineBlockEntity) because it holds two different cable tiers and I wasn't sure which one would be best to return there.

@Swedz Swedz requested a review from Technici4n December 1, 2024 23:54
@Technici4n Technici4n merged commit 525cdec into AztechMC:1.21.x Dec 2, 2024
1 check passed
@Swedz Swedz deleted the accessible-casing-tier branch December 10, 2024 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants