Вот гиршок твоя броня

This commit is contained in:
DBotThePony 2023-04-18 10:28:29 +07:00
parent 70f38c7e54
commit 232eeec9be
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -2,9 +2,11 @@ package ru.dbotthepony.mc.otm.item.armor
import net.minecraft.sounds.SoundEvent import net.minecraft.sounds.SoundEvent
import net.minecraft.sounds.SoundEvents import net.minecraft.sounds.SoundEvents
import net.minecraft.world.entity.Entity
import net.minecraft.world.entity.EquipmentSlot import net.minecraft.world.entity.EquipmentSlot
import net.minecraft.world.item.ArmorItem import net.minecraft.world.item.ArmorItem
import net.minecraft.world.item.ArmorMaterial import net.minecraft.world.item.ArmorMaterial
import net.minecraft.world.item.ItemStack
import net.minecraft.world.item.crafting.Ingredient import net.minecraft.world.item.crafting.Ingredient
import ru.dbotthepony.mc.otm.OverdriveThatMatters import ru.dbotthepony.mc.otm.OverdriveThatMatters
import ru.dbotthepony.mc.otm.registry.MItemTags 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)) { 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
}
} }