From da9e667b1837a47e507fb97dde0cd2d94dcccac9 Mon Sep 17 00:00:00 2001 From: Gabriel Dumitru Date: Sat, 7 Jan 2023 15:33:37 +0200 Subject: [PATCH] [plugin] simplify ItemCreator#create --- .../minecraft/arcanevouchers/items/ItemCreator.kt | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/plugin/src/main/kotlin/me/gabytm/minecraft/arcanevouchers/items/ItemCreator.kt b/plugin/src/main/kotlin/me/gabytm/minecraft/arcanevouchers/items/ItemCreator.kt index a5385c1..942a76d 100644 --- a/plugin/src/main/kotlin/me/gabytm/minecraft/arcanevouchers/items/ItemCreator.kt +++ b/plugin/src/main/kotlin/me/gabytm/minecraft/arcanevouchers/items/ItemCreator.kt @@ -224,17 +224,7 @@ class ItemCreator(plugin: ArcaneVouchers) { "model" -> value.toIntOrNull()?.let { builder.model(it) } - "color" -> { - if (!baseItem.hasItemMeta()) { - continue - } - - val meta = baseItem.itemMeta ?: continue - - if (meta is LeatherArmorMeta) { - meta.setColor(value.toColor()) - } - } + "color" -> value.toColor()?.let { builder.color(it) } "nbt" -> { // Take everything that's after 'nbt:'