Skip to content

Conversation

@Jonathing
Copy link
Member

This was discussed in a large part over Discord (starting here). My fix for #35, implemented in #50, did not account for the possibility that older coremods could rely on the broken behavior of the old method.

Unfortunately, fixing this problem relies on getting the Minecraft version within CoreMods. Since CoreMods is not loaded before FMLLoader is, CoreMods now relies on FMLLoader as a soft-dependency in order to get version information. This version information is used to determine whether it should apply the fix to ASMAPI.findFirstInstructionBefore() by default or not. I have made it so that the fix is applied by default on Minecraft 1.21.3 and later.

Additionally, I've added two sister methods that have a boolean parameter, fixLogic, to override this behavior. This allows for modders who still actively mod older versions to allow overriding the fix for themselves to benefit from the intended behavior of the method.

It is INSANE to me that version info is somehow not exposed in either
ForgeSPI or ModLauncher.
- Use FMLLoader to get the current version. If it's below 1.21.3, do not
use the fixed logic by default
- Add new methods that include a boolean parameter for fixing the logic.
This overrides the behavior imposed by CoreMods to fix the logic based
on MC version.
@Jonathing
Copy link
Member Author

I've marked this PR as a draft for now as I haven't tested it yet. Feedback on the code would still be appreciated.

@Jonathing Jonathing requested a review from a team October 31, 2024 05:14
@Jonathing
Copy link
Member Author

Jonathing commented Oct 31, 2024

As suggested by @PaintNinja, I've removed the soft-dependency on FMLLoader and am instead using ModLauncher's blackboard to arbitrarily tell CoreMods if it should not fix the bugged behavior. On all versions before Forge for 1.21.3, I will be sending this key to the blackboard.

@Jonathing Jonathing requested a review from a team October 31, 2024 21:55
@Jonathing
Copy link
Member Author

This PR is ready for merge.

@Jonathing Jonathing changed the title Account for logical breaking change in findFirstInstructionBefore() Account for logical breaking change in ASMAPI.findFirstInstructionBefore() Nov 1, 2024
Copy link
Member

@LexManos LexManos left a comment

Choose a reason for hiding this comment

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

Looks fine to me

@LexManos LexManos merged commit 7437c08 into MinecraftForge:master Nov 1, 2024
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