Infernal Mobs: Disabling mods in config by setting them to false does not work
CplPibald opened this issue · 1 comments
Using infernalmobs-1.15.1.1.jar
on Minecraft 1.15.2
Repro steps:
Open infernalmobs.cfg and go down to the modsEnabled
section.
Set several mods to false
Expected:
Disabled mods no longer appear on mobs
Observed:
Setting entries to false
has no effect. Mobs still spawn with those abilities.
Workaround
To disable a mod, remove the line entirely instead of setting it to false. Note if you remove the last line in the list, make sure you also remove the comma after the last entry to avoid a JSON validation error.
Analysis
The problem appears to be in this line in InfernalMobsCore.java
mobMods.removeIf(c -> !config.getModsEnabled().containsKey(c.getSimpleName()));
This line removes any mods that don't have a key in the mobsEnabled section. It only checks whether the key exists; it does not check the true/false value of the key.
Removing the line entirely from the config file causes the key to no longer exist, which has the desired effect.
Good catch. Fixed this in commit e3c2337 and pushed Infernal Mobs 1.15.2.1 to curse