MinecraftDev icon indicating copy to clipboard operation
MinecraftDev copied to clipboard

InvalidInjectorMethodSignature incorrectly shown as last argument in method's descriptor is taken as a local variable

Open Jab125 opened this issue 1 year ago • 0 comments

Minecraft Development for IntelliJ plugin version

2024.1-1.7.5

IntelliJ version

2024.1.2 (Community)

Operating System

macOS 14.2

Target platform

Architectury

Description of the bug

With this mixin in MouseHandler (1.21-pre1):

@Inject(method = "onScroll",
    at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screens/Screen;mouseScrolled(DDDD)Z", ordinal = 0), cancellable = true, locals = LocalCapture.CAPTURE_FAILHARD)
public void onMouseScrolled(long handle, double xOffset, double yOffset, CallbackInfo info, boolean discreteMouseScroll, double mouseWheelSensitivity, double amountX, double amountY, double x, double y) {
  if (!info.isCancelled()) {
    var result = ClientScreenInputEvent.MOUSE_SCROLLED_PRE.invoker().mouseScrolled(minecraft, minecraft.screen, x, y, amountX, amountY);
    if (result.isPresent())
      info.cancel();
  }
}

yOffset is mistaken as a local variable, even though it isn't (it launches fine)

Jab125 avatar Jun 10 '24 02:06 Jab125