diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/boosters/BoosterHandlers.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/boosters/BoosterHandlers.kt index 23c7a1e..0ca734e 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/boosters/BoosterHandlers.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/boosters/BoosterHandlers.kt @@ -5,7 +5,7 @@ package com.willfp.boosters import com.willfp.boosters.boosters.ActivatedBooster import com.willfp.boosters.boosters.Booster import com.willfp.boosters.boosters.Boosters -import com.willfp.eco.core.data.PlayerProfile +import com.willfp.eco.core.data.profile import org.bukkit.Bukkit import org.bukkit.OfflinePlayer import org.bukkit.Sound @@ -27,7 +27,7 @@ val OfflinePlayer.boosters: List val found = mutableListOf() for (booster in Boosters.values()) { - val amount = PlayerProfile.load(this).read(booster.dataKey) + val amount = this.profile.read(booster.dataKey) for (i in 0 until amount) { found.add(booster) } @@ -37,12 +37,11 @@ val OfflinePlayer.boosters: List } fun OfflinePlayer.getAmountOfBooster(booster: Booster): Int { - return PlayerProfile.load(this).read(booster.dataKey) + return this.profile.read(booster.dataKey) } - fun OfflinePlayer.setAmountOfBooster(booster: Booster, amount: Int) { - PlayerProfile.load(this).write(booster.dataKey, amount) + this.profile.write(booster.dataKey, amount) } fun Player.activateBooster(booster: Booster): Boolean { diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/boosters/boosters/Booster.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/boosters/boosters/Booster.kt index 1337b49..5c9212c 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/boosters/boosters/Booster.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/boosters/boosters/Booster.kt @@ -45,7 +45,7 @@ class Booster( return messages } - val expiryMessages = config.getStrings("messages.expiry") + val expiryMessages: List = config.getStrings("messages.expiry") fun getGuiItem(player: Player): ItemStack { return ItemStackBuilder(Items.lookup(config.getString("gui.item")))