mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-12 08:17:35 +00:00
Fix modproperties property in mods.toml causing exception (#7192)
This commit is contained in:
1 parent
5a20705f05
commit
07ffc890e5
2 files changed
+8
-3
No files matched your search
@@ -70,8 +70,7 @@ public class ModFileInfo implements IModFileInfo, IConfigurable
|
||||
this.license = config.<String>getConfigElement("license")
|
||||
.orElseThrow(()->new InvalidModFileException("Missing License, please supply a license.", this));
|
||||
this.showAsResourcePack = config.<Boolean>getConfigElement("showAsResourcePack").orElse(false);
|
||||
this.properties = config.<UnmodifiableConfig>getConfigElement("properties").
|
||||
map(UnmodifiableConfig::valueMap).orElse(Collections.emptyMap());
|
||||
this.properties = config.<Map<String, Object>>getConfigElement("properties").orElse(Collections.emptyMap());
|
||||
this.modFile.setFileProperties(this.properties);
|
||||
this.issueURL = config.<String>getConfigElement("issueTrackerURL").map(StringUtils::toURL).orElse(null);
|
||||
final List<? extends IConfigurable> modConfigs = config.getConfigList("mods");
|
||||
|
||||
+7
-1
@@ -45,8 +45,14 @@ public class NightConfigWrapper implements IConfigurable {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T> Optional<T> getConfigElement(final String... key) {
|
||||
return this.config.getOptional(asList(key));
|
||||
return this.config.getOptional(asList(key)).map(value -> {
|
||||
if (value instanceof UnmodifiableConfig) {
|
||||
return (T) ((UnmodifiableConfig) value).valueMap();
|
||||
}
|
||||
return (T) value;
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user