From ee37e9c8401a1d89ef4b235d65733d44205f0255 Mon Sep 17 00:00:00 2001 From: Oliver Date: Sat, 23 Nov 2024 11:11:56 +0100 Subject: [PATCH] new skin cache structure --- .../oliver/fancynpcs/skins/cache/SkinCache.java | 8 ++++---- .../fancynpcs/skins/cache/SkinCacheYaml.java | 17 ++++++++++++++++- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/src/main/java/de/oliver/fancynpcs/skins/cache/SkinCache.java b/src/main/java/de/oliver/fancynpcs/skins/cache/SkinCache.java index af2eb811..d1868323 100644 --- a/src/main/java/de/oliver/fancynpcs/skins/cache/SkinCache.java +++ b/src/main/java/de/oliver/fancynpcs/skins/cache/SkinCache.java @@ -1,11 +1,11 @@ package de.oliver.fancynpcs.skins.cache; -import java.util.List; - public interface SkinCache { - List load(); + SkinCacheData getSkin(String identifier); + + void addSkin(SkinCacheData skin); - void upsert(SkinCacheData skinData, boolean onlyIfExists); + void removeSkin(String identifier); } diff --git a/src/main/java/de/oliver/fancynpcs/skins/cache/SkinCacheYaml.java b/src/main/java/de/oliver/fancynpcs/skins/cache/SkinCacheYaml.java index 9f6d60fe..726a3d70 100644 --- a/src/main/java/de/oliver/fancynpcs/skins/cache/SkinCacheYaml.java +++ b/src/main/java/de/oliver/fancynpcs/skins/cache/SkinCacheYaml.java @@ -23,6 +23,22 @@ private static YamlConfiguration loadYaml() { } @Override + public SkinCacheData getSkin(String identifier) { + + return null; + } + + @Override + public void addSkin(SkinCacheData skin) { + + } + + @Override + public void removeSkin(String identifier) { + + } + + public List load() { YamlConfiguration yaml = loadYaml(); if (yaml == null) { @@ -69,7 +85,6 @@ public List load() { return cache; } - @Override public void upsert(SkinCacheData skinData, boolean onlyIfExists) { YamlConfiguration yaml = loadYaml(); if (yaml == null) {