Skip to content

Commit

Permalink
Fix ModuleConfig bugs, config loading works great now
Browse files Browse the repository at this point in the history
  • Loading branch information
uoil committed May 19, 2023
1 parent c899401 commit f5fabde
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,16 @@ public void onLoad(JsonObject jsonObject) {
}

// 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()) {
Expand Down

0 comments on commit f5fabde

Please sign in to comment.