Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Correct logic
Browse files Browse the repository at this point in the history
Matyrobbrt committed Dec 22, 2023

Verified

This commit was signed with the committer’s verified signature.
1 parent d0884b0 commit d8dd983
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -203,7 +203,7 @@ private ForgeFeature.Bound makeBound(Map.Entry<String, Object> e) {
}

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

private IModInfo owner;
private final String modId;
@@ -224,7 +224,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 (!DISABLE_MANDATORY_DEPRECATION) {
if (MANDATORY_DEPRECATION_CRASH) {
throw new InvalidModFileException("Deprecated 'mandatory' field is used in dependency", getOwningFile());
}
}

0 comments on commit d8dd983

Please sign in to comment.