mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-25 22:56:45 +01:00
Fix database loading data for wrong player
This commit is contained in:
parent
7da661546f
commit
fbcbfa8e86
@ -470,8 +470,22 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
|
||||
// Find if the line contains the player we want.
|
||||
String[] character = line.split(":");
|
||||
|
||||
if ((uuid != null && (!character[41].equalsIgnoreCase(uuid.toString()) && !character[41].equalsIgnoreCase("NULL"))) || (uuid == null && !character[0].equalsIgnoreCase(playerName))) {
|
||||
continue;
|
||||
if (character[41].equalsIgnoreCase("NULL")) {
|
||||
//compare names because we don't have a valid uuid for that player even if input uuid is not null
|
||||
if (!character[0].equalsIgnoreCase(playerName)) {
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
//if input uuid is not null then we should compare uuids
|
||||
if (uuid != null) {
|
||||
if (!character[41].equalsIgnoreCase(uuid.toString()) {
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
if (!character[0].equalsIgnoreCase(playerName)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Update playerName in database after name change
|
||||
|
Loading…
Reference in New Issue
Block a user