From 232eeec9be3f1598d7135ca9c17e40fd30ea2df0 Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Tue, 18 Apr 2023 10:28:29 +0700 Subject: [PATCH] =?UTF-8?q?=D0=92=D0=BE=D1=82=20=D0=B3=D0=B8=D1=80=D1=88?= =?UTF-8?q?=D0=BE=D0=BA=20=D1=82=D0=B2=D0=BE=D1=8F=20=D0=B1=D1=80=D0=BE?= =?UTF-8?q?=D0=BD=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mc/otm/item/armor/SimpleTritaniumArmorItem.kt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/item/armor/SimpleTritaniumArmorItem.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/item/armor/SimpleTritaniumArmorItem.kt index 55988f2e4..1a80ef610 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/item/armor/SimpleTritaniumArmorItem.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/item/armor/SimpleTritaniumArmorItem.kt @@ -2,9 +2,11 @@ package ru.dbotthepony.mc.otm.item.armor import net.minecraft.sounds.SoundEvent import net.minecraft.sounds.SoundEvents +import net.minecraft.world.entity.Entity import net.minecraft.world.entity.EquipmentSlot import net.minecraft.world.item.ArmorItem import net.minecraft.world.item.ArmorMaterial +import net.minecraft.world.item.ItemStack import net.minecraft.world.item.crafting.Ingredient import ru.dbotthepony.mc.otm.OverdriveThatMatters import ru.dbotthepony.mc.otm.registry.MItemTags @@ -42,4 +44,14 @@ private object SimpleTritaniumArmorMaterial : ArmorMaterial { } class SimpleTritaniumArmorItem(slot: EquipmentSlot) : ArmorItem(SimpleTritaniumArmorMaterial, slot, Properties().stacksTo(1)) { + override fun getArmorTexture(stack: ItemStack, entity: Entity?, slot: EquipmentSlot, type: String?): String? { + if (type != "overlay" || slot == EquipmentSlot.FEET) + return when (slot) { + EquipmentSlot.LEGS -> "${OverdriveThatMatters.MOD_ID}:textures/models/armor/tritanium_simple_layer_2.png" + EquipmentSlot.FEET, EquipmentSlot.CHEST, EquipmentSlot.HEAD -> "${OverdriveThatMatters.MOD_ID}:textures/models/armor/tritanium_simple_layer_1.png" + else -> throw IllegalArgumentException("Invalid slot $slot") + } + + return null + } }