mirror of
https://github.com/alexcrea/CustomAnvil.git
synced 2026-06-23 16:16:17 +02:00
fix strange level price for book.
This commit is contained in:
parent
b594b1fb0c
commit
6133419499
1 changed files with 5 additions and 1 deletions
|
|
@ -57,11 +57,15 @@ class AnvilEventListener : Listener {
|
||||||
resultItem.itemMeta = it
|
resultItem.itemMeta = it
|
||||||
}
|
}
|
||||||
resultItem.setEnchantmentsUnsafe(newEnchants)
|
resultItem.setEnchantmentsUnsafe(newEnchants)
|
||||||
|
var repairCost: Int
|
||||||
if (!first.isBook() && !second.isBook()) {
|
if (!first.isBook() && !second.isBook()) {
|
||||||
|
repairCost = first.repairCost + second.repairCost
|
||||||
// we only need to be concerned with repair when neither item is a book
|
// we only need to be concerned with repair when neither item is a book
|
||||||
resultItem.repairFrom(first, second)
|
resultItem.repairFrom(first, second)
|
||||||
|
}else{
|
||||||
|
repairCost = resultItem.repairCost
|
||||||
}
|
}
|
||||||
var repairCost = first.repairCost + second.repairCost
|
|
||||||
if (ConfigOptions.limitRepairCost) {
|
if (ConfigOptions.limitRepairCost) {
|
||||||
repairCost = min(repairCost, ConfigOptions.limitRepairValue)
|
repairCost = min(repairCost, ConfigOptions.limitRepairValue)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue