package net.minecraft.world.item.enchantment;

import net.minecraft.world.item.Vanishable;
import net.minecraft.world.item.CrossbowItem;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.item.Wearable;
import net.minecraft.world.item.BowItem;
import net.minecraft.world.item.TridentItem;
import net.minecraft.world.item.FishingRodItem;
import net.minecraft.world.item.DiggerItem;
import net.minecraft.world.item.SwordItem;
import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.item.ArmorItem;
import net.minecraft.world.item.Item;

public enum EnchantmentCategory {
    ARMOR {
        @Override
        public boolean canEnchant(final Item bke) {
            return bke instanceof ArmorItem;
        }
    }, 
    ARMOR_FEET {
        @Override
        public boolean canEnchant(final Item bke) {
            return bke instanceof ArmorItem && ((ArmorItem)bke).getSlot() == EquipmentSlot.FEET;
        }
    }, 
    ARMOR_LEGS {
        @Override
        public boolean canEnchant(final Item bke) {
            return bke instanceof ArmorItem && ((ArmorItem)bke).getSlot() == EquipmentSlot.LEGS;
        }
    }, 
    ARMOR_CHEST {
        @Override
        public boolean canEnchant(final Item bke) {
            return bke instanceof ArmorItem && ((ArmorItem)bke).getSlot() == EquipmentSlot.CHEST;
        }
    }, 
    ARMOR_HEAD {
        @Override
        public boolean canEnchant(final Item bke) {
            return bke instanceof ArmorItem && ((ArmorItem)bke).getSlot() == EquipmentSlot.HEAD;
        }
    }, 
    WEAPON {
        @Override
        public boolean canEnchant(final Item bke) {
            return bke instanceof SwordItem;
        }
    }, 
    DIGGER {
        @Override
        public boolean canEnchant(final Item bke) {
            return bke instanceof DiggerItem;
        }
    }, 
    FISHING_ROD {
        @Override
        public boolean canEnchant(final Item bke) {
            return bke instanceof FishingRodItem;
        }
    }, 
    TRIDENT {
        @Override
        public boolean canEnchant(final Item bke) {
            return bke instanceof TridentItem;
        }
    }, 
    BREAKABLE {
        @Override
        public boolean canEnchant(final Item bke) {
            return bke.canBeDepleted();
        }
    }, 
    BOW {
        @Override
        public boolean canEnchant(final Item bke) {
            return bke instanceof BowItem;
        }
    }, 
    WEARABLE {
        @Override
        public boolean canEnchant(final Item bke) {
            return bke instanceof Wearable || Block.byItem(bke) instanceof Wearable;
        }
    }, 
    CROSSBOW {
        @Override
        public boolean canEnchant(final Item bke) {
            return bke instanceof CrossbowItem;
        }
    }, 
    VANISHABLE {
        @Override
        public boolean canEnchant(final Item bke) {
            return bke instanceof Vanishable || Block.byItem(bke) instanceof Vanishable || EnchantmentCategory$14.BREAKABLE.canEnchant(bke);
        }
    };
    
    public abstract boolean canEnchant(final Item bke);
}
