plugins: re-add enabledByDefault

This commit is contained in:
ThatGamerBlue
2020-02-17 17:41:34 +00:00
parent 6d68b7249f
commit 55a5926020
2 changed files with 4 additions and 1 deletions

View File

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

View File

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