forked from Upstream/mmocore
Add column SQL
This commit is contained in:
parent
7585ba243b
commit
12e8146d34
@ -79,8 +79,7 @@ public class AttributeView extends EditableInventory {
|
||||
StatInfo info = StatInfo.valueOf(buff.getStat());
|
||||
holders.register("buff_" + buff.getStat().toLowerCase(), info.format(buff.getValue()));
|
||||
holders.register("total_" + buff.getStat().toLowerCase(), info.format(buff.multiply(total).getValue()));
|
||||
Bukkit.broadcastMessage(info.format(0.34));
|
||||
Bukkit.broadcastMessage((new DecimalFormat(null)==null)+"");
|
||||
|
||||
});
|
||||
|
||||
return holders;
|
||||
|
@ -18,6 +18,7 @@ import net.Indyuce.mmocore.experience.Booster;
|
||||
import net.Indyuce.mmocore.experience.Profession;
|
||||
import net.Indyuce.mmocore.party.AbstractParty;
|
||||
import org.apache.commons.lang.Validate;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -222,6 +223,7 @@ public class PlayerStats extends EditableInventory {
|
||||
ItemStack disp = super.display(inv, n);
|
||||
if (disp.getType() == VersionMaterial.PLAYER_HEAD.toMaterial()) {
|
||||
SkullMeta meta = (SkullMeta) disp.getItemMeta();
|
||||
|
||||
inv.dynamicallyUpdateItem(this, n, disp, current -> {
|
||||
meta.setOwningPlayer(inv.getPlayer());
|
||||
current.setItemMeta(meta);
|
||||
|
@ -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, PRIMARY KEY (uuid));");//TODO
|
||||
|
||||
|
||||
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 is_saved TINYINT");
|
||||
} catch (SQLException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user