Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
9aede116ac | |||
97fc283951 |
2
pom.xml
2
pom.xml
@@ -7,7 +7,7 @@
|
||||
<groupId>net.t2code</groupId>
|
||||
<artifactId>Alias</artifactId>
|
||||
|
||||
<version>1.3</version>
|
||||
<version>1.4</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>T2C-Alias</name>
|
||||
|
@@ -17,8 +17,9 @@ import java.util.logging.Level;
|
||||
|
||||
public class Convert {
|
||||
protected static void convert() {
|
||||
File config = new File(Main.getPath(),"");
|
||||
if (config.exists()) convertTo4();
|
||||
File path = new File(Main.getPath(),"");
|
||||
File file = new File(Main.getPath(), "config.yml");
|
||||
if (path.exists() && file.exists()) convertTo4();
|
||||
}
|
||||
|
||||
private static void convertTo4() {
|
||||
@@ -26,7 +27,7 @@ public class Convert {
|
||||
File config = new File(Main.getPath(), "config.yml");
|
||||
YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(config);
|
||||
|
||||
if (yamlConfiguration.get(Config.configVersion.path) == null || ((Integer) Config.configVersion.value) < Util.getConfigVersion() && new File(Main.getPath(), "config.yml").exists()) {
|
||||
if (yamlConfiguration.get(Config.configVersion.path) == null || ((Integer) Config.configVersion.value) < Util.getConfigVersion()) {
|
||||
yamlConfiguration.set("ConfigVersion", null);
|
||||
try {
|
||||
yamlConfiguration.save(config);
|
||||
@@ -36,6 +37,9 @@ public class Convert {
|
||||
|
||||
File dir = new File(Main.getPath() + "/languages");
|
||||
File newDir = new File(Main.getPath() + "/OldConfig/Version3/languages");
|
||||
if (!dir.exists()){
|
||||
return;
|
||||
}
|
||||
try {
|
||||
FileUtils.moveDirectory(dir, newDir);
|
||||
} catch (IOException e) {
|
||||
|
@@ -44,10 +44,11 @@ public class Load {
|
||||
public static void loadReload() {
|
||||
HandlerList.unregisterAll(chatListener);
|
||||
HandlerList.unregisterAll(guiListener);
|
||||
boolean newInstall = !new File(Main.getPath(), "config.yml").exists();
|
||||
FileSelect.config();
|
||||
T2Ctemplate.onLoadSeparateStroke(Util.getPrefix());
|
||||
FileSelect.language();
|
||||
if (!new File(Main.getPath(), "config.yml").exists()) {
|
||||
if (newInstall) {
|
||||
try {
|
||||
CreateExampleAliasConfig.configCreate();
|
||||
} catch (Exception e) {
|
||||
|
Reference in New Issue
Block a user