mirror of
https://github.com/alexcrea/CustomAnvil.git
synced 2026-06-23 16:16:17 +02:00
Work on the displayed items
This commit is contained in:
parent
a30f471c6a
commit
bf320e1ffc
5 changed files with 60 additions and 16 deletions
|
|
@ -7,7 +7,7 @@ import org.bukkit.enchantments.Enchantment
|
|||
class EnchantConflictGroup(
|
||||
val name: String,
|
||||
private val cantConflict: AbstractMaterialGroup,
|
||||
private val minBeforeBlock: Int){
|
||||
val minBeforeBlock: Int){
|
||||
|
||||
private val enchantments = HashSet<Enchantment>()
|
||||
|
||||
|
|
@ -50,4 +50,15 @@ class EnchantConflictGroup(
|
|||
enchantments.addAll(enchants)
|
||||
}
|
||||
|
||||
fun getRepresentativeMaterial(): Material {
|
||||
val groups = getCantConflictGroup().getGroups()
|
||||
val groupIterator = groups.iterator()
|
||||
while (groupIterator.hasNext()){
|
||||
val mat = groupIterator.next().getRepresentativeMaterial()
|
||||
if(mat != Material.ENCHANTED_BOOK) return mat
|
||||
|
||||
}
|
||||
return Material.ENCHANTED_BOOK
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue