mirror of
https://github.com/Auxilor/EcoEnchants.git
synced 2025-02-03 02:21:21 +01:00
Fixed config updater
This commit is contained in:
parent
e5baa4f895
commit
69704c0550
@ -152,5 +152,6 @@ public abstract class AbstractCommand extends PluginDependent implements Command
|
|||||||
* @param sender The sender of the command
|
* @param sender The sender of the command
|
||||||
* @param args The arguments of the command
|
* @param args The arguments of the command
|
||||||
*/
|
*/
|
||||||
protected abstract void onExecute(CommandSender sender, List<String> args);
|
protected abstract void onExecute(CommandSender sender,
|
||||||
|
List<String> args);
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,7 @@ public class ConfigHandler extends PluginDependent {
|
|||||||
public void callUpdate() {
|
public void callUpdate() {
|
||||||
updatableClasses.forEach(clazz -> Arrays.stream(clazz.getDeclaredMethods()).forEach(method -> {
|
updatableClasses.forEach(clazz -> Arrays.stream(clazz.getDeclaredMethods()).forEach(method -> {
|
||||||
if (method.isAnnotationPresent(ConfigUpdater.class)) {
|
if (method.isAnnotationPresent(ConfigUpdater.class)) {
|
||||||
if (method.getParameterTypes().length == 0) {
|
if (method.getParameterTypes().length != 0) {
|
||||||
throw new InvalidUpdateMethodException("Update method must not have parameters.");
|
throw new InvalidUpdateMethodException("Update method must not have parameters.");
|
||||||
}
|
}
|
||||||
if (!Modifier.isStatic(method.getModifiers())) {
|
if (!Modifier.isStatic(method.getModifiers())) {
|
||||||
|
@ -240,13 +240,18 @@ public abstract class AbstractEcoPlugin extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
updatableClasses.add(Configs.class);
|
||||||
|
updatableClasses.add(DropManager.class);
|
||||||
|
updatableClasses.addAll(this.getUpdatableClasses());
|
||||||
|
|
||||||
this.getListeners().forEach(listener -> this.getEventManager().registerListener(listener));
|
this.getListeners().forEach(listener -> this.getEventManager().registerListener(listener));
|
||||||
|
|
||||||
this.getCommands().forEach(AbstractCommand::register);
|
this.getCommands().forEach(AbstractCommand::register);
|
||||||
|
|
||||||
this.getScheduler().runLater(this::afterLoad, 1);
|
this.getScheduler().runLater(this::afterLoad, 1);
|
||||||
|
|
||||||
this.getUpdatableClasses().forEach(clazz -> this.getConfigHandler().registerUpdatableClass(clazz));
|
this.updatableClasses.forEach(clazz -> this.getConfigHandler().registerUpdatableClass(clazz));
|
||||||
|
|
||||||
this.enable();
|
this.enable();
|
||||||
}
|
}
|
||||||
@ -314,7 +319,7 @@ public abstract class AbstractEcoPlugin extends JavaPlugin {
|
|||||||
this.getScheduler().cancelAll();
|
this.getScheduler().cancelAll();
|
||||||
new FastCollatedDropQueue.CollatedRunnable(this);
|
new FastCollatedDropQueue.CollatedRunnable(this);
|
||||||
|
|
||||||
this.reload();
|
this.onReload();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -342,17 +347,6 @@ public abstract class AbstractEcoPlugin extends JavaPlugin {
|
|||||||
return integrations;
|
return integrations;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Default updatable classes that exist within internal libraries.
|
|
||||||
*
|
|
||||||
* @return The default updatable classes.
|
|
||||||
*/
|
|
||||||
public final List<Class<? extends Updatable>> getDefaultUpdatableClasses() {
|
|
||||||
updatableClasses.add(Configs.class);
|
|
||||||
updatableClasses.add(DropManager.class);
|
|
||||||
return updatableClasses;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The plugin-specific code to be executed on enable.
|
* The plugin-specific code to be executed on enable.
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user