mirror of
https://github.com/SimplexDevelopment/Traverse.git
synced 2025-07-12 11:48:34 +00:00
75% completion
This commit is contained in:
@ -5,6 +5,7 @@ import mc.unraveled.reforged.api.Baker;
|
||||
import mc.unraveled.reforged.api.Locker;
|
||||
import mc.unraveled.reforged.plugin.Traverse;
|
||||
import mc.unraveled.reforged.storage.DBUser;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.HashSet;
|
||||
@ -42,6 +43,13 @@ public final class DataManager implements Baker, Locker {
|
||||
.orElse(null);
|
||||
}
|
||||
|
||||
public void updatePlayer(UUID uuid, PlayerData data) {
|
||||
if (baked) throw new IllegalStateException("Cannot update player data while the data manager is baked.");
|
||||
|
||||
playerDataCache.removeIf(playerData -> playerData.getUuid().equals(uuid));
|
||||
playerDataCache.add(data);
|
||||
}
|
||||
|
||||
public void addPlayerData(PlayerData data) {
|
||||
if (baked) throw new IllegalStateException("Cannot add player data while the data manager is baked.");
|
||||
|
||||
|
Reference in New Issue
Block a user