Merge pull request #2349 from open-osrs/enabled-by-default

plugins: re-add enabledByDefault
This commit is contained in:
Kyle
2020-02-18 00:17:44 +00:00
committed by GitHub
2 changed files with 4 additions and 1 deletions

View File

@@ -58,4 +58,6 @@ public @interface PluginDescriptor
boolean loadWhenOutdated() default false;
PluginType type() default PluginType.UNCATEGORIZED;
boolean enabledByDefault() default true;
}

View File

@@ -462,7 +462,8 @@ public class PluginManager
return Boolean.parseBoolean(value);
}
return true;
final PluginDescriptor pluginDescriptor = plugin.getClass().getAnnotation(PluginDescriptor.class);
return pluginDescriptor == null || pluginDescriptor.enabledByDefault();
}
@SuppressWarnings("unchecked")