Skip to content

Fix hammer and miner drop crushing not checking all recipes#4492

Open
screret wants to merge 5 commits intoGregTechCEu:1.21from
screret:sc/fix-hammer-and-miner-drop-crushing
Open

Fix hammer and miner drop crushing not checking all recipes#4492
screret wants to merge 5 commits intoGregTechCEu:1.21from
screret:sc/fix-hammer-and-miner-drop-crushing

Conversation

@screret
Copy link
Contributor

@screret screret commented Jan 24, 2026

What

This PR fixes the hammer & large miner drop raw ore -> crushed ore conversion only ever checking the first recipe it came across and discarding the miner output if it's invalid, instead of checking all discovered recipes.

  • I don't believe this has been an issue so far, but it's better to fix now than to leave unfixed, right?

I also cached the loot functions after they're created & added the proper value the LootContext's random secuence so anything that uses it (e.g. loot modifiers) is now deterministic, as it would be if it was just mined from the world.

Implementation Details

Made the recipe checking use a loop instead of only looking at the first recipe returned by the iterator
changed lot of nested if statements to guard clauses so the code is more readable

Outcome

Fixed a potential bug and made the code neater (maybe even faster!) :3

Additional Information

The other change in gtceu.mixins.json was done automatically by IntelliJ and it kept (re)doing that so I gave up reverting it after a while.
This PR was split off from #4421.

@screret screret requested a review from a team as a code owner January 24, 2026 14:12
@github-actions github-actions bot added the 1.21 label Jan 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant