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