mirror of
https://github.com/Auxilor/EcoArmor.git
synced 2025-12-19 15:09:26 +00:00
Added support for skulls, heads and pumpkins as helmets
This commit is contained in:
@@ -20,19 +20,20 @@ enum class ArmorSlot(
|
|||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
val material = itemStack.type
|
val material = itemStack.type
|
||||||
val split = material.name.lowercase(Locale.getDefault()).split("_").toTypedArray()
|
|
||||||
|
|
||||||
return getSlot(split[split.size - 1])
|
return getSlot(material.name)
|
||||||
}
|
}
|
||||||
|
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun getSlot(name: String): ArmorSlot? {
|
fun getSlot(name: String): ArmorSlot? {
|
||||||
return when (name.lowercase(Locale.getDefault())) {
|
return when {
|
||||||
"helmet" -> HELMET
|
name.contains("HELMET", true) || name.contains("HEAD", true)
|
||||||
"chestplate" -> CHESTPLATE
|
|| name.contains("SKULL", true)
|
||||||
"elytra" -> ELYTRA
|
|| name.contains("PUMPKIN", true) -> HELMET
|
||||||
"leggings" -> LEGGINGS
|
name.contains("CHESTPLATE", true) -> CHESTPLATE
|
||||||
"boots" -> BOOTS
|
name.contains("ELYTRA", true) -> ELYTRA
|
||||||
|
name.contains("LEGGINGS", true) -> LEGGINGS
|
||||||
|
name.contains("BOOTS", true) -> BOOTS
|
||||||
else -> null
|
else -> null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user