mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-25 22:56:45 +01:00
Use own database to grab uuids instead (?)
This commit is contained in:
parent
52a41b7458
commit
626d967b7c
@ -21,13 +21,13 @@ import com.gmail.nossr50.datatypes.party.Party;
|
|||||||
import com.gmail.nossr50.datatypes.party.PartyLeader;
|
import com.gmail.nossr50.datatypes.party.PartyLeader;
|
||||||
import com.gmail.nossr50.datatypes.party.ShareMode;
|
import com.gmail.nossr50.datatypes.party.ShareMode;
|
||||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||||
|
import com.gmail.nossr50.datatypes.player.PlayerProfile;
|
||||||
import com.gmail.nossr50.events.party.McMMOPartyAllianceChangeEvent;
|
import com.gmail.nossr50.events.party.McMMOPartyAllianceChangeEvent;
|
||||||
import com.gmail.nossr50.events.party.McMMOPartyChangeEvent;
|
import com.gmail.nossr50.events.party.McMMOPartyChangeEvent;
|
||||||
import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason;
|
import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason;
|
||||||
import com.gmail.nossr50.locale.LocaleLoader;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.util.Misc;
|
import com.gmail.nossr50.util.Misc;
|
||||||
import com.gmail.nossr50.util.player.UserManager;
|
import com.gmail.nossr50.util.player.UserManager;
|
||||||
import com.gmail.nossr50.util.uuid.UUIDFetcher;
|
|
||||||
|
|
||||||
public final class PartyManager {
|
public final class PartyManager {
|
||||||
private static String partiesFilePath = mcMMO.getFlatFileDirectory() + "parties.yml";
|
private static String partiesFilePath = mcMMO.getFlatFileDirectory() + "parties.yml";
|
||||||
@ -620,19 +620,15 @@ public final class PartyManager {
|
|||||||
Party party = new Party(partyName);
|
Party party = new Party(partyName);
|
||||||
|
|
||||||
String leaderName = partiesFile.getString(partyName + ".Leader");
|
String leaderName = partiesFile.getString(partyName + ".Leader");
|
||||||
|
PlayerProfile profile = mcMMO.getDatabaseManager().loadPlayerProfile(leaderName, false);
|
||||||
|
|
||||||
UUID leaderUniqueId = null;
|
if (!profile.isLoaded()) {
|
||||||
try {
|
mcMMO.p.getLogger().warning("Could not find UUID in database for party leader " + leaderName + " in party " + partyName);
|
||||||
leaderUniqueId = UUIDFetcher.getUUIDOf(leaderName);
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (leaderUniqueId == null) {
|
|
||||||
mcMMO.p.getLogger().warning("Could not fetch UUID for party leader " + leaderName + " in party " + partyName);
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UUID leaderUniqueId = profile.getUniqueId();
|
||||||
|
|
||||||
party.setLeader(new PartyLeader(leaderUniqueId, leaderName));
|
party.setLeader(new PartyLeader(leaderUniqueId, leaderName));
|
||||||
party.setPassword(partiesFile.getString(partyName + ".Password"));
|
party.setPassword(partiesFile.getString(partyName + ".Password"));
|
||||||
party.setLocked(partiesFile.getBoolean(partyName + ".Locked"));
|
party.setLocked(partiesFile.getBoolean(partyName + ".Locked"));
|
||||||
@ -653,19 +649,15 @@ public final class PartyManager {
|
|||||||
LinkedHashMap<UUID, String> members = party.getMembers();
|
LinkedHashMap<UUID, String> members = party.getMembers();
|
||||||
|
|
||||||
for (String memberName : partiesFile.getStringList(partyName + ".Members")) {
|
for (String memberName : partiesFile.getStringList(partyName + ".Members")) {
|
||||||
UUID memberUniqueId = null;
|
PlayerProfile memberProfile = mcMMO.getDatabaseManager().loadPlayerProfile(memberName, false);
|
||||||
|
|
||||||
try {
|
if (!memberProfile.isLoaded()) {
|
||||||
memberUniqueId = UUIDFetcher.getUUIDOf(memberName);
|
mcMMO.p.getLogger().warning("Could not find UUID in database for party member " + memberName + " in party " + partyName);
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (memberUniqueId == null) {
|
|
||||||
mcMMO.p.getLogger().warning("Could not fetch UUID for party member " + memberName + " in party " + partyName);
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UUID memberUniqueId = memberProfile.getUniqueId();
|
||||||
|
|
||||||
members.put(memberUniqueId, memberName);
|
members.put(memberUniqueId, memberName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user