package net.mcreator.customoregen.item;

import net.minecraft.core.Holder;
import net.minecraft.core.registries.Registries;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.sounds.SoundEvent;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.world.item.ArmorItem;
import net.minecraft.world.item.ArmorMaterial;
import net.minecraft.world.item.ArmorMaterials;
import net.minecraft.world.item.crafting.Ingredient;
import net.mcreator.customoregen.CustomOreGenMod;
import net.mcreator.customoregen.init.CustomOreGenModItems;

/**
 * Custom armor material wrapper for Diamond Shard armor.
 * Uses vanilla DIAMOND material as base but references can be replaced with
 * custom material.
 */
public class ShardDiamondArmorMaterial {
	public static final net.neoforged.neoforge.registries.DeferredRegister<ArmorMaterial> REGISTRY = net.neoforged.neoforge.registries.DeferredRegister
			.create(Registries.ARMOR_MATERIAL, CustomOreGenMod.MODID);

	public static final Holder<ArmorMaterial> SHARD_DIAMOND = REGISTRY.register("shard_diamond",
			() -> new ArmorMaterial(
					net.minecraft.Util.make(new java.util.EnumMap<>(ArmorItem.Type.class), map -> {
						map.put(ArmorItem.Type.BOOTS, 2);
						map.put(ArmorItem.Type.LEGGINGS, 5);
						map.put(ArmorItem.Type.CHESTPLATE, 7);
						map.put(ArmorItem.Type.HELMET, 3);
						map.put(ArmorItem.Type.BODY, 0);
					}),
					14,
					SoundEvents.ARMOR_EQUIP_DIAMOND,
					() -> Ingredient.of(CustomOreGenModItems.DIAMONDSHARD.get()),
					java.util.List.of(new ArmorMaterial.Layer(
							ResourceLocation.fromNamespaceAndPath(CustomOreGenMod.MODID, "shard_diamond"), "", false)),
					1.0F,
					0.0F));
}
