2 Commits
1.3 ... 1.4

Author SHA1 Message Date
9aede116ac 1.4
Bugfix:
Fixed a bug where the plugin was not loading properly
2023-07-31 18:35:45 +02:00
97fc283951 1.3 hotfix 2023-07-16 11:43:13 +02:00
3 changed files with 10 additions and 5 deletions

View File

@@ -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>

View File

@@ -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) {

View File

@@ -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) {