MinecraftDev icon indicating copy to clipboard operation
MinecraftDev copied to clipboard

MixinExtras WrapOperation has a false positive with generic methods

Open gabizou opened this issue 9 months ago • 0 comments

Minecraft Development for IntelliJ plugin version

2024.3-1.8.2

IntelliJ version

IntelliJ IDEA 2024.3.1.1

Operating System

macOS 15.2

Target platform

Mixins

Description of the bug

Add a Mixin targeting SyncedEntityData and use MixinExtras with the following @WrapOperation


    @WrapOperation(
        method = "set(Lnet/minecraft/network/syncher/EntityDataAccessor;Ljava/lang/Object;Z)V",
        at = @At(value = "INVOKE", target = "Lnet/minecraft/network/syncher/SynchedEntityData$DataItem;setValue(Ljava/lang/Object;)V")
    )
    private <T> void impl$useEventValue(
        final SynchedEntityData.DataItem<T> instance,
        final T $$0, final Operation<Void> original, final EntityDataAccessor<T> key, final T incoming,
        final boolean isServer,
    ) {
        if (eventHolder.get() == null) {
            original.call(instance, $$0);
            return;
        }

        original.call(instance, $$0);
    }

And you will get this error report:

Image

Even though at runtime, it's all still just Object types. Note that this does in fact work at runtime and application.

gabizou avatar Jan 19 '25 22:01 gabizou