MonoModder support multi mods patch same method #208
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As the documentation said, currently MonoModder does not support multiple mods patching the same method.
The current situation is that if multiple mods patch the same method, the patched methods are replaced, not merged together. This is unacceptable for multiple mod developers, as they don't want their mod implementations to be dropped or disabled by other mods.
Therefore, I will try to add new conditions and implementations to MonoModder. The conditions and replacement process are written in code comments.
However, this feature is turned off by default for current compatibility, so if you need this feature, please set
CombineSameMethodMultiModPatches
(or env varMONOMOD_COMBINE_MORE_MODS_PATCH_SAME_METHOD=1
) to true.Also added some related unit tests