Skip to content

Commit

Permalink
Update ModInfo.java
Browse files Browse the repository at this point in the history
  • Loading branch information
Matyrobbrt committed Dec 22, 2023
1 parent d8dd983 commit 214eedd
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,6 @@ private ForgeFeature.Bound makeBound(Map.Entry<String, Object> e) {
}

class ModVersion implements net.neoforged.neoforgespi.language.IModInfo.ModVersion {
public static final boolean MANDATORY_DEPRECATION_CRASH = !Boolean.parseBoolean(System.getProperty("fml.disableDependencyMandatoryDeprecation", "false"));

private IModInfo owner;
private final String modId;
private final VersionRange versionRange;
Expand All @@ -224,7 +222,7 @@ public ModVersion(final IModInfo owner, final IConfigurable config) {
if (mandatory.isPresent()) {
if (!FMLLoader.isProduction()) {
LOGGER.error("Mod '{}' uses deprecated 'mandatory' field in the dependency declaration for '{}'. Use the 'type' field and 'required'/'optional' instead", owner.getModId(), modId);
if (MANDATORY_DEPRECATION_CRASH) {
if (owner.getOwningFile().getFile().getProvider() instanceof ExplodedDirectoryLocator) {
throw new InvalidModFileException("Deprecated 'mandatory' field is used in dependency", getOwningFile());
}
}
Expand Down

0 comments on commit 214eedd

Please sign in to comment.