diff --git a/docs/adr/0001-storage-layer.md b/docs/adr/0001-storage-layer.md index 087f62a26b..724039f3bb 100644 --- a/docs/adr/0001-storage-layer.md +++ b/docs/adr/0001-storage-layer.md @@ -81,7 +81,7 @@ The current plan looks like this: * We want to load player data using the new storage layer with the current data system. * We'll want to monitor for any possible issues and generally refine - how this system should look + how this system and should look * Phase 2 - Implement new experimental binary backend for [`PlayerProfile`](). * Create a new backend for binary storage * Implement in an experimental capacity and allow users to opt-in diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/storage/Storage.java b/src/main/java/io/github/thebusybiscuit/slimefun4/storage/Storage.java index 96f96b8514..037db2afc3 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/storage/Storage.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/storage/Storage.java @@ -3,13 +3,20 @@ import io.github.thebusybiscuit.slimefun4.storage.data.PlayerData; import javax.annotation.concurrent.ThreadSafe; + +import com.google.common.annotations.Beta; + import java.util.UUID; /** * The {@link Storage} interface is the abstract layer on top of our storage backends. * Every backend has to implement this interface and has to implement it in a thread-safe way. * There will be no expectation of running functions in here within the main thread. + * + *

+ * This API is still experimental, it may change without notice. */ +@Beta @ThreadSafe public interface Storage { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/storage/backend/legacy/LegacyStorage.java b/src/main/java/io/github/thebusybiscuit/slimefun4/storage/backend/legacy/LegacyStorage.java index b2d936c495..21afa54a42 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/storage/backend/legacy/LegacyStorage.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/storage/backend/legacy/LegacyStorage.java @@ -7,22 +7,27 @@ import io.github.thebusybiscuit.slimefun4.storage.data.PlayerData; import org.bukkit.NamespacedKey; +import com.google.common.annotations.Beta; + import javax.annotation.Nonnull; import java.util.HashSet; import java.util.Optional; import java.util.Set; import java.util.UUID; +@Beta public class LegacyStorage implements Storage { @Override public PlayerData loadPlayerData(@Nonnull UUID uuid) { - Config file = new Config("data-storage/Slimefun/Players/" + uuid + ".yml"); + Config playerFile = new Config("data-storage/Slimefun/Players/" + uuid + ".yml"); + // Not too sure why this is it's own file + Config waypointFile = new Config("data-storage/Slimefun/waypoints/" + uuid + ".yml"); Set researches = new HashSet<>(); for (Research research : Slimefun.getRegistry().getResearches()) { - if (file.contains("researches." + research.getID())) { + if (playerFile.contains("researches." + research.getID())) { researches.add(research.getKey()); } }