package io.github.moulberry.repo.constants; import com.google.gson.annotations.SerializedName; import lombok.Getter; import java.util.ArrayList; import java.util.List; import java.util.Map; public class Enchants { @Getter @SerializedName("enchants") Map> availableEnchants; @Getter @SerializedName("enchant_pools") List> enchantPools; @Getter @SerializedName("enchants_xp_cost") Map> enchantExperienceCost; public List getAvailableEnchants(String tooltype) { return availableEnchants.get(tooltype); } public List getConflictingEnchants(String enchant) { List conflicts = new ArrayList<>(); for (List enchantPool : enchantPools) { if (enchantPool.contains(enchant)) { conflicts.addAll(enchantPool); conflicts.remove(enchant); } } return conflicts; } }