mirror of
https://github.com/alexcrea/CustomAnvil.git
synced 2026-06-23 16:16:17 +02:00
fix enchantment squared once again
This commit is contained in:
parent
fd7e7684d9
commit
7f15e0eb55
1 changed files with 8 additions and 10 deletions
|
|
@ -6,7 +6,6 @@ import io.delilaheve.util.ItemUtil.canMergeWith
|
|||
import io.delilaheve.util.ItemUtil.unitRepair
|
||||
import org.bukkit.GameMode
|
||||
import org.bukkit.Material
|
||||
import org.bukkit.entity.HumanEntity
|
||||
import org.bukkit.entity.Player
|
||||
import org.bukkit.event.Event
|
||||
import org.bukkit.event.EventHandler
|
||||
|
|
@ -31,7 +30,6 @@ import xyz.alexcrea.cuanvil.util.config.LoreEditConfigUtil
|
|||
import xyz.alexcrea.cuanvil.util.config.LoreEditType
|
||||
import java.util.*
|
||||
import java.util.concurrent.atomic.AtomicInteger
|
||||
import kotlin.collections.ArrayList
|
||||
import kotlin.math.min
|
||||
|
||||
class AnvilResultListener : Listener {
|
||||
|
|
@ -320,8 +318,8 @@ class AnvilResultListener : Listener {
|
|||
|
||||
val repairCost = xpCost.get()
|
||||
return if ((inventory.maximumRepairCost <= repairCost)
|
||||
|| (player.level < repairCost)) Int.MIN_VALUE
|
||||
|
||||
|| (player.level < repairCost)
|
||||
) Int.MIN_VALUE
|
||||
else repairCost
|
||||
}
|
||||
|
||||
|
|
@ -364,7 +362,7 @@ class AnvilResultListener : Listener {
|
|||
// fill book meta
|
||||
val meta = leftItem.itemMeta
|
||||
if (meta == null || !meta.hasLore()) return false
|
||||
val lore = ArrayList<String>(meta.lore!!)
|
||||
val lore = DependencyManager.stripLore(leftItem)
|
||||
if (lore.isEmpty()) return false
|
||||
|
||||
val rightCopy: ItemStack?
|
||||
|
|
@ -445,7 +443,7 @@ class AnvilResultListener : Listener {
|
|||
|
||||
val leftMeta = leftItem.itemMeta
|
||||
if (leftMeta == null || !leftMeta.hasLore()) return false
|
||||
val lore = leftMeta.lore!!
|
||||
val lore = DependencyManager.stripLore(leftItem)
|
||||
if (lore.isEmpty()) return false
|
||||
|
||||
// Create result item
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue