Skip to content

Commit

Permalink
Fix crash on NeoForge .97
Browse files Browse the repository at this point in the history
  • Loading branch information
Su5eD committed Jan 20, 2025
1 parent bb8a788 commit e83b753
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ versionAdapterDefinition=1.13.23+1.21.1
versionAdapterRuntime=1.0.0+1.21.1

versionMc=1.21.1
versionNeoForge=21.1.90
versionNeoForge=21.1.97
versionParchmentMc=1.21
versionParchment=2024.07.28
versionForgeAutoRenamingTool=1.0.12
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import net.fabricmc.loader.impl.FabricLoaderImpl;
import net.neoforged.fml.loading.LoadingModList;
import net.neoforged.fml.loading.moddiscovery.ModFileInfo;
import net.neoforged.fml.loading.moddiscovery.ModFileParser;
import org.sinytra.connector.ConnectorEarlyLoader;
import org.slf4j.Logger;
import org.spongepowered.asm.mixin.FabricUtil;
Expand All @@ -49,13 +50,13 @@ public static void init() {
Map<String, ModFileInfo> configToModMap = new HashMap<>();

for (ModFileInfo modFile : LoadingModList.get().getModFiles()) {
List<String> mixinConfigs = modFile.getFile().getMixinConfigs();
List<ModFileParser.MixinConfig> mixinConfigs = modFile.getFile().getMixinConfigs();
if (mixinConfigs != null) {
for (String config : mixinConfigs) {
if (Files.exists(modFile.getFile().findResource(config))) {
ModFileInfo prev = configToModMap.putIfAbsent(config, modFile);
for (ModFileParser.MixinConfig config : mixinConfigs) {
if (Files.exists(modFile.getFile().findResource(config.config()))) {
ModFileInfo prev = configToModMap.putIfAbsent(config.config(), modFile);
if (prev != null)
LOGGER.debug("Non-unique Mixin config name {} used by the mods {} and {}", config, prev.moduleName(), modFile.moduleName());
LOGGER.debug("Non-unique Mixin config name {} used by the mods {} and {}", config.config(), prev.moduleName(), modFile.moduleName());
}
}
}
Expand Down Expand Up @@ -122,7 +123,7 @@ else if (dep.getKind() == ModDependency.Kind.BREAKS) {

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

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

if (minLoaderVersion != null) { // has a lower bound
for (LoaderMixinVersionEntry version : VERSIONS) {
Expand Down
2 changes: 1 addition & 1 deletion src/mod/resources/META-INF/neoforge.mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ config="connector.mixins.json"
[[dependencies.connector]]
modId="neoforge"
type="required"
versionRange="*"
versionRange="[21.1.97,)"
ordering="NONE"
side="BOTH"
[[dependencies.connector]]
Expand Down

0 comments on commit e83b753

Please sign in to comment.