diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2020-05-20 00:56:28 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2020-05-20 00:56:28 -0400 |
commit | b38b7af05496e9a844ce8f63a05d23bd6c39430f (patch) | |
tree | 3d1a9f5af3a07ae8ced5fae56aaf136fd7b11971 | |
parent | 136a548fbbb27e28ac7b8167760388eb5754bdb9 (diff) | |
download | SMAPI-b38b7af05496e9a844ce8f63a05d23bd6c39430f.tar.gz SMAPI-b38b7af05496e9a844ce8f63a05d23bd6c39430f.tar.bz2 SMAPI-b38b7af05496e9a844ce8f63a05d23bd6c39430f.zip |
rewrite base types & interfaces (#711)
-rw-r--r-- | src/SMAPI/Framework/ModLoading/Framework/RecursiveRewriter.cs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/SMAPI/Framework/ModLoading/Framework/RecursiveRewriter.cs b/src/SMAPI/Framework/ModLoading/Framework/RecursiveRewriter.cs index 612d0fdd..3b8cda88 100644 --- a/src/SMAPI/Framework/ModLoading/Framework/RecursiveRewriter.cs +++ b/src/SMAPI/Framework/ModLoading/Framework/RecursiveRewriter.cs @@ -67,6 +67,12 @@ namespace StardewModdingAPI.Framework.ModLoading.Framework anyRewritten |= this.RewriteCustomAttributes(type.CustomAttributes); anyRewritten |= this.RewriteGenericParameters(type.GenericParameters); + foreach (InterfaceImplementation @interface in type.Interfaces) + anyRewritten |= this.RewriteTypeReference(@interface.InterfaceType, newType => @interface.InterfaceType = newType); + + if (type.BaseType.FullName != "System.Object") + anyRewritten |= this.RewriteTypeReference(type.BaseType, newType => type.BaseType = newType); + foreach (MethodDefinition method in type.Methods) { anyRewritten |= this.RewriteTypeReference(method.ReturnType, newType => method.ReturnType = newType); |