79 lines
2.5 KiB
Java
79 lines
2.5 KiB
Java
package net.t2code.alias.Spigot.config.config;
|
|
|
|
import net.t2code.alias.Spigot.Main;
|
|
import net.t2code.t2codelib.SPIGOT.api.yaml.T2Cconfig;
|
|
import org.bukkit.configuration.file.YamlConfiguration;
|
|
|
|
import java.io.File;
|
|
import java.io.IOException;
|
|
|
|
public class SelectConfig {
|
|
private static Integer ConfigVersion = 4;
|
|
private static Integer isConfigVersion;
|
|
private static Boolean updateCheckOnJoin;
|
|
private static Boolean updateCheckSeePreReleaseUpdates;
|
|
private static Integer updateCheckTimeInterval;
|
|
private static String language;
|
|
|
|
private static Boolean buyMessage;
|
|
private static Boolean subAliasTab;
|
|
|
|
public static void onSelect() {
|
|
File config = new File(Main.getPath(), "config.yml");
|
|
YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(config);
|
|
|
|
isConfigVersion = yamlConfiguration.getInt("configVersion");
|
|
|
|
updateCheckOnJoin = yamlConfiguration.getBoolean("plugin.updateCheck.onJoin");
|
|
updateCheckSeePreReleaseUpdates = yamlConfiguration.getBoolean("plugin.updateCheck.seePreReleaseUpdates");
|
|
updateCheckTimeInterval = yamlConfiguration.getInt("plugin.updateCheck.timeInterval");
|
|
|
|
language = yamlConfiguration.getString("plugin.language");
|
|
|
|
buyMessage = yamlConfiguration.getBoolean("buy.message");
|
|
subAliasTab = yamlConfiguration.getBoolean("subAlias.tabComplete");
|
|
}
|
|
public static void setConfigVersion() {
|
|
File config = new File(Main.getPath(), "config.yml");
|
|
YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(config);
|
|
yamlConfiguration.set("configVersion", ConfigVersion);
|
|
try {
|
|
yamlConfiguration.save(config);
|
|
} catch (IOException e) {
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
|
|
public static Integer getConfigVersion() {
|
|
return ConfigVersion;
|
|
}
|
|
|
|
public static Integer getIsConfigVersion() {
|
|
return isConfigVersion;
|
|
}
|
|
|
|
public static Boolean getUpdateCheckOnJoin() {
|
|
return updateCheckOnJoin;
|
|
}
|
|
|
|
public static Boolean getUpdateCheckSeePreReleaseUpdates() {
|
|
return updateCheckSeePreReleaseUpdates;
|
|
}
|
|
|
|
public static Integer getUpdateCheckTimeInterval() {
|
|
return updateCheckTimeInterval;
|
|
}
|
|
|
|
public static String getLanguage() {
|
|
return language;
|
|
}
|
|
|
|
public static Boolean getBuyMessage() {
|
|
return buyMessage;
|
|
}
|
|
|
|
public static Boolean getSubAliasTab() {
|
|
return subAliasTab;
|
|
}
|
|
}
|