Bukkit & Bungee systems

This commit is contained in:
Rsl1122 2018-01-11 16:29:02 +02:00
parent 96def3ddbb
commit f524568c39
5 changed files with 51 additions and 13 deletions

View File

@ -0,0 +1,24 @@
/*
* Licence is provided in the jar as license.yml also here:
* https://github.com/Rsl1122/Plan-PlayerAnalytics/blob/master/Plan/src/main/resources/license.yml
*/
package com.djrapitops.plan.system;
import com.djrapitops.plan.Plan;
import com.djrapitops.plan.system.file.FileSystem;
import com.djrapitops.plan.system.settings.config.BukkitConfigSystem;
import com.djrapitops.plan.system.update.VersionCheckSystem;
/**
* Represents PlanSystem for Plan.
*
* @author Rsl1122
*/
public class BukkitSystem extends PlanSystem {
public BukkitSystem(Plan plugin) {
versionCheckSystem = new VersionCheckSystem(plugin.getVersion());
fileSystem = new FileSystem(plugin);
configSystem = new BukkitConfigSystem();
}
}

View File

@ -0,0 +1,24 @@
/*
* Licence is provided in the jar as license.yml also here:
* https://github.com/Rsl1122/Plan-PlayerAnalytics/blob/master/Plan/src/main/resources/license.yml
*/
package com.djrapitops.plan.system;
import com.djrapitops.plan.PlanBungee;
import com.djrapitops.plan.system.file.FileSystem;
import com.djrapitops.plan.system.settings.config.BungeeConfigSystem;
import com.djrapitops.plan.system.update.VersionCheckSystem;
/**
* Represents PlanSystem for PlanBungee.
*
* @author Rsl1122
*/
public class BungeeSystem extends PlanSystem {
public BungeeSystem(PlanBungee plugin) {
versionCheckSystem = new VersionCheckSystem(plugin.getVersion());
fileSystem = new FileSystem(plugin);
configSystem = new BungeeConfigSystem();
}
}

View File

@ -6,7 +6,6 @@ package com.djrapitops.plan.system.settings.config;
import com.djrapitops.plan.system.file.FileSystem;
import java.io.File;
import java.io.IOException;
/**
@ -16,10 +15,6 @@ import java.io.IOException;
*/
public class BukkitConfigSystem extends ConfigSystem {
public BukkitConfigSystem(File configFile) {
super(configFile);
}
@Override
protected void copyDefaults() throws IOException {
config.copyDefaults(FileSystem.readFromResource("config.yml"));

View File

@ -6,7 +6,6 @@ package com.djrapitops.plan.system.settings.config;
import com.djrapitops.plan.system.file.FileSystem;
import java.io.File;
import java.io.IOException;
/**
@ -16,10 +15,6 @@ import java.io.IOException;
*/
public class BungeeConfigSystem extends ConfigSystem {
public BungeeConfigSystem(File configFile) {
super(configFile);
}
@Override
protected void copyDefaults() throws IOException {
config.copyDefaults(FileSystem.readFromResource("bungeeconfig.yml"));

View File

@ -8,12 +8,12 @@ import com.djrapitops.plan.api.exceptions.EnableException;
import com.djrapitops.plan.settings.locale.Locale;
import com.djrapitops.plan.settings.theme.Theme;
import com.djrapitops.plan.system.SubSystem;
import com.djrapitops.plan.system.file.FileSystem;
import com.djrapitops.plan.systems.Systems;
import com.djrapitops.plan.utilities.NullCheck;
import com.djrapitops.plugin.api.config.Config;
import com.djrapitops.plugin.api.utility.log.Log;
import java.io.File;
import java.io.IOException;
/**
@ -27,8 +27,8 @@ public abstract class ConfigSystem implements SubSystem {
protected final Locale locale;
protected final Theme theme;
public ConfigSystem(File configFile) {
config = new Config(configFile);
public ConfigSystem() {
config = new Config(FileSystem.getConfigFile());
locale = new Locale();
theme = new Theme();
}