Skip to content

Inherit patcher types - #39

Open
Nytra wants to merge 2 commits into
ResoniteModding:masterfrom
Nytra:inheritPatcherTypes
Open

Inherit patcher types#39
Nytra wants to merge 2 commits into
ResoniteModding:masterfrom
Nytra:inheritPatcherTypes

Conversation

@Nytra

@Nytra Nytra commented Jul 25, 2026

Copy link
Copy Markdown

This makes pre-patcher types be inherited which matches the behavior of plugin types.

Description

There is some difference between the way plugin types and patcher types are found in assemblies.

The plugin types will search with inheritance whereas the patcher types will not.

This PR makes the plugins and patchers use the same searching code essentially.

Current plugin searching code which this PR is based off:

if (!ReferencesThisAssembly(ass))

if (ass.MainModule.GetTypeReferences().Any(r => MetadataHelper.TypeInheretsFrom(r, typeof(BepInPlugin))))

Plugin attribute code which passes the third parameter to make it use inheritance:

var attr = MetadataHelper.GetCustomAttributes<BepInPlugin>(td, false, true).FirstOrDefault();

Motivation and Context

I need this for my UniModFramework

How Has This Been Tested?

Tested by loading some pre-patchers and they seem to work.

Screenshots (if appropriate):

N/a

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@hazre

hazre commented Jul 27, 2026

Copy link
Copy Markdown
Member

I'm cool with this change as long as it doesn't break existing or future pre-patchers. Meaning it would require some extensive testing.

@Nytra

Nytra commented Jul 27, 2026

Copy link
Copy Markdown
Author

I've tested it with Arti's FourLeafClover mod and it works, I'm not sure what else there is to test.

@EIA485

EIA485 commented Jul 27, 2026

Copy link
Copy Markdown

as relevant context heres why my upstream pr was denied for now
another prepatcher mod you can test against is DeleagateRefEditing

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