1
0
mirror of https://github.com/lucko/LuckPerms.git synced 2025-09-03 03:12:46 +02:00

Implement locks to hopefully resolve race conditions with I/O - experimental

This commit is contained in:
Luck
2016-10-01 19:03:05 +01:00
parent b5ece8b5bd
commit 4787361e66
22 changed files with 1159 additions and 878 deletions

View File

@@ -24,8 +24,6 @@ package me.lucko.luckperms.users;
import me.lucko.luckperms.LuckPermsPlugin;
import java.util.UUID;
public class StandaloneUserManager extends UserManager {
private final LuckPermsPlugin plugin;
@@ -41,13 +39,12 @@ public class StandaloneUserManager extends UserManager {
}
@Override
public User make(UUID id) {
return new StandaloneUser(id, plugin);
}
@Override
public User make(UUID uuid, String username) {
return new StandaloneUser(uuid, username, plugin);
public User apply(UserIdentifier id) {
StandaloneUser user = id.getUsername() == null ?
new StandaloneUser(id.getUuid(), plugin) :
new StandaloneUser(id.getUuid(), id.getUsername(), plugin);
giveDefaultIfNeeded(user, false);
return user;
}
@Override