#nullable disable
using Mono.Cecil;
using StardewModdingAPI.Framework.ModLoading.Framework;
namespace StardewModdingAPI.Framework.ModLoading.Rewriters
{
/// Removes the 32-bit-only from loaded assemblies.
internal class ArchitectureAssemblyRewriter : BaseInstructionHandler
{
/*********
** Public methods
*********/
/// Construct an instance.
public ArchitectureAssemblyRewriter()
: base(defaultPhrase: "32-bit architecture") { }
///
public override bool Handle(ModuleDefinition module)
{
if (module.Attributes.HasFlag(ModuleAttributes.Required32Bit))
{
module.Attributes &= ~ModuleAttributes.Required32Bit;
this.MarkRewritten();
return true;
}
return false;
}
}
}