diff --git a/pom.xml b/pom.xml index 93f871b7a..e778c8448 100644 --- a/pom.xml +++ b/pom.xml @@ -865,6 +865,14 @@ + + + org.checkerframework + checker-qual + 2.5.7 + test + + org.xerial diff --git a/src/main/java/fr/xephi/authme/data/limbo/persistence/DistributedFilesPersistenceHandler.java b/src/main/java/fr/xephi/authme/data/limbo/persistence/DistributedFilesPersistenceHandler.java index 16b919633..fee322211 100644 --- a/src/main/java/fr/xephi/authme/data/limbo/persistence/DistributedFilesPersistenceHandler.java +++ b/src/main/java/fr/xephi/authme/data/limbo/persistence/DistributedFilesPersistenceHandler.java @@ -57,7 +57,7 @@ class DistributedFilesPersistenceHandler implements LimboPersistenceHandler { @Override public LimboPlayer getLimboPlayer(Player player) { - String uuid = PlayerUtils.getUuidOrName(player); + String uuid = player.getUniqueId().toString(); File file = getPlayerSegmentFile(uuid); Map entries = readLimboPlayers(file); return entries == null ? null : entries.get(uuid); @@ -65,7 +65,7 @@ class DistributedFilesPersistenceHandler implements LimboPersistenceHandler { @Override public void saveLimboPlayer(Player player, LimboPlayer limbo) { - String uuid = PlayerUtils.getUuidOrName(player); + String uuid = player.getUniqueId().toString(); File file = getPlayerSegmentFile(uuid); Map entries = null; @@ -79,17 +79,17 @@ class DistributedFilesPersistenceHandler implements LimboPersistenceHandler { entries = new HashMap<>(); } - entries.put(PlayerUtils.getUuidOrName(player), limbo); + entries.put(uuid, limbo); saveEntries(entries, file); } @Override public void removeLimboPlayer(Player player) { - String uuid = PlayerUtils.getUuidOrName(player); + String uuid = player.getUniqueId().toString(); File file = getPlayerSegmentFile(uuid); if (file.exists()) { Map entries = readLimboPlayers(file); - if (entries != null && entries.remove(PlayerUtils.getUuidOrName(player)) != null) { + if (entries != null && entries.remove(uuid) != null) { saveEntries(entries, file); } } diff --git a/src/main/java/fr/xephi/authme/data/limbo/persistence/IndividualFilesPersistenceHandler.java b/src/main/java/fr/xephi/authme/data/limbo/persistence/IndividualFilesPersistenceHandler.java index 1ff61c835..be9948736 100644 --- a/src/main/java/fr/xephi/authme/data/limbo/persistence/IndividualFilesPersistenceHandler.java +++ b/src/main/java/fr/xephi/authme/data/limbo/persistence/IndividualFilesPersistenceHandler.java @@ -39,7 +39,7 @@ class IndividualFilesPersistenceHandler implements LimboPersistenceHandler { @Override public LimboPlayer getLimboPlayer(Player player) { - String id = PlayerUtils.getUuidOrName(player); + String id = player.getUniqueId().toString(); File file = new File(cacheDir, id + File.separator + "data.json"); if (!file.exists()) { return null; @@ -56,7 +56,7 @@ class IndividualFilesPersistenceHandler implements LimboPersistenceHandler { @Override public void saveLimboPlayer(Player player, LimboPlayer limboPlayer) { - String id = PlayerUtils.getUuidOrName(player); + String id = player.getUniqueId().toString(); try { File file = new File(cacheDir, id + File.separator + "data.json"); Files.createParentDirs(file); @@ -75,7 +75,7 @@ class IndividualFilesPersistenceHandler implements LimboPersistenceHandler { */ @Override public void removeLimboPlayer(Player player) { - String id = PlayerUtils.getUuidOrName(player); + String id = player.getUniqueId().toString(); File file = new File(cacheDir, id); if (file.exists()) { FileUtils.purgeDirectory(file);