Added experimental tp ignore support

Signed-off-by: BuildTools <[email protected]>
This commit is contained in:
WiIIiam278 authored and BuildTools committed 2021-07-08 02:16:33 +03:00
1 parent c6ad5ece5c
commit 5c16573f39
1 file changed
+2
@@ -15,11 +15,13 @@ public class UpgradeDatabase {
public static void upgradeDatabase() {
plugin.reloadConfig();
if (plugin.getConfig().getInt("config_file_version", 1) > 5) {
plugin.getLogger().info("Detected that the database needs updating. Running database upgrade...");
Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> {
try (PreparedStatement statement = HuskHomes.getConnection().prepareStatement("ALTER TABLE " + HuskHomes.getSettings().getPlayerDataTable() + " ADD `is_ignoring_requests` boolean NOT NULL DEFAULT 0")) {
statement.executeUpdate();
} catch (SQLException e) {
plugin.getLogger().log(Level.SEVERE, "An SQL exception occurred upgrading the database format!", e);
plugin.getLogger().info("Database update complete!");
} finally {
// Update the config file version
Bukkit.getScheduler().runTask(plugin, () -> {