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

Rebinding a powered spawner loses it's capacitor and settings #999

Merged
merged 5 commits into from
Feb 19, 2025

Conversation

CrazyPants
Copy link
Contributor

Description

When rebinding a powered spawner it's capacitor and all its settings are lost.
The fix for this is very hard coded but I can't see any other way around it.

Checklist

  • My code follows the style guidelines of this project (.editorconfig, most IDEs will use this for you).
  • I have made corresponding changes to the documentation.
  • My changes are ready for review from a contributor.

@dphaldes
Copy link
Contributor

Looks good but I am not sure whether this is the right way to tackle this as it feels very hardcoded.
Since all properties are stored as components on the Block ItemStack, we could simply copy them from input to resultStack. Maybe add an boolean field to SoulBindingRecipe that checks whether to copy components or not

@dphaldes dphaldes self-assigned this Feb 14, 2025
@CrazyPants
Copy link
Contributor Author

Yeah, I agree, I really don't like how hard coded it is. This is the only case where we would want to do this at the moment (and couldn't think of any other likely examples). I will look into adding the boolean.

@CrazyPants
Copy link
Contributor Author

Added more flexible solution

Copy link
Contributor

@dphaldes dphaldes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be enough to copy the components over

Co-authored-by: Darshan Phaldesai <51489635+dphaldes@users.noreply.github.com>
@CrazyPants
Copy link
Contributor Author

I think this should be enough to copy the components over

That's much neater. I missed that method. Thanks.

@Rover656 Rover656 merged commit aa963f4 into Team-EnderIO:dev/1.21.1 Feb 19, 2025
1 check passed
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.

3 participants