fix multiples issues

This commit is contained in:
alexcrea 2026-06-03 02:27:20 +02:00
parent 2768c0a0dc
commit bf4395ba3f
Signed by: alexcrea
GPG key ID: E346CD16413450E3
7 changed files with 24 additions and 8 deletions

View file

@ -436,7 +436,10 @@ lore_edit:
# It also requires to enable dialog rename (set "enable_dialog_rename: false" a bit higher)
# If dialog rename permission is enabled and player do not have the permission merge will fall back to vanilla xp cost
#
# As this feature require dialog rename, it can only be enabled starting with paper 1.21.6
# If you are using custom craft I recommend using Linear Xp Cost with Exact Linear Xp as normal Xp Cost will act "weird"
# But Linear Xp will act as 1$ time global multiplier. In other word: like you expect
#
# As this feature require dialog rename, it can only be enabled starting with paper 1.21.6 and later
monetary_cost:
enabled: false
# If using vault unlocked this allow to specify what currency should be used for anvil usage

View file

@ -456,7 +456,10 @@ lore_edit:
# It also requires to enable dialog rename (set "enable_dialog_rename: false" a bit higher)
# If dialog rename permission is enabled and player do not have the permission merge will fall back to vanilla xp cost
#
# As this feature require dialog rename, it can only be enabled starting with paper 1.21.6
# If you are using custom craft I recommend using Linear Xp Cost with Exact Linear Xp as normal Xp Cost will act "weird"
# But Linear Xp will act as 1$ time global multiplier. In other word: like you expect
#
# As this feature require dialog rename, it can only be enabled starting with paper 1.21.6 and later
monetary_cost:
enabled: false
# If using vault unlocked this allow to specify what currency should be used for anvil usage

View file

@ -448,7 +448,10 @@ lore_edit:
# It also requires to enable dialog rename (set "enable_dialog_rename: false" a bit higher)
# If dialog rename permission is enabled and player do not have the permission merge will fall back to vanilla xp cost
#
# As this feature require dialog rename, it can only be enabled starting with paper 1.21.6
# If you are using custom craft I recommend using Linear Xp Cost with Exact Linear Xp as normal Xp Cost will act "weird"
# But Linear Xp will act as 1$ time global multiplier. In other word: like you expect
#
# As this feature require dialog rename, it can only be enabled starting with paper 1.21.6 and later
monetary_cost:
enabled: false
# If using vault unlocked this allow to specify what currency should be used for anvil usage

View file

@ -436,7 +436,10 @@ lore_edit:
# It also requires to enable dialog rename (set "enable_dialog_rename: false" a bit higher)
# If dialog rename permission is enabled and player do not have the permission merge will fall back to vanilla xp cost
#
# As this feature require dialog rename, it can only be enabled starting with paper 1.21.6
# If you are using custom craft I recommend using Linear Xp Cost with Exact Linear Xp as normal Xp Cost will act "weird"
# But Linear Xp will act as 1$ time global multiplier. In other word: like you expect
#
# As this feature require dialog rename, it can only be enabled starting with paper 1.21.6 and later
monetary_cost:
enabled: false
# If using vault unlocked this allow to specify what currency should be used for anvil usage

View file

@ -160,7 +160,7 @@ class AnvilResultListener : Listener {
if (player.gameMode != GameMode.CREATIVE) {
if(ConfigOptions.shouldUseMoney(player)) {
result.cost.isMonetary = true
if(!EconomyManager.economy!!.has(player, BigDecimal(rawCost))) return
if(!EconomyManager.economy!!.has(player, result.cost.asMonetaryCost())) return
} else if (recipe.removeExactLinearXp) {
val levelXp = AnvilXpUtil.calculateXpForLevel(player.level)
val delta = AnvilXpUtil.calculateXpForLevel(player.level + 1) - levelXp
@ -243,7 +243,7 @@ class AnvilResultListener : Listener {
val rawCost = result.customCraftCost.rawCost
if(result.cost.isMonetary) {
EconomyManager.economy!!.remove(player, BigDecimal(rawCost))
EconomyManager.economy!!.remove(player, result.cost.asMonetaryCost())
return
}
@ -262,7 +262,7 @@ class AnvilResultListener : Listener {
player.level = newLevel
player.exp = xp / newDelta
} else {
player.level -= rawCost
player.level -= AnvilXpUtil.calculateLevelForXp(rawCost)
}
}

View file

@ -75,6 +75,7 @@ object AnvilXpUtil {
override fun asMonetaryCost(): BigDecimal {
return BigDecimal(rawCost)
.multiply(moneyMultiplier("global"))
}
}

View file

@ -438,7 +438,10 @@ lore_edit:
# It also requires to enable dialog rename (set "enable_dialog_rename: false" a bit higher)
# If dialog rename permission is enabled and player do not have the permission merge will fall back to vanilla xp cost
#
# As this feature require dialog rename, it can only be enabled starting with paper 1.21.6
# If you are using custom craft I recommend using Linear Xp Cost with Exact Linear Xp as normal Xp Cost will act "weird"
# But Linear Xp will act as 1$ time global multiplier. In other word: like you expect
#
# As this feature require dialog rename, it can only be enabled starting with paper 1.21.6 and later
monetary_cost:
enabled: false
# If using vault unlocked this allow to specify what currency should be used for anvil usage