Fix build

This commit is contained in:
Gabriele C 2018-11-30 14:47:08 +01:00
parent 92493e826c
commit d89f8e0e66
3 changed files with 16 additions and 8 deletions

View File

@ -865,6 +865,14 @@
</exclusions>
</dependency>
<!-- Required to mock the LuckPerms API-->
<dependency>
<groupId>org.checkerframework</groupId>
<artifactId>checker-qual</artifactId>
<version>2.5.7</version>
<scope>test</scope>
</dependency>
<!-- JDBC drivers for datasource integration tests -->
<dependency>
<groupId>org.xerial</groupId>

View File

@ -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<String, LimboPlayer> 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<String, LimboPlayer> 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<String, LimboPlayer> entries = readLimboPlayers(file);
if (entries != null && entries.remove(PlayerUtils.getUuidOrName(player)) != null) {
if (entries != null && entries.remove(uuid) != null) {
saveEntries(entries, file);
}
}

View File

@ -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);