Fix ModuleConfig bugs, config loading works great now

This commit is contained in:
noil 2023-05-19 14:11:37 -04:00
parent c89940160c
commit f5fabde095
1 changed files with 9 additions and 3 deletions

View File

@ -49,10 +49,16 @@ public class ModuleConfig extends Configurable {
}
// Check if we are already enabled
if (entry.getKey().equalsIgnoreCase("Enabled") && !module.isEnabled() && module.getType() != Module.ModuleType.HIDDEN) {
if (entry.getValue().getAsBoolean()) {
module.toggle();
if (entry.getKey().equalsIgnoreCase("Enabled") && module.getType() != Module.ModuleType.HIDDEN) {
if (entry.getValue().getAsBoolean() && !module.isEnabled()) {
module.setEnabled(true);
module.onEnable();
}
if (!entry.getValue().getAsBoolean() && module.isEnabled()) {
module.setEnabled(false);
module.onDisable();
}
module.onToggle();
}
for (Value val : module.getValueList()) {