package com.mingliqiye.minecraft.enchantment.conflict.enchantment;

public abstract class Enchantment {
    public Boolean canBeCombined(Enchantment enchantment) {
        return null;
    }

    abstract String getId();

    public static Enchantment ofId(String id) {
        DamageEnchantment damageEnchantment = DamageEnchantment.ofId(id);
        if (damageEnchantment != null) {
            return damageEnchantment;
        }
        InfinityEnchantment infinityEnchantment = InfinityEnchantment.ofId(id);
        if (infinityEnchantment != null) {
            return infinityEnchantment;
        }
        PiercingEnchantment piercingEnchantment = PiercingEnchantment.ofId(id);
        if (piercingEnchantment != null) {
            return piercingEnchantment;
        }
        return ProtectionEnchantment.ofId(id);
    }
}
