Removed the need to register updatable classes - added reflections
This commit is contained in:
@@ -67,11 +67,6 @@ public abstract class EcoPlugin extends JavaPlugin {
|
||||
@Getter
|
||||
private final Set<String> loadedIntegrations = new HashSet<>();
|
||||
|
||||
/**
|
||||
* Set of classes to be processed on config update.
|
||||
*/
|
||||
private final List<Class<?>> updatableClasses = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* The internal plugin scheduler.
|
||||
*/
|
||||
@@ -362,16 +357,12 @@ public abstract class EcoPlugin extends JavaPlugin {
|
||||
}
|
||||
});
|
||||
|
||||
updatableClasses.addAll(this.loadUpdatableClasses());
|
||||
|
||||
this.loadListeners().forEach(listener -> this.getEventManager().registerListener(listener));
|
||||
|
||||
this.loadPluginCommands().forEach(PluginCommand::register);
|
||||
|
||||
this.getScheduler().runLater(this::afterLoad, 1);
|
||||
|
||||
this.updatableClasses.forEach(clazz -> this.getConfigHandler().registerUpdatableClass(clazz));
|
||||
|
||||
if (this.isSupportingExtensions()) {
|
||||
this.getExtensionLoader().loadExtensions();
|
||||
|
||||
|
||||
@@ -9,13 +9,6 @@ public interface ConfigHandler {
|
||||
*/
|
||||
void callUpdate();
|
||||
|
||||
/**
|
||||
* Register an updatable class.
|
||||
*
|
||||
* @param updatableClass The class with an update method.
|
||||
*/
|
||||
void registerUpdatableClass(@NotNull Class<?> updatableClass);
|
||||
|
||||
/**
|
||||
* Save all configs.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user