atomicstrykers-minecraft-mods icon indicating copy to clipboard operation
atomicstrykers-minecraft-mods copied to clipboard

Infernal Mobs: Disabling mods in config by setting them to false does not work

Open CplPibald opened this issue 4 years ago • 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.

CplPibald avatar Jun 25 '20 19:06 CplPibald

Good catch. Fixed this in commit https://github.com/AtomicStryker/atomicstrykers-minecraft-mods/commit/e3c2337933fc0e91094cb68b7050a17c7ba3d1ee and pushed Infernal Mobs 1.15.2.1 to curse

AtomicStryker avatar Jun 25 '20 21:06 AtomicStryker