Skip to content

Commit

Permalink
Fixed players with UUID 0 can exist (#1548)
Browse files Browse the repository at this point in the history
  • Loading branch information
OmerBenGera committed Jan 14, 2023
1 parent 19fa671 commit 1cfe456
Showing 1 changed file with 6 additions and 0 deletions.
Expand Up @@ -35,6 +35,7 @@
@SuppressWarnings("WeakerAccess")
public class DataManager extends Manager {

private static final UUID CONSOLE_UUID = new UUID(0, 0);
private final List<DatabaseLoader> databaseLoaders = new LinkedList<>();

public DataManager(SuperiorSkyblockPlugin plugin) {
Expand Down Expand Up @@ -128,6 +129,11 @@ private void loadPlayers() {
return;
}

if (uuid.get().equals(CONSOLE_UUID)) {
Log.warn("Cannot load player with uuid 0 (it is reserved to CONSOLE), skipping...");
return;
}

plugin.getPlayers().getPlayersContainer().addPlayer(databaseCache.computeIfAbsentInfo(uuid.get(), SuperiorPlayer::newBuilder)
.setUniqueId(uuid.get())
.setName(databaseResult.getString("last_used_name").orElse("null"))
Expand Down

0 comments on commit 1cfe456

Please sign in to comment.