diff --git a/Minepacks/src/at/pcgamingfreaks/Minepacks/Bukkit/Command/DebugCommand.java b/Minepacks/src/at/pcgamingfreaks/Minepacks/Bukkit/Command/DebugCommand.java index ff48b07..df2e040 100644 --- a/Minepacks/src/at/pcgamingfreaks/Minepacks/Bukkit/Command/DebugCommand.java +++ b/Minepacks/src/at/pcgamingfreaks/Minepacks/Bukkit/Command/DebugCommand.java @@ -80,8 +80,10 @@ public void execute(@NotNull CommandSender commandSender, @NotNull String mainCo messageStart.send(sender); File debugFile = new File(plugin.getDataFolder(), "debug.txt"); - if(debugFile.exists()) //noinspection ResultOfMethodCallIgnored - debugFile.delete(); + if(debugFile.exists() && !debugFile.delete()) + { + plugin.getLogger().warning("Unable to delete debug.txt file!"); + } writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(debugFile), StandardCharsets.UTF_8)); writer.append(plugin.getDescription().getName()).append(" Version: ").append(plugin.getDescription().getVersion()); diff --git a/Minepacks/src/at/pcgamingfreaks/Minepacks/Bukkit/Database/Language.java b/Minepacks/src/at/pcgamingfreaks/Minepacks/Bukkit/Database/Language.java index 49955cf..bb73d3d 100644 --- a/Minepacks/src/at/pcgamingfreaks/Minepacks/Bukkit/Database/Language.java +++ b/Minepacks/src/at/pcgamingfreaks/Minepacks/Bukkit/Database/Language.java @@ -18,6 +18,7 @@ package at.pcgamingfreaks.Minepacks.Bukkit.Database; import at.pcgamingfreaks.Minepacks.Bukkit.Database.Helper.OldFileUpdater; +import at.pcgamingfreaks.Version; import at.pcgamingfreaks.YamlFileManager; import org.bukkit.plugin.java.JavaPlugin; @@ -28,7 +29,7 @@ public class Language extends at.pcgamingfreaks.Bukkit.Language { - private static final int LANG_VERSION = 19, UPGRADE_THRESHOLD = LANG_VERSION; + private static final Version LANG_VERSION = new Version(19), UPGRADE_THRESHOLD = LANG_VERSION; public Language(JavaPlugin plugin) { diff --git a/Minepacks/src/at/pcgamingfreaks/Minepacks/Bukkit/Database/Migration/ToSQLMigration.java b/Minepacks/src/at/pcgamingfreaks/Minepacks/Bukkit/Database/Migration/ToSQLMigration.java index b18ca45..612e6b2 100644 --- a/Minepacks/src/at/pcgamingfreaks/Minepacks/Bukkit/Database/Migration/ToSQLMigration.java +++ b/Minepacks/src/at/pcgamingfreaks/Minepacks/Bukkit/Database/Migration/ToSQLMigration.java @@ -62,7 +62,10 @@ protected ToSQLMigration(@NotNull Minepacks plugin, @NotNull Database oldDb, @No case "mysql": newDb = new MySQL(plugin, connectionProvider); break; case "sqlite": final File dbFile = new File(SQLite.getDbFile(plugin)); - if(dbFile.exists()) dbFile.renameTo(new File(SQLite.getDbFile(plugin) + ".old_" + System.currentTimeMillis())); + if(dbFile.exists() && !dbFile.renameTo(new File(SQLite.getDbFile(plugin) + ".old_" + System.currentTimeMillis()))) + { + plugin.getLogger().warning("Failed to rename old database file."); + } newDb = new SQLite(plugin, connectionProvider); break; default: newDb = null;