23 lines
759 B
Java
23 lines
759 B
Java
package net.crankedpvp.chattitles.data;
|
|
|
|
import net.crankedpvp.chattitles.ChatTitlesPlugin;
|
|
import net.crankedpvp.storageutils.StorageUtils;
|
|
import net.crankedpvp.storageutils.utils.SaveLoadManager;
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.UUID;
|
|
|
|
public class TitlePlayerManager extends SaveLoadManager<TitlePlayer> {
|
|
public TitlePlayerManager(ChatTitlesPlugin plugin) {
|
|
super(plugin, StorageUtils.getInstance().getGson(), "data/", TitlePlayer.class);
|
|
}
|
|
|
|
public TitlePlayer getTitlePlayer(UUID uuid) {
|
|
if (!containsKey(uuid.toString())) {
|
|
TitlePlayer titlePlayer = new TitlePlayer(uuid, new ArrayList<>(), null);
|
|
addToCache(titlePlayer);
|
|
}
|
|
return getFromCache(uuid.toString());
|
|
}
|
|
}
|