Minor changes
This commit is contained in:
@@ -474,8 +474,7 @@ public abstract class EcoPlugin extends JavaPlugin {
|
||||
* Default code to be executed on plugin reload.
|
||||
*/
|
||||
public final void reload() {
|
||||
this.getConfigYml().update();
|
||||
this.getLangYml().update();
|
||||
this.getConfigHandler().updateConfigs();
|
||||
|
||||
this.getConfigHandler().callUpdate();
|
||||
this.getConfigHandler().callUpdate(); // Call twice to fix issues
|
||||
|
||||
@@ -21,6 +21,11 @@ public interface ConfigHandler {
|
||||
*/
|
||||
void saveAllConfigs();
|
||||
|
||||
/**
|
||||
* Update all updatable configs.
|
||||
*/
|
||||
void updateConfigs();
|
||||
|
||||
/**
|
||||
* Add new config to be saved.
|
||||
*
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.willfp.eco.core.config.ConfigUpdater;
|
||||
import com.willfp.eco.internal.config.LoadableConfig;
|
||||
import com.willfp.eco.internal.config.updating.exceptions.InvalidUpdatableClassException;
|
||||
import com.willfp.eco.internal.config.updating.exceptions.InvalidUpdateMethodException;
|
||||
import com.willfp.eco.internal.config.yaml.UpdatableYamlConfig;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -95,4 +96,13 @@ public class EcoConfigHandler extends PluginDependent implements ConfigHandler {
|
||||
public void addConfig(@NotNull final LoadableConfig config) {
|
||||
configs.add(config);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateConfigs() {
|
||||
for (LoadableConfig config : configs) {
|
||||
if (config instanceof UpdatableYamlConfig updatableYamlConfig) {
|
||||
updatableYamlConfig.update();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ public class McmmoIntegrationImpl implements McmmoWrapper {
|
||||
/**
|
||||
* Disabled if mcmmo is outdated or missing classes.
|
||||
*/
|
||||
boolean disabled = false;
|
||||
private boolean disabled = false;
|
||||
|
||||
/**
|
||||
* Initialize mcMMO integration.
|
||||
|
||||
Reference in New Issue
Block a user