diff --git a/eco-api/src/main/java/com/willfp/eco/core/data/keys/PersistentDataKey.java b/eco-api/src/main/java/com/willfp/eco/core/data/keys/PersistentDataKey.java index 00f0aa8b2..13f80cacf 100644 --- a/eco-api/src/main/java/com/willfp/eco/core/data/keys/PersistentDataKey.java +++ b/eco-api/src/main/java/com/willfp/eco/core/data/keys/PersistentDataKey.java @@ -32,7 +32,7 @@ public final class PersistentDataKey { /** * If the key uses local storage. */ - private final boolean local; + private final boolean isLocal; /** * Create a new Persistent Data Key. @@ -40,16 +40,16 @@ public final class PersistentDataKey { * @param key The key. * @param type The data type. * @param defaultValue The default value. - * @param local If the key uses local storage. + * @param isLocal If the key uses local storage. */ public PersistentDataKey(@NotNull final NamespacedKey key, @NotNull final PersistentDataKeyType type, @NotNull final T defaultValue, - final boolean local) { + final boolean isLocal) { this.key = key; this.defaultValue = defaultValue; this.type = type; - this.local = local; + this.isLocal = isLocal; Eco.get().registerPersistentKey(this); } @@ -67,7 +67,7 @@ public PersistentDataKey(@NotNull final NamespacedKey key, this.key = key; this.defaultValue = defaultValue; this.type = type; - this.local = false; + this.isLocal = false; Eco.get().registerPersistentKey(this); } @@ -108,7 +108,14 @@ public PersistentDataKeyType getType() { return this.type; } - public boolean isLocalStorage() { return this.local; } + /** + * Get if the key uses local storage. + * + * @return If the key uses local storage. + */ + public boolean isLocal() { + return this.isLocal; + } /** * Get all persistent data keys. diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/internal/spigot/data/EcoProfile.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/internal/spigot/data/EcoProfile.kt index 72ba1062f..f8331604a 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/internal/spigot/data/EcoProfile.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/internal/spigot/data/EcoProfile.kt @@ -29,7 +29,7 @@ abstract class EcoProfile( return this.data[key] as T } - this.data[key] = if (key.isLocal) { + this.data[key] = if (key.isSavedLocally) { localHandler.read(uuid, key) } else { handler.read(uuid, key) @@ -104,6 +104,7 @@ class EcoServerProfile( } } -private val PersistentDataKey<*>.isLocal: Boolean - get() = this == localServerIDKey || EcoPlugin.getPlugin(this.key.namespace)?.isUsingLocalStorage == true - || this.isLocalStorage +private val PersistentDataKey<*>.isSavedLocally: Boolean + get() = this == localServerIDKey + || EcoPlugin.getPlugin(this.key.namespace)?.isUsingLocalStorage == true + || this.isLocal