Skip to content

@WrapOperation with @Constant has no IDE support #2259

@IThundxr

Description

@IThundxr

Minecraft Development for IntelliJ plugin version

2023.3-1.7.3-472

IntelliJ version

IntelliJ IDEA 2023.3.4 (Ultimate Edition)

Operating System

Linux

Target platform

Architectury

Description of the bug

    @WrapOperation(method = "animate", constant = @Constant(classValue = AbstractBogeyBlock.class), ordinal = 0)
    private boolean unlinkedAnimateFix(Object instance, Operation<Boolean> original, @Share("wheelRadius") LocalDoubleRef wheelRadius) {
        if (instance instanceof AbstractBogeyBlock<?> type) {
            wheelRadius.set(type.getWheelRadius());
            return true;
        } else if (instance instanceof UnlinkedBogeyBlock type) {
            wheelRadius.set(type.getWheelRadius());
            return true;
        }
        return original.call(instance);
    }

targetting https://github.com/Fabricators-of-Create/Create/blob/703fd0de2055a1b79b5665d319acb4da3aace47c/src/main/java/com/simibubi/create/content/trains/bogey/AbstractBogeyBlockEntity.java#L103-L110

Oddly enough, its only for specific classes it looks like, https://github.com/Layers-of-Railways/Railway/blob/29947c1684d067b531218c8c77f15ad847491e2c/common/src/main/java/com/railwayteam/railways/mixin/MixinDeployerHandler.java works perfectly fine

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions