diff --git a/src/main/java/com/gmail/nossr50/datatypes/player/McMMOPlayer.java b/src/main/java/com/gmail/nossr50/datatypes/player/McMMOPlayer.java index 4f8bcf019..013b7521a 100644 --- a/src/main/java/com/gmail/nossr50/datatypes/player/McMMOPlayer.java +++ b/src/main/java/com/gmail/nossr50/datatypes/player/McMMOPlayer.java @@ -101,12 +101,6 @@ public class McMMOPlayer { this.player = player; playerMetadata = new FixedMetadataValue(mcMMO.p, playerName); this.profile = profile; - party = PartyManager.getPlayerParty(playerName, uuid); - ptpRecord = new PartyTeleportRecord(); - - if (inParty()) { - loginParty(); - } if (profile.getUniqueId() == null) { profile.setUniqueId(uuid); @@ -532,6 +526,15 @@ public class McMMOPlayer { * Party Stuff */ + public void setupPartyData() { + party = PartyManager.getPlayerParty(player.getName(), player.getUniqueId()); + ptpRecord = new PartyTeleportRecord(); + + if (inParty()) { + loginParty(); + } + } + public void setPartyInvite(Party invite) { this.invite = invite; } diff --git a/src/main/java/com/gmail/nossr50/runnables/player/PlayerProfileLoadingTask.java b/src/main/java/com/gmail/nossr50/runnables/player/PlayerProfileLoadingTask.java index 75d3c64bf..811d6cfb0 100644 --- a/src/main/java/com/gmail/nossr50/runnables/player/PlayerProfileLoadingTask.java +++ b/src/main/java/com/gmail/nossr50/runnables/player/PlayerProfileLoadingTask.java @@ -44,7 +44,7 @@ public class PlayerProfileLoadingTask extends BukkitRunnable { PlayerProfile profile = mcMMO.getDatabaseManager().loadPlayerProfile(player.getName(), player.getUniqueId(), true); // If successful, schedule the apply if (profile.isLoaded()) { - new ApplySuccessfulProfile(profile).runTask(mcMMO.p); + new ApplySuccessfulProfile(new McMMOPlayer(player, profile)).runTask(mcMMO.p); return; } @@ -59,10 +59,10 @@ public class PlayerProfileLoadingTask extends BukkitRunnable { } private class ApplySuccessfulProfile extends BukkitRunnable { - private final PlayerProfile profile; + private final McMMOPlayer mcMMOPlayer; - private ApplySuccessfulProfile(PlayerProfile profile) { - this.profile = profile; + private ApplySuccessfulProfile(McMMOPlayer mcMMOPlayer) { + this.mcMMOPlayer = mcMMOPlayer; } // Synchronized task @@ -74,7 +74,7 @@ public class PlayerProfileLoadingTask extends BukkitRunnable { return; } - McMMOPlayer mcMMOPlayer = new McMMOPlayer(player, profile); + mcMMOPlayer.setupPartyData(); UserManager.track(mcMMOPlayer); mcMMOPlayer.actualizeRespawnATS(); ScoreboardManager.setupPlayer(player);