Removed the need to register updatable classes - added reflections

This commit is contained in:
Auxilor
2021-07-16 15:57:17 +02:00
committed by Auxilor
parent a451732c1e
commit 51f690c9cb
6 changed files with 22 additions and 82 deletions

View File

@@ -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();

View File

@@ -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.
*/