Skip to content

Commit e83b753

Browse files
committed
Fix crash on NeoForge .97
1 parent bb8a788 commit e83b753

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ versionAdapterDefinition=1.13.23+1.21.1
1313
versionAdapterRuntime=1.0.0+1.21.1
1414

1515
versionMc=1.21.1
16-
versionNeoForge=21.1.90
16+
versionNeoForge=21.1.97
1717
versionParchmentMc=1.21
1818
versionParchment=2024.07.28
1919
versionForgeAutoRenamingTool=1.0.12

src/main/java/org/sinytra/connector/service/FabricMixinBootstrap.java

+7-6
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import net.fabricmc.loader.impl.FabricLoaderImpl;
2626
import net.neoforged.fml.loading.LoadingModList;
2727
import net.neoforged.fml.loading.moddiscovery.ModFileInfo;
28+
import net.neoforged.fml.loading.moddiscovery.ModFileParser;
2829
import org.sinytra.connector.ConnectorEarlyLoader;
2930
import org.slf4j.Logger;
3031
import org.spongepowered.asm.mixin.FabricUtil;
@@ -49,13 +50,13 @@ public static void init() {
4950
Map<String, ModFileInfo> configToModMap = new HashMap<>();
5051

5152
for (ModFileInfo modFile : LoadingModList.get().getModFiles()) {
52-
List<String> mixinConfigs = modFile.getFile().getMixinConfigs();
53+
List<ModFileParser.MixinConfig> mixinConfigs = modFile.getFile().getMixinConfigs();
5354
if (mixinConfigs != null) {
54-
for (String config : mixinConfigs) {
55-
if (Files.exists(modFile.getFile().findResource(config))) {
56-
ModFileInfo prev = configToModMap.putIfAbsent(config, modFile);
55+
for (ModFileParser.MixinConfig config : mixinConfigs) {
56+
if (Files.exists(modFile.getFile().findResource(config.config()))) {
57+
ModFileInfo prev = configToModMap.putIfAbsent(config.config(), modFile);
5758
if (prev != null)
58-
LOGGER.debug("Non-unique Mixin config name {} used by the mods {} and {}", config, prev.moduleName(), modFile.moduleName());
59+
LOGGER.debug("Non-unique Mixin config name {} used by the mods {} and {}", config.config(), prev.moduleName(), modFile.moduleName());
5960
}
6061
}
6162
}
@@ -122,7 +123,7 @@ else if (dep.getKind() == ModDependency.Kind.BREAKS) {
122123

123124
if (reqIntervals.isEmpty()) throw new IllegalStateException("mod " + metadata.getId() + " is incompatible with every loader version?"); // shouldn't get there
124125

125-
Version minLoaderVersion = reqIntervals.get(0).getMin(); // it is sorted, to 0 has the absolute lower bound
126+
Version minLoaderVersion = reqIntervals.getFirst().getMin(); // it is sorted, to 0 has the absolute lower bound
126127

127128
if (minLoaderVersion != null) { // has a lower bound
128129
for (LoaderMixinVersionEntry version : VERSIONS) {

src/mod/resources/META-INF/neoforge.mods.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ config="connector.mixins.json"
2121
[[dependencies.connector]]
2222
modId="neoforge"
2323
type="required"
24-
versionRange="*"
24+
versionRange="[21.1.97,)"
2525
ordering="NONE"
2626
side="BOTH"
2727
[[dependencies.connector]]

0 commit comments

Comments
 (0)