diff --git a/src/fmllauncher/java/net/minecraftforge/fml/loading/moddiscovery/ModFileInfo.java b/src/fmllauncher/java/net/minecraftforge/fml/loading/moddiscovery/ModFileInfo.java index ee92783e08..80251180d7 100644 --- a/src/fmllauncher/java/net/minecraftforge/fml/loading/moddiscovery/ModFileInfo.java +++ b/src/fmllauncher/java/net/minecraftforge/fml/loading/moddiscovery/ModFileInfo.java @@ -70,8 +70,7 @@ public class ModFileInfo implements IModFileInfo, IConfigurable this.license = config.getConfigElement("license") .orElseThrow(()->new InvalidModFileException("Missing License, please supply a license.", this)); this.showAsResourcePack = config.getConfigElement("showAsResourcePack").orElse(false); - this.properties = config.getConfigElement("properties"). - map(UnmodifiableConfig::valueMap).orElse(Collections.emptyMap()); + this.properties = config.>getConfigElement("properties").orElse(Collections.emptyMap()); this.modFile.setFileProperties(this.properties); this.issueURL = config.getConfigElement("issueTrackerURL").map(StringUtils::toURL).orElse(null); final List modConfigs = config.getConfigList("mods"); diff --git a/src/fmllauncher/java/net/minecraftforge/fml/loading/moddiscovery/NightConfigWrapper.java b/src/fmllauncher/java/net/minecraftforge/fml/loading/moddiscovery/NightConfigWrapper.java index 01e1251aa1..c869f18304 100644 --- a/src/fmllauncher/java/net/minecraftforge/fml/loading/moddiscovery/NightConfigWrapper.java +++ b/src/fmllauncher/java/net/minecraftforge/fml/loading/moddiscovery/NightConfigWrapper.java @@ -45,8 +45,14 @@ public class NightConfigWrapper implements IConfigurable { } @Override + @SuppressWarnings("unchecked") public Optional 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