Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MixinExtras WrapOperation has a false positive with generic methods #2432

Open
gabizou opened this issue Jan 19, 2025 · 0 comments
Open

MixinExtras WrapOperation has a false positive with generic methods #2432

gabizou opened this issue Jan 19, 2025 · 0 comments

Comments

@gabizou
Copy link
Contributor

gabizou commented Jan 19, 2025

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant