Skip to content

Loom fails to remap methods with generic types properly #1369

@Flemmli97

Description

@Flemmli97

I noticed a mod of mine crashing in prod and after investigating i found out that some methods are not properly remapped.
This happened when i try to use a class from another lib that contains a vanilla method.
Using loom 1.11.8 with official mapping

How to reproduce:

Update:
I've now tracked down the problem to generics:
Following class with the method will fail to get remapped:
Official mappings used below

public class Dummy<E extends Mob> extends Behavior<E>  {
    [...]

    // Vanilla method
    @Override
    protected boolean checkExtraStartConditions(ServerLevel level, E entity) {
        return false;
    }
}

If E is LivingEntity then the method will remap fine as Behavior is defined as Behavior<E extends LivingEntity>
but anything else causes it to fail remapping

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions