mirror of
https://github.com/alexcrea/CustomAnvil.git
synced 2026-06-23 08:14:00 +02:00
fix multiples issues
This commit is contained in:
parent
2768c0a0dc
commit
bf4395ba3f
7 changed files with 24 additions and 8 deletions
|
|
@ -436,7 +436,10 @@ lore_edit:
|
||||||
# It also requires to enable dialog rename (set "enable_dialog_rename: false" a bit higher)
|
# 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
|
# 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:
|
monetary_cost:
|
||||||
enabled: false
|
enabled: false
|
||||||
# If using vault unlocked this allow to specify what currency should be used for anvil usage
|
# If using vault unlocked this allow to specify what currency should be used for anvil usage
|
||||||
|
|
|
||||||
|
|
@ -456,7 +456,10 @@ lore_edit:
|
||||||
# It also requires to enable dialog rename (set "enable_dialog_rename: false" a bit higher)
|
# 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
|
# 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:
|
monetary_cost:
|
||||||
enabled: false
|
enabled: false
|
||||||
# If using vault unlocked this allow to specify what currency should be used for anvil usage
|
# If using vault unlocked this allow to specify what currency should be used for anvil usage
|
||||||
|
|
|
||||||
|
|
@ -448,7 +448,10 @@ lore_edit:
|
||||||
# It also requires to enable dialog rename (set "enable_dialog_rename: false" a bit higher)
|
# 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
|
# 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:
|
monetary_cost:
|
||||||
enabled: false
|
enabled: false
|
||||||
# If using vault unlocked this allow to specify what currency should be used for anvil usage
|
# If using vault unlocked this allow to specify what currency should be used for anvil usage
|
||||||
|
|
|
||||||
|
|
@ -436,7 +436,10 @@ lore_edit:
|
||||||
# It also requires to enable dialog rename (set "enable_dialog_rename: false" a bit higher)
|
# 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
|
# 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:
|
monetary_cost:
|
||||||
enabled: false
|
enabled: false
|
||||||
# If using vault unlocked this allow to specify what currency should be used for anvil usage
|
# If using vault unlocked this allow to specify what currency should be used for anvil usage
|
||||||
|
|
|
||||||
|
|
@ -160,7 +160,7 @@ class AnvilResultListener : Listener {
|
||||||
if (player.gameMode != GameMode.CREATIVE) {
|
if (player.gameMode != GameMode.CREATIVE) {
|
||||||
if(ConfigOptions.shouldUseMoney(player)) {
|
if(ConfigOptions.shouldUseMoney(player)) {
|
||||||
result.cost.isMonetary = true
|
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) {
|
} else if (recipe.removeExactLinearXp) {
|
||||||
val levelXp = AnvilXpUtil.calculateXpForLevel(player.level)
|
val levelXp = AnvilXpUtil.calculateXpForLevel(player.level)
|
||||||
val delta = AnvilXpUtil.calculateXpForLevel(player.level + 1) - levelXp
|
val delta = AnvilXpUtil.calculateXpForLevel(player.level + 1) - levelXp
|
||||||
|
|
@ -243,7 +243,7 @@ class AnvilResultListener : Listener {
|
||||||
|
|
||||||
val rawCost = result.customCraftCost.rawCost
|
val rawCost = result.customCraftCost.rawCost
|
||||||
if(result.cost.isMonetary) {
|
if(result.cost.isMonetary) {
|
||||||
EconomyManager.economy!!.remove(player, BigDecimal(rawCost))
|
EconomyManager.economy!!.remove(player, result.cost.asMonetaryCost())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -262,7 +262,7 @@ class AnvilResultListener : Listener {
|
||||||
player.level = newLevel
|
player.level = newLevel
|
||||||
player.exp = xp / newDelta
|
player.exp = xp / newDelta
|
||||||
} else {
|
} else {
|
||||||
player.level -= rawCost
|
player.level -= AnvilXpUtil.calculateLevelForXp(rawCost)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -75,6 +75,7 @@ object AnvilXpUtil {
|
||||||
|
|
||||||
override fun asMonetaryCost(): BigDecimal {
|
override fun asMonetaryCost(): BigDecimal {
|
||||||
return BigDecimal(rawCost)
|
return BigDecimal(rawCost)
|
||||||
|
.multiply(moneyMultiplier("global"))
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -438,7 +438,10 @@ lore_edit:
|
||||||
# It also requires to enable dialog rename (set "enable_dialog_rename: false" a bit higher)
|
# 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
|
# 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:
|
monetary_cost:
|
||||||
enabled: false
|
enabled: false
|
||||||
# If using vault unlocked this allow to specify what currency should be used for anvil usage
|
# If using vault unlocked this allow to specify what currency should be used for anvil usage
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue