minecraft-dev / MinecraftDev

Plugin for IntelliJ IDEA that gives special support for Minecraft modding projects.
https://minecraftdev.org/
GNU Lesser General Public License v3.0
1.48k stars 183 forks source link

[Feature Request] MixinSquared target resolution support #2333

Open ByThePowerOfScience opened 1 month ago

ByThePowerOfScience commented 1 month ago

Minecraft Development for IntelliJ plugin version

2024.1-1.8.0

Description of the feature request

When someone puts bad logic in a Mixin, MixinSquared is an incredibly-helpful library for patching it. Unfortunately, since it uses another annotation (@TargetHandler) for its target bootstrapping, MCDev doesn't natively understand it and can't offer the awesome Mixin-targeting support you guys put in it.

It should be a simple addition; all that would need to be done is recognize the following format for target resolution:

@TargetHandler(
  mixin="path.to.TargetMixin",
  name="nameOfTargetMethod(LOptionalArgumentsIfAmbiguous)",
  prefix="optionalPrefix$" // optional; for full-method injections of soft-implemented interface methods, aka the `ident$getUUID()` thing in the Mixin wiki that people don't usually have to use
)
@Inject( // or @Redirect, etc
  method="@MixinSquared:Handler",
  // the rest is the same as normal
)

and resolve it to "Targeted method: path.to.TargetMixin#nameOfTargetMethod(arguments)".

Thank you for your time, and for considering this suggestion!

Earthcomputer commented 1 month ago

The author of MixinSquared is already working on an intellij plugin for this, see https://github.com/Bawnorton/MixinSquared/issues/12