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

Improve several simulated block break actions of mods #478

Merged
merged 3 commits into from
Jan 21, 2025

Conversation

Pilzinsel64
Copy link
Contributor

@Pilzinsel64 Pilzinsel64 commented Jan 21, 2025

This PR intents to improve the following mods/items:

  • MineFactory Reloaded
    • Block smasher
    • Block breaker
  • Thermal Expansion
    • Terrain smasher

This allowes mods to manipulate the output, like EFR that changes the output of ore blocks to raw ore items. -> Make it more realistic, like a player that breaks a block, what it even is intented to be.

From my side this is tested in dev and within my full private pack (200+ mods).
However, someone should test this also in the full GTNH pack, if it breaks any maschine that break blocks or convert them to items. If it makes problems, I can will make the config defaults false.

@Pilzinsel64 Pilzinsel64 requested review from Caedis and a team January 21, 2025 18:32
Copy link
Member

@glowredman glowredman left a comment

Choose a reason for hiding this comment

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

I'd prefer the use of @ModifyExpressionValue over @WrapOperation here because it has less overhead and you want to call the original method in any case. @WrapOperation is intended for situations where the original method is expensive and you may not want to execute it in all cases.

@Pilzinsel64
Copy link
Contributor Author

Pilzinsel64 commented Jan 21, 2025

@glowredman I wonder why @ModifyExpressionValue? I've tried @ModifyReturnValue, as it was my first attemp, but I failed. For some reason I never get @ModifyReturnValue and @ModifyExpressionValue to work (also in other mixins, already spend many hours just to get it to work) and always land at @WrapOperation. :/

Feel free to tweak it and show me a better way. Going to learn from it for next time. 🙈

@Pilzinsel64
Copy link
Contributor Author

Pilzinsel64 commented Jan 21, 2025

That are the target methods and lines:
grafik
grafik
grafik

@glowredman glowredman requested a review from a team January 21, 2025 21:12
@serenibyss serenibyss merged commit af57067 into master Jan 21, 2025
1 check passed
@serenibyss serenibyss deleted the feat/improve-mfr-breakblock branch January 21, 2025 21:42
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