diff --git a/src/main/java/net/Indyuce/mmocore/manager/data/mysql/MySQLDataProvider.java b/src/main/java/net/Indyuce/mmocore/manager/data/mysql/MySQLDataProvider.java index f314f318..84645801 100644 --- a/src/main/java/net/Indyuce/mmocore/manager/data/mysql/MySQLDataProvider.java +++ b/src/main/java/net/Indyuce/mmocore/manager/data/mysql/MySQLDataProvider.java @@ -7,6 +7,9 @@ import net.Indyuce.mmocore.manager.data.PlayerDataManager; import net.Indyuce.mmocore.manager.data.yaml.YAMLGuildDataManager; import org.bukkit.configuration.file.FileConfiguration; +import java.sql.SQLException; +import java.util.concurrent.CompletableFuture; + public class MySQLDataProvider extends MMODataSource implements DataProvider { private final MySQLPlayerDataManager playerManager = new MySQLPlayerDataManager(this); private final YAMLGuildDataManager guildManager = new YAMLGuildDataManager(); @@ -42,7 +45,19 @@ getResultAsync("SELECT * FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = '" + "experience INT(11) DEFAULT 0,class VARCHAR(20),guild VARCHAR(20),last_login LONG," + "attributes LONGTEXT,professions LONGTEXT,times_claimed LONGTEXT,quests LONGTEXT," + "waypoints LONGTEXT,friends LONGTEXT,skills LONGTEXT,bound_skills LONGTEXT," - + "class_info LONGTEXT,is_saved INT(1), PRIMARY KEY (uuid));"); + + "class_info LONGTEXT, is_saved TINYINT, PRIMARY KEY (uuid));"); + + + getResult("SELECT * FROM information_schema.COLUMNS WHERE TABLE_NAME = 'mmocore_playerdata'" + + " AND COLUMN_NAME = 'is_saved'",(result)-> { + try { + if(!result.next()) + executeUpdate("ALTER TABLE mmocore_playerdata ADD COLUMN is_saved TINYINT"); + } catch (SQLException e) { + throw new RuntimeException(e); + } + + }); } @Override diff --git a/src/main/java/net/Indyuce/mmocore/party/provided/Party.java b/src/main/java/net/Indyuce/mmocore/party/provided/Party.java index 9bc6b2db..1bceebd8 100644 --- a/src/main/java/net/Indyuce/mmocore/party/provided/Party.java +++ b/src/main/java/net/Indyuce/mmocore/party/provided/Party.java @@ -160,6 +160,7 @@ public class Party implements AbstractParty { Request request = new PartyInvite(this, inviter, target); new ConfigMessage("party-invite").addPlaceholders("player", inviter.getPlayer().getName(), "uuid", request.getUniqueId().toString()) .sendAsJSon(target.getPlayer()); + MMOCore.plugin.requestManager.registerRequest(request); }