Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.doctorwafflephd.doctorwafflemod.core.enums;
- import com.doctorwafflephd.doctorwafflemod.WaffleMod;
- import net.minecraft.inventory.EquipmentSlotType;
- import net.minecraft.item.ArmorItem;
- import net.minecraft.item.IArmorMaterial;
- import net.minecraft.item.Items;
- import net.minecraft.item.crafting.Ingredient;
- import net.minecraft.util.SoundEvent;
- import net.minecraft.util.SoundEvents;
- import net.minecraftforge.api.distmarker.Dist;
- import net.minecraftforge.api.distmarker.OnlyIn;
- import java.util.function.Supplier;
- public enum ModArmorEnums implements IArmorMaterial {
- NAUTILUS("nautilus", 30, new int[]{0,0,0,3}, 12, SoundEvents.ARMOR_EQUIP_TURTLE, 1.0f, 0.0f, () -> {return Ingredient.of(Items.NAUTILUS_SHELL);});
- private static final int[] DURABILITY_PER_SLOT = new int[]{13, 16, 15, 11};
- private final String name;
- private final int durabilityFactor;
- private final int[] armorArray;
- private final int enchantability;
- private final SoundEvent soundEvent;
- private final float toughness;
- private final Supplier<Ingredient> repairMaterial;
- private final float knockbackResistance;
- ModArmorEnums(String name, int durabilityFactor, int[] armorArray, int enchantability, SoundEvent soundEvent, float toughness, float knockbackResistance, Supplier<Ingredient> repairMaterial) {
- this.name = name;
- this.durabilityFactor = durabilityFactor;
- this.armorArray = armorArray;
- this.enchantability = enchantability;
- this.soundEvent = soundEvent;
- this.toughness = toughness;
- this.repairMaterial = repairMaterial;
- this.knockbackResistance = knockbackResistance;
- }
- @Override
- public int getDurabilityForSlot(EquipmentSlotType slotType) {
- return DURABILITY_PER_SLOT[slotType.getIndex()] * this.durabilityFactor ;
- }
- @Override
- public int getDefenseForSlot(EquipmentSlotType slotType) {
- return this.armorArray[slotType.getIndex()];
- }
- @Override
- public int getEnchantmentValue() {
- return this.enchantability;
- }
- @Override
- public SoundEvent getEquipSound() {
- return this.soundEvent;
- }
- @Override
- public Ingredient getRepairIngredient() {
- return this.repairMaterial.get();
- }
- @OnlyIn(Dist.CLIENT)
- @Override
- public String getName() {
- return this.name;
- }
- @Override
- public float getToughness() {
- return this.toughness;
- }
- @Override
- public float getKnockbackResistance() {
- return this.knockbackResistance;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment