Skip to content

Commit 7f46b51

Browse files
authored
ASMAPI.getSystemPropertyFlag() checks the given property without only prepending "coremod." (#45)
1 parent 7628272 commit 7f46b51

File tree

1 file changed

+7
-7
lines changed
  • src/main/java/net/minecraftforge/coremod/api

1 file changed

+7
-7
lines changed

src/main/java/net/minecraftforge/coremod/api/ASMAPI.java

+7-7
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,14 @@ private static String map(String name, INameMappingService.Domain domain) {
6060
map(f -> f.apply(domain, name)).orElse(name);
6161
}
6262

63+
/**
64+
* Checks if the given JVM property (or if the property prepended with {@code "coremod."}) is {@code true}.
65+
*
66+
* @param propertyName the property to check
67+
* @return true if the property is true
68+
*/
6369
public static boolean getSystemPropertyFlag(final String propertyName) {
64-
return Boolean.getBoolean("coremod." + propertyName) || getSystemPropertyFlagOld(propertyName);
65-
}
66-
67-
/** @deprecated Contains the old, bugged logic that {@link #getSystemPropertyFlag(String)} used to have. */
68-
@Deprecated(forRemoval = true, since = "5.0")
69-
private static boolean getSystemPropertyFlagOld(final String propertyName) {
70-
return Boolean.getBoolean(System.getProperty("coremod." + propertyName, "TRUE"));
70+
return Boolean.getBoolean(propertyName) || Boolean.getBoolean("coremod." + propertyName);
7171
}
7272

7373
public enum InsertMode {

0 commit comments

Comments
 (0)