Work on the displayed items

This commit is contained in:
alexcrea 2024-03-29 00:07:12 +01:00
parent a30f471c6a
commit bf320e1ffc
5 changed files with 60 additions and 16 deletions

View file

@ -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
}
}