Fixed a loading issue

This commit is contained in:
Indyuce 2020-04-28 18:28:53 +02:00
parent c48b1df43e
commit f44da7456a
3 changed files with 17 additions and 2 deletions

View File

@ -52,6 +52,8 @@ import net.Indyuce.mmocore.listener.SpellCast.SkillCasting;
import net.md_5.bungee.api.ChatMessageType; import net.md_5.bungee.api.ChatMessageType;
import net.md_5.bungee.api.chat.TextComponent; import net.md_5.bungee.api.chat.TextComponent;
import net.mmogroup.mmolib.MMOLib; import net.mmogroup.mmolib.MMOLib;
import net.mmogroup.mmolib.api.player.MMOData;
import net.mmogroup.mmolib.api.stat.StatMap;
import net.mmogroup.mmolib.version.VersionSound; import net.mmogroup.mmolib.version.VersionSound;
public class PlayerData extends OfflinePlayerData { public class PlayerData extends OfflinePlayerData {
@ -112,8 +114,8 @@ public class PlayerData extends OfflinePlayerData {
private PlayerData() { private PlayerData() {
super(UUID.randomUUID()); super(UUID.randomUUID());
playerStats = new PlayerStats(this); playerStats = new PlayerStats(this, new StatMap(new MMOData().setMMOCore(this)));
questData = new PlayerQuests(this); questData = new PlayerQuests(this, null);
} }
/* /*

View File

@ -19,6 +19,12 @@ public class PlayerStats {
map = MMOData.get(data.getPlayer()).setMMOCore(data).getStatMap(); map = MMOData.get(data.getPlayer()).setMMOCore(data).getStatMap();
} }
@Deprecated
public PlayerStats(PlayerData data, StatMap map) {
this.data = data;
this.map = map;
}
public PlayerData getData() { public PlayerData getData() {
return data; return data;
} }

View File

@ -31,10 +31,17 @@ public class PlayerQuests {
public PlayerQuests(PlayerData playerData) { public PlayerQuests(PlayerData playerData) {
this.playerData = playerData; this.playerData = playerData;
bossbar = MMOLib.plugin.getVersion().getWrapper().createBossBar(new NamespacedKey(MMOCore.plugin, "quest_bar_" + playerData.getUniqueId().toString()), "", BarColor.PURPLE, BarStyle.SEGMENTED_20, new BarFlag[0]); bossbar = MMOLib.plugin.getVersion().getWrapper().createBossBar(new NamespacedKey(MMOCore.plugin, "quest_bar_" + playerData.getUniqueId().toString()), "", BarColor.PURPLE, BarStyle.SEGMENTED_20, new BarFlag[0]);
bossbar.addPlayer(playerData.getPlayer()); bossbar.addPlayer(playerData.getPlayer());
} }
@Deprecated
public PlayerQuests(PlayerData playerData, BossBar bar) {
this.playerData = playerData;
this.bossbar = bar;
}
public PlayerQuests load(ConfigurationSection config) { public PlayerQuests load(ConfigurationSection config) {
if (config.contains("current")) if (config.contains("current"))
try { try {