Posted May 4, 20232 yr package us.blueeyemods.uem.config; import net.minecraft.world.entity.EquipmentSlot; import net.minecraft.world.item.enchantment.Enchantment; import net.minecraft.world.item.enchantment.EnchantmentCategory; import net.minecraftforge.common.ForgeConfigSpec; import java.util.Arrays; import java.util.List; public class Config { public static final ForgeConfigSpec.Builder BUILDER = new ForgeConfigSpec.Builder(); public static final ForgeConfigSpec SPEC; public static ForgeConfigSpec.EnumValue<Enchantment.Rarity> RARITY_ENUM_0; public static ForgeConfigSpec.EnumValue<EnchantmentCategory> CATEGORY_ENUM_0; public static ForgeConfigSpec.ConfigValue<List<? extends EquipmentSlot>> SLOTS_LIST_0; public static ForgeConfigSpec.ConfigValue<Integer> MAX_LEVEL_INTEGER_0; public static ForgeConfigSpec.ConfigValue<Boolean> TREASURE_BOOLEAN_0; public static ForgeConfigSpec.ConfigValue<Boolean> DISCOVERABLE_BOOLEAN_0; public static ForgeConfigSpec.ConfigValue<Boolean> TRADEABLE_BOOLEAN_0; public static ForgeConfigSpec.ConfigValue<Boolean> BOOKS_ALLOWED_BOOLEAN_0; public static ForgeConfigSpec.ConfigValue<Boolean> CURSE_BOOLEAN_0; public static ForgeConfigSpec.EnumValue<Enchantment.Rarity> RARITY_ENUM_1; public static ForgeConfigSpec.EnumValue<EnchantmentCategory> CATEGORY_ENUM_1; public static ForgeConfigSpec.ConfigValue<List<? extends EquipmentSlot>> SLOTS_LIST_1; public static ForgeConfigSpec.ConfigValue<Integer> MAX_LEVEL_INTEGER_1; public static ForgeConfigSpec.ConfigValue<Boolean> TREASURE_BOOLEAN_1; public static ForgeConfigSpec.ConfigValue<Boolean> DISCOVERABLE_BOOLEAN_1; public static ForgeConfigSpec.ConfigValue<Boolean> TRADEABLE_BOOLEAN_1; public static ForgeConfigSpec.ConfigValue<Boolean> BOOKS_ALLOWED_BOOLEAN_1; public static ForgeConfigSpec.ConfigValue<Boolean> CURSE_BOOLEAN_1; static { BUILDER.push("MENDING"); RARITY_ENUM_0 = BUILDER.defineEnum("rarity", Enchantment.Rarity.RARE); CATEGORY_ENUM_0 = BUILDER.defineEnum("category", EnchantmentCategory.BREAKABLE); SLOTS_LIST_0 = BUILDER.defineList("slots", Arrays.asList(EquipmentSlot.HEAD, EquipmentSlot.CHEST, EquipmentSlot.LEGS, EquipmentSlot.OFFHAND, EquipmentSlot.MAINHAND), entry -> true); MAX_LEVEL_INTEGER_0 = BUILDER.defineInRange("maxLvl", 1, 1, 255); TREASURE_BOOLEAN_0 = BUILDER.define("isTreasure", true); DISCOVERABLE_BOOLEAN_0 = BUILDER.define("discoverable", true); TRADEABLE_BOOLEAN_0 = BUILDER.define("tradeable", true); BOOKS_ALLOWED_BOOLEAN_0 = BUILDER.define("isAllowedOnBooks", true); CURSE_BOOLEAN_0 = BUILDER.define("isCurse", true); BUILDER.pop(); BUILDER.push("UNBREAKING"); RARITY_ENUM_1 = BUILDER.defineEnum("rarity", Enchantment.Rarity.UNCOMMON); CATEGORY_ENUM_1 = BUILDER.defineEnum("category", EnchantmentCategory.BREAKABLE); SLOTS_LIST_1 = BUILDER.defineList("slots", Arrays.asList(EquipmentSlot.HEAD, EquipmentSlot.CHEST, EquipmentSlot.LEGS, EquipmentSlot.OFFHAND, EquipmentSlot.MAINHAND), entry -> true); MAX_LEVEL_INTEGER_1 = BUILDER.defineInRange("maxLvl", 3, 1, 255); TREASURE_BOOLEAN_1 = BUILDER.define("isTreasure", false); DISCOVERABLE_BOOLEAN_1 = BUILDER.define("discoverable", true); TRADEABLE_BOOLEAN_1 = BUILDER.define("tradeable", true); BOOKS_ALLOWED_BOOLEAN_1 = BUILDER.define("isAllowedOnBooks", true); CURSE_BOOLEAN_1 = BUILDER.define("isCurse", true); BUILDER.pop(); SPEC = BUILDER.build(); } } This works, but it seems to be a mess. How would I clean it up? New year, new me. Nothing's going to get me down!
May 8, 20232 yr Not really a mess, so I would say there's no issue. Most you could do is change how you choose to implement the logic.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.