diff --git a/build.gradle b/build.gradle index b57b809..449f104 100644 --- a/build.gradle +++ b/build.gradle @@ -44,7 +44,7 @@ allprojects { } dependencies { - compileOnly 'com.willfp:eco:6.46.0' + compileOnly 'com.willfp:eco:6.47.0' compileOnly 'org.jetbrains:annotations:23.0.0' diff --git a/eco-core/core-plugin/build.gradle b/eco-core/core-plugin/build.gradle index 3e09ba0..08fcd9e 100644 --- a/eco-core/core-plugin/build.gradle +++ b/eco-core/core-plugin/build.gradle @@ -3,7 +3,7 @@ version rootProject.version dependencies { compileOnly 'org.spigotmc:spigot-api:1.17.1-R0.1-SNAPSHOT' - compileOnly "com.github.MilkBowl:VaultAPI:1.7" + compileOnly 'com.github.MilkBowl:VaultAPI:1.7' compileOnly fileTree(dir: '../../lib', include: ['*.jar']) } diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecobits/currencies/PriceFactoryCurrency.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecobits/currencies/PriceFactoryCurrency.kt index d779129..c11240b 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecobits/currencies/PriceFactoryCurrency.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecobits/currencies/PriceFactoryCurrency.kt @@ -6,7 +6,6 @@ import com.willfp.eco.core.price.PriceFactory import org.bukkit.entity.Player import java.util.UUID import java.util.function.Function -import kotlin.math.roundToInt class PriceFactoryCurrency( private val currency: Currency @@ -26,19 +25,17 @@ class PriceFactoryCurrency( ) : Price { private val multipliers = mutableMapOf() - override fun canAfford(player: Player) = player.getBalance(currency) >= getValue(player) + override fun canAfford(player: Player, multiplier: Double) = + player.getBalance(currency) >= getValue(player, multiplier) - override fun pay(player: Player) { - player.adjustBalance(currency, -getValue(player)) - } + override fun pay(player: Player, multiplier: Double) = + player.adjustBalance(currency, -getValue(player, multiplier)) - override fun giveTo(player: Player) { - player.adjustBalance(currency, getValue(player)) - } + override fun giveTo(player: Player, multiplier: Double) = + player.adjustBalance(currency, getValue(player, multiplier)) - override fun getValue(player: Player): Double { - return xp(MathContext.copyWithPlayer(baseContext, player)) * getMultiplier(player) - } + override fun getValue(player: Player, multiplier: Double) = + xp(MathContext.copyWithPlayer(baseContext, player)) * getMultiplier(player) * multiplier override fun getMultiplier(player: Player): Double { return multipliers[player.uniqueId] ?: 1.0 diff --git a/gradle.properties b/gradle.properties index 62ffc8a..62ab435 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,2 +1,2 @@ -version = 1.3.0 +version = 1.4.0 plugin-name = EcoBits