diff --git a/eco-api/src/main/java/com/willfp/eco/core/Eco.java b/eco-api/src/main/java/com/willfp/eco/core/Eco.java index a638899a..f6fd7cb6 100644 --- a/eco-api/src/main/java/com/willfp/eco/core/Eco.java +++ b/eco-api/src/main/java/com/willfp/eco/core/Eco.java @@ -4,6 +4,12 @@ import org.apache.commons.lang.Validate; import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + /** * Holds the instance of the eco handler for bridging between the frontend * and backend. @@ -52,6 +58,24 @@ public final class Eco { return handler; } + /** + * Eco Handler components are internals, so if a class is marked as a handler component, + * then it should be treated the same as if it was marked with {@link ApiStatus.Internal}. + *

+ * If a class is marked with {@link HandlerComponent}, Do not reference it in + * your code! It can and will contain breaking changes between minor versions and + * even patches, and you will create compatibility issues by using them. + *

+ * Handler components should also be marked with {@link ApiStatus.Internal} in order to + * cause compiler / IDE warnings. + */ + @Documented + @Retention(RetentionPolicy.CLASS) + @Target({ElementType.TYPE}) + public @interface HandlerComponent { + + } + private Eco() { throw new UnsupportedOperationException("This is a utility class and cannot be instantiated"); } diff --git a/eco-api/src/main/java/com/willfp/eco/core/Handler.java b/eco-api/src/main/java/com/willfp/eco/core/Handler.java index 69fbfd01..2266aef5 100644 --- a/eco-api/src/main/java/com/willfp/eco/core/Handler.java +++ b/eco-api/src/main/java/com/willfp/eco/core/Handler.java @@ -2,7 +2,7 @@ package com.willfp.eco.core; import com.willfp.eco.core.config.updating.ConfigHandler; import com.willfp.eco.core.config.wrapper.ConfigFactory; -import com.willfp.eco.core.data.PlayerProfileHandler; +import com.willfp.eco.core.data.ProfileHandler; import com.willfp.eco.core.data.keys.KeyRegistry; import com.willfp.eco.core.drops.DropQueueFactory; import com.willfp.eco.core.events.EventManager; @@ -234,7 +234,7 @@ public interface Handler { * @return The handler. */ @NotNull - PlayerProfileHandler getPlayerProfileHandler(); + ProfileHandler getProfileHandler(); /** * Create dummy entity - never spawned, exists purely in code. diff --git a/eco-api/src/main/java/com/willfp/eco/core/config/wrapper/ConfigFactory.java b/eco-api/src/main/java/com/willfp/eco/core/config/wrapper/ConfigFactory.java index fffb7f99..608a6a71 100644 --- a/eco-api/src/main/java/com/willfp/eco/core/config/wrapper/ConfigFactory.java +++ b/eco-api/src/main/java/com/willfp/eco/core/config/wrapper/ConfigFactory.java @@ -1,5 +1,6 @@ package com.willfp.eco.core.config.wrapper; +import com.willfp.eco.core.Eco; import com.willfp.eco.core.PluginLike; import com.willfp.eco.core.config.ConfigType; import com.willfp.eco.core.config.interfaces.Config; @@ -14,6 +15,7 @@ import java.util.Map; * Internal component to create backend config implementations. */ @ApiStatus.Internal +@Eco.HandlerComponent public interface ConfigFactory { /** * Updatable config. diff --git a/eco-api/src/main/java/com/willfp/eco/core/data/PlayerProfile.java b/eco-api/src/main/java/com/willfp/eco/core/data/PlayerProfile.java index 0cd6f260..465a2495 100644 --- a/eco-api/src/main/java/com/willfp/eco/core/data/PlayerProfile.java +++ b/eco-api/src/main/java/com/willfp/eco/core/data/PlayerProfile.java @@ -1,7 +1,6 @@ package com.willfp.eco.core.data; import com.willfp.eco.core.Eco; -import com.willfp.eco.core.data.keys.PersistentDataKey; import org.bukkit.OfflinePlayer; import org.jetbrains.annotations.NotNull; @@ -12,26 +11,7 @@ import java.util.UUID; *

* Profiles save automatically, so there is no need to save after changes. */ -public interface PlayerProfile { - /** - * Write a key to a player's persistent data. - * - * @param key The key. - * @param value The value. - * @param The type of the key. - */ - void write(@NotNull PersistentDataKey key, - @NotNull T value); - - /** - * Read a key from a player's persistent data. - * - * @param key The key. - * @param The type of the key. - * @return The value, or the default value if not found. - */ - @NotNull T read(@NotNull PersistentDataKey key); - +public interface PlayerProfile extends Profile { /** * Load a player profile. * @@ -51,6 +31,6 @@ public interface PlayerProfile { */ @NotNull static PlayerProfile load(@NotNull final UUID uuid) { - return Eco.getHandler().getPlayerProfileHandler().load(uuid); + return Eco.getHandler().getProfileHandler().load(uuid); } } diff --git a/eco-api/src/main/java/com/willfp/eco/core/data/Profile.java b/eco-api/src/main/java/com/willfp/eco/core/data/Profile.java new file mode 100644 index 00000000..e6996e9f --- /dev/null +++ b/eco-api/src/main/java/com/willfp/eco/core/data/Profile.java @@ -0,0 +1,30 @@ +package com.willfp.eco.core.data; + +import com.willfp.eco.core.data.keys.PersistentDataKey; +import org.jetbrains.annotations.NotNull; + +/** + * Persistent data storage interface. + *

+ * Profiles save automatically, so there is no need to save after changes. + */ +public interface Profile { + /** + * Write a key to persistent data. + * + * @param key The key. + * @param value The value. + * @param The type of the key. + */ + void write(@NotNull PersistentDataKey key, + @NotNull T value); + + /** + * Read a key from persistent data. + * + * @param key The key. + * @param The type of the key. + * @return The value, or the default value if not found. + */ + @NotNull T read(@NotNull PersistentDataKey key); +} diff --git a/eco-api/src/main/java/com/willfp/eco/core/data/PlayerProfileHandler.java b/eco-api/src/main/java/com/willfp/eco/core/data/ProfileHandler.java similarity index 85% rename from eco-api/src/main/java/com/willfp/eco/core/data/PlayerProfileHandler.java rename to eco-api/src/main/java/com/willfp/eco/core/data/ProfileHandler.java index 41ffb9fe..2db157ae 100644 --- a/eco-api/src/main/java/com/willfp/eco/core/data/PlayerProfileHandler.java +++ b/eco-api/src/main/java/com/willfp/eco/core/data/ProfileHandler.java @@ -1,15 +1,19 @@ package com.willfp.eco.core.data; +import com.willfp.eco.core.Eco; import com.willfp.eco.core.data.keys.PersistentDataKey; +import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; import java.util.Set; import java.util.UUID; /** - * API to handle player profiles. + * API to handle profiles. */ -public interface PlayerProfileHandler { +@ApiStatus.Internal +@Eco.HandlerComponent +public interface ProfileHandler { /** * Load a player profile. * @@ -18,6 +22,13 @@ public interface PlayerProfileHandler { */ PlayerProfile load(@NotNull UUID uuid); + /** + * Load the server profile. + * + * @return The profile. + */ + ServerProfile loadServerProfile(); + /** * Unload a player profile from memory. *

diff --git a/eco-api/src/main/java/com/willfp/eco/core/data/ServerProfile.java b/eco-api/src/main/java/com/willfp/eco/core/data/ServerProfile.java new file mode 100644 index 00000000..c976bdd3 --- /dev/null +++ b/eco-api/src/main/java/com/willfp/eco/core/data/ServerProfile.java @@ -0,0 +1,21 @@ +package com.willfp.eco.core.data; + +import com.willfp.eco.core.Eco; +import org.jetbrains.annotations.NotNull; + +/** + * Persistent data storage interface for servers. + *

+ * Profiles save automatically, so there is no need to save after changes. + */ +public interface ServerProfile extends Profile { + /** + * Load the server profile. + * + * @return The profile. + */ + @NotNull + static ServerProfile load() { + return Eco.getHandler().getProfileHandler().loadServerProfile(); + } +} diff --git a/eco-api/src/main/java/com/willfp/eco/core/display/DisplayHandler.java b/eco-api/src/main/java/com/willfp/eco/core/display/DisplayHandler.java index eeaa29f7..60976fb3 100644 --- a/eco-api/src/main/java/com/willfp/eco/core/display/DisplayHandler.java +++ b/eco-api/src/main/java/com/willfp/eco/core/display/DisplayHandler.java @@ -1,13 +1,17 @@ package com.willfp.eco.core.display; +import com.willfp.eco.core.Eco; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; +import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; /** * Interface for display implementations. */ +@ApiStatus.Internal +@Eco.HandlerComponent public interface DisplayHandler { /** * Register display module. diff --git a/eco-api/src/main/java/com/willfp/eco/core/drops/DropQueueFactory.java b/eco-api/src/main/java/com/willfp/eco/core/drops/DropQueueFactory.java index be27a035..4e19b70b 100644 --- a/eco-api/src/main/java/com/willfp/eco/core/drops/DropQueueFactory.java +++ b/eco-api/src/main/java/com/willfp/eco/core/drops/DropQueueFactory.java @@ -1,11 +1,15 @@ package com.willfp.eco.core.drops; +import com.willfp.eco.core.Eco; import org.bukkit.entity.Player; +import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; /** * Internal component to create backend DropQueue implementations. */ +@ApiStatus.Internal +@Eco.HandlerComponent public interface DropQueueFactory { /** * Create a DropQueue. diff --git a/eco-api/src/main/java/com/willfp/eco/core/drops/InternalDropQueue.java b/eco-api/src/main/java/com/willfp/eco/core/drops/InternalDropQueue.java index 4b563ad4..8b8d51b2 100644 --- a/eco-api/src/main/java/com/willfp/eco/core/drops/InternalDropQueue.java +++ b/eco-api/src/main/java/com/willfp/eco/core/drops/InternalDropQueue.java @@ -1,7 +1,9 @@ package com.willfp.eco.core.drops; +import com.willfp.eco.core.Eco; import org.bukkit.Location; import org.bukkit.inventory.ItemStack; +import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; import java.util.Collection; @@ -9,6 +11,8 @@ import java.util.Collection; /** * Internal interface for backend DropQueue implementations. */ +@ApiStatus.Internal +@Eco.HandlerComponent public interface InternalDropQueue { /** * Add item to queue. diff --git a/eco-api/src/main/java/com/willfp/eco/core/gui/GUIFactory.java b/eco-api/src/main/java/com/willfp/eco/core/gui/GUIFactory.java index 7ca7d83e..6f7ad705 100644 --- a/eco-api/src/main/java/com/willfp/eco/core/gui/GUIFactory.java +++ b/eco-api/src/main/java/com/willfp/eco/core/gui/GUIFactory.java @@ -1,15 +1,19 @@ package com.willfp.eco.core.gui; +import com.willfp.eco.core.Eco; import com.willfp.eco.core.gui.menu.MenuBuilder; import com.willfp.eco.core.gui.slot.SlotBuilder; import com.willfp.eco.core.gui.slot.functional.SlotProvider; import org.bukkit.inventory.ItemStack; +import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; /** * Internal component used by {@link com.willfp.eco.core.gui.menu.Menu#builder(int)} * and {@link com.willfp.eco.core.gui.slot.Slot#builder(ItemStack)}. */ +@ApiStatus.Internal +@Eco.HandlerComponent public interface GUIFactory { /** * Create slot builder. diff --git a/eco-api/src/main/java/com/willfp/eco/core/requirement/RequirementFactory.java b/eco-api/src/main/java/com/willfp/eco/core/requirement/RequirementFactory.java index 7210ed3e..66173ec8 100644 --- a/eco-api/src/main/java/com/willfp/eco/core/requirement/RequirementFactory.java +++ b/eco-api/src/main/java/com/willfp/eco/core/requirement/RequirementFactory.java @@ -1,10 +1,14 @@ package com.willfp.eco.core.requirement; +import com.willfp.eco.core.Eco; +import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; /** * Interface for internal requirement factory implementations. */ +@ApiStatus.Internal +@Eco.HandlerComponent public interface RequirementFactory { /** * Create a requirement. diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/internal/spigot/EcoHandler.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/internal/spigot/EcoHandler.kt index e8ddea79..6e434a2d 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/internal/spigot/EcoHandler.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/internal/spigot/EcoHandler.kt @@ -24,7 +24,7 @@ import com.willfp.eco.internal.proxy.EcoProxyFactory import com.willfp.eco.internal.requirement.EcoRequirementFactory import com.willfp.eco.internal.scheduling.EcoScheduler import com.willfp.eco.internal.spigot.data.EcoKeyRegistry -import com.willfp.eco.internal.spigot.data.EcoPlayerProfileHandler +import com.willfp.eco.internal.spigot.data.EcoProfileHandler import com.willfp.eco.internal.spigot.data.storage.MySQLDataHandler import com.willfp.eco.internal.spigot.data.storage.YamlDataHandler import com.willfp.eco.internal.spigot.integrations.bstats.MetricHandler @@ -43,7 +43,7 @@ class EcoHandler : EcoSpigotPlugin(), Handler { private val requirementFactory = EcoRequirementFactory() private var adventure: BukkitAudiences? = null private val keyRegistry = EcoKeyRegistry(this) - private val playerProfileHandler = EcoPlayerProfileHandler( + private val playerProfileHandler = EcoProfileHandler( if (this.configYml.getBool("mysql.enabled")) MySQLDataHandler(this) else YamlDataHandler(this) ) @@ -145,7 +145,7 @@ class EcoHandler : EcoSpigotPlugin(), Handler { return keyRegistry } - override fun getPlayerProfileHandler(): EcoPlayerProfileHandler { + override fun getProfileHandler(): EcoProfileHandler { return playerProfileHandler } diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/internal/spigot/EcoSpigotPlugin.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/internal/spigot/EcoSpigotPlugin.kt index e28bcf2e..a8c9c557 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/internal/spigot/EcoSpigotPlugin.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/internal/spigot/EcoSpigotPlugin.kt @@ -194,7 +194,7 @@ abstract class EcoSpigotPlugin : EcoPlugin( override fun handleDisable() { this.logger.info("Saving player data...") val start = System.currentTimeMillis() - Eco.getHandler().playerProfileHandler.save() + Eco.getHandler().profileHandler.save() this.logger.info("Saved player data! Took ${System.currentTimeMillis() - start}ms") Eco.getHandler().adventure?.close() } diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/internal/spigot/data/DataListener.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/internal/spigot/data/DataListener.kt index d1f774cd..03132f1d 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/internal/spigot/data/DataListener.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/internal/spigot/data/DataListener.kt @@ -15,7 +15,7 @@ class DataListener( ) : Listener { @EventHandler(priority = EventPriority.HIGHEST) fun onLeave(event: PlayerQuitEvent) { - Eco.getHandler().playerProfileHandler.unloadPlayer(event.player.uniqueId) + Eco.getHandler().profileHandler.unloadPlayer(event.player.uniqueId) } @EventHandler @@ -27,6 +27,6 @@ class DataListener( @EventHandler(priority = EventPriority.LOWEST) fun onLogin(event: PlayerLoginEvent) { - Eco.getHandler().playerProfileHandler.unloadPlayer(event.player.uniqueId) + Eco.getHandler().profileHandler.unloadPlayer(event.player.uniqueId) } } diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/internal/spigot/data/EcoKeyRegistry.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/internal/spigot/data/EcoKeyRegistry.kt index 5bfb1b45..05c76fcc 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/internal/spigot/data/EcoKeyRegistry.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/internal/spigot/data/EcoKeyRegistry.kt @@ -21,7 +21,7 @@ class EcoKeyRegistry( this.registry[key.key] = key - (Eco.getHandler().playerProfileHandler as EcoPlayerProfileHandler).updateKeys() + (Eco.getHandler().profileHandler as EcoProfileHandler).updateKeys() } override fun getRegisteredKeys(): MutableSet> { diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/internal/spigot/data/EcoPlayerProfile.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/internal/spigot/data/EcoPlayerProfile.kt index 2e96e997..ed7dac9d 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/internal/spigot/data/EcoPlayerProfile.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/internal/spigot/data/EcoPlayerProfile.kt @@ -1,51 +1,6 @@ package com.willfp.eco.internal.spigot.data -import com.willfp.eco.core.data.PlayerProfile import com.willfp.eco.core.data.keys.PersistentDataKey import com.willfp.eco.internal.spigot.data.storage.DataHandler import java.util.UUID -import java.util.concurrent.ConcurrentHashMap -class EcoPlayerProfile( - val data: MutableMap, Any>, - val uuid: UUID, - private val handler: DataHandler -) : PlayerProfile { - override fun write(key: PersistentDataKey, value: T) { - this.data[key] = value - - val changedKeys = CHANGE_MAP[uuid] ?: mutableSetOf() - changedKeys.add(key) - CHANGE_MAP[uuid] = changedKeys - } - - override fun read(key: PersistentDataKey): T { - @Suppress("UNCHECKED_CAST") - if (this.data.containsKey(key)) { - return this.data[key] as T - } - - this.data[key] = handler.read(uuid, key.key) ?: key.defaultValue - return read(key) - } - - override fun equals(other: Any?): Boolean { - if (other !is EcoPlayerProfile) { - return false - } - - return this.data == other.data - } - - override fun hashCode(): Int { - return data.hashCode() - } - - override fun toString(): String { - return "EcoPlayerProfile{$data}" - } - - companion object { - val CHANGE_MAP: MutableMap>> = ConcurrentHashMap() - } -} \ No newline at end of file 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 new file mode 100644 index 00000000..9b937f5e --- /dev/null +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/internal/spigot/data/EcoProfile.kt @@ -0,0 +1,58 @@ +package com.willfp.eco.internal.spigot.data + +import com.willfp.eco.core.data.PlayerProfile +import com.willfp.eco.core.data.keys.PersistentDataKey +import com.willfp.eco.internal.spigot.data.storage.DataHandler +import java.util.UUID +import java.util.concurrent.ConcurrentHashMap + +abstract class EcoProfile( + val data: MutableMap, Any>, + val uuid: UUID, + private val handler: DataHandler +) : PlayerProfile { + override fun write(key: PersistentDataKey, value: T) { + this.data[key] = value + + val changedKeys = CHANGE_MAP[uuid] ?: mutableSetOf() + changedKeys.add(key) + CHANGE_MAP[uuid] = changedKeys + } + + override fun read(key: PersistentDataKey): T { + @Suppress("UNCHECKED_CAST") + if (this.data.containsKey(key)) { + return this.data[key] as T + } + + this.data[key] = handler.read(uuid, key.key) ?: key.defaultValue + return read(key) + } + + override fun equals(other: Any?): Boolean { + if (other !is EcoProfile) { + return false + } + + return this.data == other.data && this.uuid == other.uuid + } + + override fun hashCode(): Int { + return this.data.hashCode() + } + + companion object { + val CHANGE_MAP: MutableMap>> = ConcurrentHashMap() + } +} + +class EcoPlayerProfile( + data: MutableMap, Any>, + uuid: UUID, + handler: DataHandler +) : EcoProfile(data, uuid, handler) + +class EcoServerProfile( + data: MutableMap, Any>, + handler: DataHandler +) : EcoProfile(data, serverProfileUUID, handler) \ No newline at end of file diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/internal/spigot/data/EcoPlayerProfileHandler.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/internal/spigot/data/EcoProfileHandler.kt similarity index 54% rename from eco-core/core-plugin/src/main/kotlin/com/willfp/eco/internal/spigot/data/EcoPlayerProfileHandler.kt rename to eco-core/core-plugin/src/main/kotlin/com/willfp/eco/internal/spigot/data/EcoProfileHandler.kt index a1dd46d8..da7203b9 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/internal/spigot/data/EcoPlayerProfileHandler.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/internal/spigot/data/EcoProfileHandler.kt @@ -1,17 +1,21 @@ package com.willfp.eco.internal.spigot.data import com.willfp.eco.core.data.PlayerProfile -import com.willfp.eco.core.data.PlayerProfileHandler +import com.willfp.eco.core.data.Profile +import com.willfp.eco.core.data.ProfileHandler +import com.willfp.eco.core.data.ServerProfile import com.willfp.eco.core.data.keys.PersistentDataKey import com.willfp.eco.internal.spigot.data.storage.DataHandler import java.util.UUID -class EcoPlayerProfileHandler( - private val handler: DataHandler -) : PlayerProfileHandler { - private val loaded = mutableMapOf() +val serverProfileUUID = UUID(0, 0) - override fun load(uuid: UUID): PlayerProfile { +class EcoProfileHandler( + private val handler: DataHandler +) : ProfileHandler { + private val loaded = mutableMapOf() + + private fun loadGenericProfile(uuid: UUID): Profile { val found = loaded[uuid] if (found != null) { return found @@ -19,9 +23,24 @@ class EcoPlayerProfileHandler( val data = mutableMapOf, Any>() - val profile = EcoPlayerProfile(data, uuid, handler) - loaded[uuid] = profile - return profile + return if (uuid == serverProfileUUID) { + val profile = EcoServerProfile(data, handler) + loaded[uuid] = profile + profile + } else { + val profile = EcoPlayerProfile(data, uuid, handler) + loaded[uuid] = profile + profile + } + } + + override fun load(uuid: UUID): PlayerProfile { + return loadGenericProfile(uuid) as PlayerProfile + } + + + override fun loadServerProfile(): ServerProfile { + return loadGenericProfile(serverProfileUUID) as ServerProfile } override fun saveKeysForPlayer(uuid: UUID, keys: Set>) { diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/internal/spigot/data/storage/ProfileSaver.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/internal/spigot/data/storage/ProfileSaver.kt index fb2119ae..beb29fe0 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/internal/spigot/data/storage/ProfileSaver.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/internal/spigot/data/storage/ProfileSaver.kt @@ -2,15 +2,15 @@ package com.willfp.eco.internal.spigot.data.storage import com.willfp.eco.core.Eco import com.willfp.eco.core.EcoPlugin -import com.willfp.eco.internal.spigot.data.EcoPlayerProfile +import com.willfp.eco.internal.spigot.data.EcoProfile class ProfileSaver(plugin: EcoPlugin) { init { plugin.scheduler.runTimer({ - for ((uuid, set) in EcoPlayerProfile.CHANGE_MAP) { - Eco.getHandler().playerProfileHandler.saveKeysForPlayer(uuid, set) + for ((uuid, set) in EcoProfile.CHANGE_MAP) { + Eco.getHandler().profileHandler.saveKeysForPlayer(uuid, set) } - EcoPlayerProfile.CHANGE_MAP.clear() + EcoProfile.CHANGE_MAP.clear() }, 1, 1) } } \ No newline at end of file