File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
loader/src/main/java/net/neoforged/fml/loading/moddiscovery Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 1010import com .electronwill .nightconfig .core .file .FileConfig ;
1111import com .electronwill .nightconfig .toml .TomlFormat ;
1212import com .mojang .logging .LogUtils ;
13+ import java .lang .module .ModuleDescriptor ;
1314import java .nio .file .Files ;
1415import java .nio .file .Path ;
1516import java .util .ArrayList ;
@@ -82,7 +83,10 @@ public MixinConfig(String config, List<String> requiredMods) {
8283 private static final ArtifactVersion LOWEST_MIXIN_VERSION ;
8384
8485 static {
85- HIGHEST_MIXIN_VERSION = new DefaultArtifactVersion (FabricUtil .class .getPackage ().getImplementationVersion ());
86+ HIGHEST_MIXIN_VERSION = new DefaultArtifactVersion (Optional .ofNullable (FabricUtil .class .getModule ().getDescriptor ())
87+ .flatMap (ModuleDescriptor ::version ).map (ModuleDescriptor .Version ::toString )
88+ .or (() -> Optional .ofNullable (FabricUtil .class .getPackage ().getImplementationVersion ()))
89+ .orElseThrow (() -> new IllegalStateException ("Cannot determine version of currently running mixin" )));
8690 int defaultMixinVersion = DeferredMixinConfigRegistration .DEFAULT_BEHAVIOUR_VERSION ;
8791 int patch = defaultMixinVersion % 1000 ;
8892 defaultMixinVersion /= 1000 ;
You can’t perform that action at this time.
0 commit comments