mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-16 10:34:49 +00:00
Reverse the meaning of state in fml.modStates system property and fmlModState.properties - it was very
derpy before. Now: true is enabled, false is disabled, as you would expect
This commit is contained in:
1 parent
d651189581
commit
2c85539517
1 file changed
+11
-11
@@ -443,30 +443,30 @@ public class Loader
|
|||||||
|
|
||||||
private void disableRequestedMods()
|
private void disableRequestedMods()
|
||||||
{
|
{
|
||||||
String disabledModList = System.getProperty("fml.modStates", "");
|
String forcedModList = System.getProperty("fml.modStates", "");
|
||||||
FMLLog.fine("Received a system property request \'%s\'",disabledModList);
|
FMLLog.fine("Received a system property request \'%s\'",forcedModList);
|
||||||
Map<String, String> sysPropertyStateList = Splitter.on(CharMatcher.anyOf(";:"))
|
Map<String, String> sysPropertyStateList = Splitter.on(CharMatcher.anyOf(";:"))
|
||||||
.omitEmptyStrings().trimResults().withKeyValueSeparator("=")
|
.omitEmptyStrings().trimResults().withKeyValueSeparator("=")
|
||||||
.split(disabledModList);
|
.split(forcedModList);
|
||||||
FMLLog.fine("System property request managing the state of %d mods", sysPropertyStateList.size());
|
FMLLog.fine("System property request managing the state of %d mods", sysPropertyStateList.size());
|
||||||
Map<String, String> modStates = Maps.newHashMap();
|
Map<String, String> modStates = Maps.newHashMap();
|
||||||
|
|
||||||
File disabledModFile = new File(canonicalConfigDir, "fmlModState.properties");
|
File forcedModFile = new File(canonicalConfigDir, "fmlModState.properties");
|
||||||
Properties disabledModListProperties = new Properties();
|
Properties forcedModListProperties = new Properties();
|
||||||
if (disabledModFile.exists() && disabledModFile.isFile())
|
if (forcedModFile.exists() && forcedModFile.isFile())
|
||||||
{
|
{
|
||||||
FMLLog.fine("Found a mod state file %s", disabledModFile.getName());
|
FMLLog.fine("Found a mod state file %s", forcedModFile.getName());
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
disabledModListProperties.load(new FileReader(disabledModFile));
|
forcedModListProperties.load(new FileReader(forcedModFile));
|
||||||
FMLLog.fine("Loaded states for %d mods from file", disabledModListProperties.size());
|
FMLLog.fine("Loaded states for %d mods from file", forcedModListProperties.size());
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
FMLLog.log(Level.INFO, e, "An error occurred reading the fmlModState.properties file");
|
FMLLog.log(Level.INFO, e, "An error occurred reading the fmlModState.properties file");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
modStates.putAll(Maps.fromProperties(disabledModListProperties));
|
modStates.putAll(Maps.fromProperties(forcedModListProperties));
|
||||||
modStates.putAll(sysPropertyStateList);
|
modStates.putAll(sysPropertyStateList);
|
||||||
FMLLog.fine("After merging, found state information for %d mods", modStates.size());
|
FMLLog.fine("After merging, found state information for %d mods", modStates.size());
|
||||||
|
|
||||||
@@ -474,7 +474,7 @@ public class Loader
|
|||||||
{
|
{
|
||||||
public Boolean apply(String input)
|
public Boolean apply(String input)
|
||||||
{
|
{
|
||||||
return !Boolean.parseBoolean(input);
|
return Boolean.parseBoolean(input);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user