Skip to content

Paperweight can't remap class if it extends non-included third-party class which extends NMS class #230

@TheSirCororo

Description

@TheSirCororo

I have 2 classes. One of them is located in jar A in module A of root project, other located in jar B in module B of root project. All of them has active paperweight plugin. Module A has dependency on module B by compileOnly (which don't includes it into fat jar).
Module A has AEntity class which extends BEntity in B module which extends PathfinderMob from NMS.

I have following code:

AEntity a = ...;
GoalSelector goalSelector = a.goalSelector;

Bytecode of reobf jar:

AEntity a = ...;
PathfinderGoalSelector goalSelector = a.goalSelector;

goalSelector field was NOT remapped.

Core has correct remapped bytecode, but plugin does NOT.

I fixed this by doing following:

AEntity a = ...;
GoalSelector goalSelector = ((PathfinderMob) a).goalSelector;

Which was correctly remapped to:

AEntity a = ...;
PathfinderGoalSelector goalSelector = ((EntityCreature) a).oB;

Problem occured because paperweight can not detect NMS in other jar (other module) of project.

Possible solution: mark nms classes which remapped by paperweight with metadata and detect it. (maybe annotation processor can be used)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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