Skip to content

Incompatible with some ancient mods #697

@Water-OR

Description

@Water-OR

The method public static void addConfiguration(String configFile) in class org.spongepowered.asm.mixin.Mixins didn't provide the fallback MixinEnvironment.

Mixin configs in some ancient mods didn't provide value of target key and they add configures by calling this method. This problem makes these mods throws an NullPointerExceptions while initializing their mixin configs.

in mixin 0.8.5, the implementation of this method is like

public static void addConfiguration(String configFile) {
    Mixins.createConfiguration(configFile, MixinEnvironment.getDefaultEnvironment());
}

but in mixin 0.8.6 and above, the implementation of this method is like

public static void addConfiguration(String configFile) {
    Mixins.createConfiguration(configFile, null, null);
}

I'm not sure if this is a bug or not, but it do cuase crash in some case.

A good way to fix the bug is to replace implementation of this method with

public static void addConfiguration(String configFile) {
    Mixins.createConfiguration(configFile, MixinEnvironment.getDefaultEnvironment(), null);
}

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