mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-11-06 10:49:44 +01:00
[Debt] Removed ConfigSystem.getInstance method
Related methods (getConfig_Old, getThemeSystem) were also removed. Affected issues: none
This commit is contained in:
parent
fca93578af
commit
7b09f588fe
@ -5,7 +5,6 @@
|
|||||||
package com.djrapitops.plan.system.settings.config;
|
package com.djrapitops.plan.system.settings.config;
|
||||||
|
|
||||||
import com.djrapitops.plan.api.exceptions.EnableException;
|
import com.djrapitops.plan.api.exceptions.EnableException;
|
||||||
import com.djrapitops.plan.system.PlanSystem;
|
|
||||||
import com.djrapitops.plan.system.SubSystem;
|
import com.djrapitops.plan.system.SubSystem;
|
||||||
import com.djrapitops.plan.system.file.FileSystem;
|
import com.djrapitops.plan.system.file.FileSystem;
|
||||||
import com.djrapitops.plan.system.settings.Settings;
|
import com.djrapitops.plan.system.settings.Settings;
|
||||||
@ -13,7 +12,6 @@ import com.djrapitops.plan.system.settings.theme.Theme;
|
|||||||
import com.djrapitops.plugin.api.utility.log.Log;
|
import com.djrapitops.plugin.api.utility.log.Log;
|
||||||
import com.djrapitops.plugin.logging.L;
|
import com.djrapitops.plugin.logging.L;
|
||||||
import com.djrapitops.plugin.logging.error.ErrorHandler;
|
import com.djrapitops.plugin.logging.error.ErrorHandler;
|
||||||
import com.djrapitops.plugin.utilities.Verify;
|
|
||||||
|
|
||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@ -43,18 +41,6 @@ public abstract class ConfigSystem implements SubSystem {
|
|||||||
this.errorHandler = errorHandler;
|
this.errorHandler = errorHandler;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
public static ConfigSystem getInstance() {
|
|
||||||
ConfigSystem configSystem = PlanSystem.getInstance().getConfigSystem();
|
|
||||||
Verify.nullCheck(configSystem, () -> new IllegalStateException("Config System has not been initialized."));
|
|
||||||
return configSystem;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
public static PlanConfig getConfig_Old() {
|
|
||||||
return getInstance().config;
|
|
||||||
}
|
|
||||||
|
|
||||||
public PlanConfig getConfig() {
|
public PlanConfig getConfig() {
|
||||||
return config;
|
return config;
|
||||||
}
|
}
|
||||||
@ -63,16 +49,13 @@ public abstract class ConfigSystem implements SubSystem {
|
|||||||
return theme;
|
return theme;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
public Theme getThemeSystem() {
|
|
||||||
return getInstance().theme;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void enable() throws EnableException {
|
public void enable() throws EnableException {
|
||||||
try {
|
try {
|
||||||
copyDefaults();
|
copyDefaults();
|
||||||
config.save();
|
config.save();
|
||||||
|
|
||||||
|
// TODO Set Debug logger somewhere
|
||||||
Log.setDebugMode(config.getString(Settings.DEBUG));
|
Log.setDebugMode(config.getString(Settings.DEBUG));
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new EnableException("Failed to save default config.", e);
|
throw new EnableException("Failed to save default config.", e);
|
||||||
|
Loading…
Reference in New Issue
Block a user