remove use of customname as not used under 1.21.4

This commit is contained in:
alexcrea 2026-07-16 18:50:51 +02:00
parent 7b232528f1
commit 8830b4c4ed
Signed by: alexcrea
GPG key ID: E59DF23EE2A2266C

View file

@ -67,14 +67,7 @@ object PlatformUtil {
}
}
// Display name
private val useCustomName = hasMethod(ItemStack::class.java, "customName")
fun ItemMeta.componentDisplayName(): Component? {
if (useCustomName) {
if (!this.hasCustomName()) return null
return this.customName()
}
if (!this.hasDisplayName()) return null
return if (isPaper) {
@ -85,9 +78,7 @@ object PlatformUtil {
}
fun ItemMeta.setComponentDisplayName(component: Component?, fallback: String? = null) {
if (useCustomName) {
this.customName(component)
} else if (isPaper) {
if (isPaper) {
this.displayName(component)
} else {
if (component == null) {