Initial commit
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
package net.crankedpvp.showcase.data;
|
||||
|
||||
import net.crankedpvp.showcase.ShowcasePlugin;
|
||||
import net.crankedpvp.storageutils.struct.NewSaveLoadManager;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
public class ShowcaseManager extends NewSaveLoadManager<UUID, ShowcasePlayer> {
|
||||
|
||||
public ShowcaseManager(ShowcasePlugin plugin) {
|
||||
super(plugin, plugin.getGson(), "/data", ShowcasePlayer.class);
|
||||
}
|
||||
|
||||
public ShowcasePlayer getShowcasePlayer(UUID uuid) {
|
||||
if (!containsKey(uuid)) {
|
||||
ShowcasePlayer showcasePlayer = new ShowcasePlayer(uuid);
|
||||
addToCache(showcasePlayer);
|
||||
}
|
||||
|
||||
return getFromCache(uuid);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String serialize(UUID uuid) {
|
||||
return String.valueOf(uuid);
|
||||
}
|
||||
|
||||
@Override
|
||||
public UUID deserialize(String s) {
|
||||
return UUID.fromString(s);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user