diff --git a/src/main/java/vectorwing/farmersdelight/FarmersDelight.java b/src/main/java/vectorwing/farmersdelight/FarmersDelight.java index 1c8ad6bbf..5247e65f7 100644 --- a/src/main/java/vectorwing/farmersdelight/FarmersDelight.java +++ b/src/main/java/vectorwing/farmersdelight/FarmersDelight.java @@ -5,6 +5,8 @@ import net.neoforged.fml.common.Mod; import net.neoforged.fml.config.ModConfig; import net.neoforged.fml.loading.FMLEnvironment; +import net.neoforged.neoforge.client.gui.ConfigurationScreen; +import net.neoforged.neoforge.client.gui.IConfigScreenFactory; import net.neoforged.neoforge.common.NeoForge; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -30,6 +32,10 @@ public FarmersDelight(IEventBus modEventBus, ModContainer modContainer) { modContainer.registerConfig(ModConfig.Type.COMMON, Configuration.COMMON_CONFIG); modContainer.registerConfig(ModConfig.Type.CLIENT, Configuration.CLIENT_CONFIG); + if (FMLEnvironment.dist.isClient()) { + modContainer.registerExtensionPoint(IConfigScreenFactory.class, ConfigurationScreen::new); + } + ModSounds.SOUNDS.register(modEventBus); ModBlocks.BLOCKS.register(modEventBus); ModEffects.EFFECTS.register(modEventBus); diff --git a/src/main/java/vectorwing/farmersdelight/common/Configuration.java b/src/main/java/vectorwing/farmersdelight/common/Configuration.java index 7ff918dea..ad214e576 100644 --- a/src/main/java/vectorwing/farmersdelight/common/Configuration.java +++ b/src/main/java/vectorwing/farmersdelight/common/Configuration.java @@ -39,29 +39,9 @@ public class Configuration public static final String CATEGORY_WORLD = "world"; public static ModConfigSpec.BooleanValue GENERATE_FD_CHEST_LOOT; public static ModConfigSpec.BooleanValue GENERATE_VILLAGE_COMPOST_HEAPS; - public static ModConfigSpec.BooleanValue GENERATE_VILLAGE_FARM_FD_CROPS; - public static ModConfigSpec.BooleanValue GENERATE_WILD_CABBAGES; - public static ModConfigSpec.IntValue CHANCE_WILD_CABBAGES; - public static ModConfigSpec.BooleanValue GENERATE_WILD_BEETROOTS; - public static ModConfigSpec.IntValue CHANCE_WILD_BEETROOTS; - public static ModConfigSpec.BooleanValue GENERATE_WILD_POTATOES; - public static ModConfigSpec.IntValue CHANCE_WILD_POTATOES; - public static ModConfigSpec.BooleanValue GENERATE_WILD_ONIONS; - public static ModConfigSpec.IntValue CHANCE_WILD_ONIONS; - public static ModConfigSpec.BooleanValue GENERATE_WILD_CARROTS; - public static ModConfigSpec.IntValue CHANCE_WILD_CARROTS; - public static ModConfigSpec.BooleanValue GENERATE_WILD_TOMATOES; - public static ModConfigSpec.IntValue CHANCE_WILD_TOMATOES; - public static ModConfigSpec.BooleanValue GENERATE_WILD_RICE; - public static ModConfigSpec.IntValue CHANCE_WILD_RICE; - public static ModConfigSpec.BooleanValue GENERATE_BROWN_MUSHROOM_COLONIES; - public static ModConfigSpec.IntValue CHANCE_BROWN_MUSHROOM_COLONIES; - public static ModConfigSpec.BooleanValue GENERATE_RED_MUSHROOM_COLONIES; - public static ModConfigSpec.IntValue CHANCE_RED_MUSHROOM_COLONIES; + public static ModConfigSpec.BooleanValue GENERATE_VILLAGE_FARM_FD_CROPS; // CLIENT - public static final String CATEGORY_CLIENT = "client"; - public static ModConfigSpec.BooleanValue NOURISHED_HUNGER_OVERLAY; public static ModConfigSpec.BooleanValue COMFORT_HEALTH_OVERLAY; public static ModConfigSpec.BooleanValue FOOD_EFFECT_TOOLTIP; @@ -69,7 +49,7 @@ public class Configuration static { ModConfigSpec.Builder COMMON_BUILDER = new ModConfigSpec.Builder(); - COMMON_BUILDER.comment("Game settings").push(CATEGORY_SETTINGS); + COMMON_BUILDER.push(CATEGORY_SETTINGS); ENABLE_VANILLA_CROP_CRATES = COMMON_BUILDER.comment("Farmer's Delight adds crates (3x3) for vanilla crops, similar to Quark and Thermal Cultivation. Should they be craftable?") .define("enableVanillaCropCrates", true); FARMERS_BUY_FD_CROPS = COMMON_BUILDER.comment("Should Novice and Apprentice Farmers buy this mod's crops? (May reduce chances of other trades appearing)") @@ -87,7 +67,7 @@ public class Configuration .defineList("canvasSignDarkBackgroundList", ImmutableList.of("gray", "purple", "blue", "brown", "green", "red", "black"), obj -> true); COMMON_BUILDER.pop(); - COMMON_BUILDER.comment("Farming").push(CATEGORY_FARMING); + COMMON_BUILDER.push(CATEGORY_FARMING); DEFAULT_TOMATO_VINE_ROPE = COMMON_BUILDER.comment("Which rope should Tomato Vines leave behind when mined by hand?") .define("defaultTomatoVineRope", "farmersdelight:rope"); ENABLE_TOMATO_VINE_CLIMBING_TAGGED_ROPES = COMMON_BUILDER.comment("Should tomato vines be able to climb any rope tagged as farmersdelight:ropes?", @@ -95,12 +75,12 @@ public class Configuration .define("enableTomatoVineClimbingTaggedRopes", true); COMMON_BUILDER.pop(); - COMMON_BUILDER.comment("Recipe book").push(CATEGORY_RECIPE_BOOK); + COMMON_BUILDER.push(CATEGORY_RECIPE_BOOK); ENABLE_RECIPE_BOOK_COOKING_POT = COMMON_BUILDER.comment("Should the Cooking Pot have a Recipe Book available on its interface?") .define("enableRecipeBookCookingPot", true); COMMON_BUILDER.pop(); - COMMON_BUILDER.comment("Vanilla item overrides").push(CATEGORY_OVERRIDES); + COMMON_BUILDER.push(CATEGORY_OVERRIDES); VANILLA_SOUP_EXTRA_EFFECTS = COMMON_BUILDER.comment("Should soups and stews from vanilla Minecraft grant additional effects, like meals from this mod?") .define("vanillaSoupExtraEffects", true); RABBIT_STEW_BUFF = COMMON_BUILDER.comment("Should Rabbit Stew be buffed with improved food stats?") @@ -108,7 +88,7 @@ public class Configuration DISPENSER_TOOLS_CUTTING_BOARD = COMMON_BUILDER.comment("Should the Dispenser be able to operate a Cutting Board in front of it?") .define("dispenserUsesToolsOnCuttingBoard", true); - COMMON_BUILDER.comment("Stack size overrides").push(CATEGORY_OVERRIDES_STACK_SIZE); + COMMON_BUILDER.push(CATEGORY_OVERRIDES_STACK_SIZE); ENABLE_STACKABLE_SOUP_ITEMS = COMMON_BUILDER.comment("Should BowlFoodItems in the following list become stackable to 16, much like Farmer's Delight's meals?") .define("enableStackableSoupItems", true); SOUP_ITEM_LIST = COMMON_BUILDER.comment("List of BowlFoodItems. They must extend this class to be affected. Default: vanilla soups and stews.") @@ -117,77 +97,26 @@ public class Configuration COMMON_BUILDER.pop(); - COMMON_BUILDER.comment("World generation").push(CATEGORY_WORLD); + COMMON_BUILDER.push(CATEGORY_WORLD); GENERATE_FD_CHEST_LOOT = COMMON_BUILDER.comment("Should this mod add some of its items (ropes, seeds, knives, meals etc.) as extra chest loot across Minecraft?") .define("generateFDChestLoot", true); GENERATE_VILLAGE_COMPOST_HEAPS = COMMON_BUILDER.comment("Should FD generate Compost Heaps across all village biomes?") .define("genVillageCompostHeaps", true); - GENERATE_VILLAGE_FARM_FD_CROPS = COMMON_BUILDER.comment("Should FD crops show up planted randomly in various village farms?") + GENERATE_VILLAGE_FARM_FD_CROPS = COMMON_BUILDER.comment("Should FD crops show up planted randomly in various village farms?") .define("genFDCropsOnVillageFarms", true); - COMMON_BUILDER.comment("Wild Cabbage generation").push("wild_cabbages"); - CHANCE_WILD_CABBAGES = COMMON_BUILDER.comment("Chance of generating clusters. Smaller value = more frequent.") - .defineInRange("chance", 30, 0, Integer.MAX_VALUE); - COMMON_BUILDER.pop(); - - COMMON_BUILDER.comment("Sea Beet generation").push("wild_beetroots"); - CHANCE_WILD_BEETROOTS = COMMON_BUILDER.comment("Chance of generating clusters. Smaller value = more frequent.") - .defineInRange("chance", 30, 0, Integer.MAX_VALUE); - COMMON_BUILDER.pop(); - - COMMON_BUILDER.comment("Wild Potato generation").push("wild_potatoes"); - CHANCE_WILD_POTATOES = COMMON_BUILDER.comment("Chance of generating clusters. Smaller value = more frequent.") - .defineInRange("chance", 100, 0, Integer.MAX_VALUE); - COMMON_BUILDER.pop(); - - COMMON_BUILDER.comment("Wild Carrot generation").push("wild_carrots"); - CHANCE_WILD_CARROTS = COMMON_BUILDER.comment("Chance of generating clusters. Smaller value = more frequent.") - .defineInRange("chance", 120, 0, Integer.MAX_VALUE); - COMMON_BUILDER.pop(); - - COMMON_BUILDER.comment("Wild Onion generation").push("wild_onions"); - CHANCE_WILD_ONIONS = COMMON_BUILDER.comment("Chance of generating clusters. Smaller value = more frequent.") - .defineInRange("chance", 120, 0, Integer.MAX_VALUE); - COMMON_BUILDER.pop(); - - COMMON_BUILDER.comment("Tomato Vines generation").push("wild_tomatoes"); - CHANCE_WILD_TOMATOES = COMMON_BUILDER.comment("Chance of generating clusters. Smaller value = more frequent.") - .defineInRange("chance", 100, 0, Integer.MAX_VALUE); - COMMON_BUILDER.pop(); - - COMMON_BUILDER.comment("Wild Rice generation").push("wild_rice"); - CHANCE_WILD_RICE = COMMON_BUILDER.comment("Chance of generating clusters. Smaller value = more frequent.") - .defineInRange("chance", 20, 0, Integer.MAX_VALUE); - COMMON_BUILDER.pop(); - - COMMON_BUILDER.comment("Brown Mushroom Colony generation").push("brown_mushroom_colonies"); - GENERATE_BROWN_MUSHROOM_COLONIES = COMMON_BUILDER.comment("Generate brown mushroom colonies on mushroom fields") - .define("genBrownMushroomColony", true); - CHANCE_BROWN_MUSHROOM_COLONIES = COMMON_BUILDER.comment("Chance of generating clusters. Smaller value = more frequent.") - .defineInRange("chance", 15, 0, Integer.MAX_VALUE); - COMMON_BUILDER.pop(); - - COMMON_BUILDER.comment("Red Mushroom Colony generation").push("red_mushroom_colonies"); - GENERATE_RED_MUSHROOM_COLONIES = COMMON_BUILDER.comment("Generate red mushroom colonies on mushroom fields") - .define("genRedMushroomColony", true); - CHANCE_RED_MUSHROOM_COLONIES = COMMON_BUILDER.comment("Chance of generating clusters. Smaller value = more frequent.") - .defineInRange("chance", 15, 0, Integer.MAX_VALUE); - COMMON_BUILDER.pop(); - COMMON_BUILDER.pop(); COMMON_CONFIG = COMMON_BUILDER.build(); ModConfigSpec.Builder CLIENT_BUILDER = new ModConfigSpec.Builder(); - CLIENT_BUILDER.comment("Client settings").push(CATEGORY_CLIENT); NOURISHED_HUNGER_OVERLAY = CLIENT_BUILDER.comment("Should the hunger bar have a gilded overlay when the player has the Nourishment effect?") .define("nourishmentHungerOverlay", true); COMFORT_HEALTH_OVERLAY = CLIENT_BUILDER.comment("Should the health bar have a silver sheen when the player has the Comfort effect?") .define("comfortHealthOverlay", true); FOOD_EFFECT_TOOLTIP = CLIENT_BUILDER.comment("Should meal and drink tooltips display which effects they provide?") .define("foodEffectTooltip", true); - CLIENT_BUILDER.pop(); CLIENT_CONFIG = CLIENT_BUILDER.build(); } diff --git a/src/main/resources/assets/farmersdelight/lang/en_us.json b/src/main/resources/assets/farmersdelight/lang/en_us.json index 1df69b59d..4d1fe2676 100644 --- a/src/main/resources/assets/farmersdelight/lang/en_us.json +++ b/src/main/resources/assets/farmersdelight/lang/en_us.json @@ -319,5 +319,59 @@ "farmersdelight.jei.info.wild_onions": "Onions can be commonly found as a wild plant in temperate lands, such as plains and forests.", "farmersdelight.jei.info.wild_potatoes": "Potatoes can be commonly found as a wild plant in cold lands, such as mountains and taigas.", "farmersdelight.jei.info.wild_tomatoes": "Tomatoes can be commonly found as a wild plant in arid lands, such as savannas and deserts.", - "farmersdelight.jei.info.wild_rice": "Rice can be commonly found as a wild plant in the ponds of wet lands, such as swamps and jungles." + "farmersdelight.jei.info.wild_rice": "Rice can be commonly found as a wild plant in the ponds of wet lands, such as swamps and jungles.", + + "farmersdelight.configuration.settings": "Game settings", + "farmersdelight.configuration.enableVanillaCropCrates": "Enable vanilla crop crates", + "farmersdelight.configuration.enableVanillaCropCrates.tooltip": "Farmer's Delight adds crates (3x3) for vanilla crops, similar to Quark and Thermal Cultivation. Should they be craftable?", + "farmersdelight.configuration.farmersBuyFDCrops": "Enable Farmers to buy FD crops", + "farmersdelight.configuration.farmersBuyFDCrops.tooltip": "Should Novice and Apprentice Farmers buy this mod's crops? (May reduce chances of other trades appearing)", + "farmersdelight.configuration.wanderingTraderSellsFDItems": "Wandering Trader sells FD items", + "farmersdelight.configuration.wanderingTraderSellsFDItems.tooltip": "Should the Wandering Trader sell some of this mod's items? (Currently includes crop seeds and onions)", + "farmersdelight.configuration.richSoilBoostChance": "Rich Soil growth boost chance", + "farmersdelight.configuration.richSoilBoostChance.tooltip": "How often (in percentage) should Rich Soil succeed in boosting a plant's growth at each random tick? Set it to 0.0 to disable this.", + "farmersdelight.configuration.cuttingBoardFortuneBonus": "Cutting Board Fortune bonus", + "farmersdelight.configuration.cuttingBoardFortuneBonus.tooltip": "How much of a bonus (in percentage) should each level of Fortune grant to Cutting Board chances? Set it to 0.0 to disable this.", + "farmersdelight.configuration.enableRopeReeling": "Enable rope reeling", + "farmersdelight.configuration.enableRopeReeling.tooltip": "Should players be able to reel back rope, bottom to top, when sneak-using with an empty hand on them?", + "farmersdelight.configuration.canvasSignDarkBackgroundList": "Canvas Sign dark background list", + "farmersdelight.configuration.canvasSignDarkBackgroundList.tooltip": "A list of dye colors that, when used as the background of a Canvas Sign, should default to white text when placed. Dyes: [\"white\", \"orange\", \"magenta\", \"light_blue\", \"yellow\", \"lime\", \"pink\", \"gray\", \"light_gray\", \"cyan\", \"purple\", \"blue\", \"brown\", \"green\", \"red\", \"black\"]", + + "farmersdelight.configuration.farming": "Farming", + "farmersdelight.configuration.defaultTomatoVineRope": "Default Tomato Vine rope", + "farmersdelight.configuration.defaultTomatoVineRope.tooltip": "Which rope should Tomato Vines leave behind when mined by hand?", + "farmersdelight.configuration.enableTomatoVineClimbingTaggedRopes": "Enable Tomato Vine climbing on tagged ropes", + "farmersdelight.configuration.enableTomatoVineClimbingTaggedRopes.tooltip": "Should tomato vines be able to climb any rope tagged as farmersdelight:ropes? Beware: this will convert these blocks into the block specified in defaultTomatoVineRope.", + + "farmersdelight.configuration.recipe_book": "Recipe book", + "farmersdelight.configuration.enableRecipeBookCookingPot": "Enable Recipe Book for Cooking Pot", + "farmersdelight.configuration.enableRecipeBookCookingPot.tooltip": "Should the Cooking Pot have a Recipe Book available on its interface?", + + "farmersdelight.configuration.overrides": "Vanilla item overrides", + "farmersdelight.configuration.vanillaSoupExtraEffects": "Enable vanilla soup extra effects", + "farmersdelight.configuration.vanillaSoupExtraEffects.tooltip": "Should soups and stews from vanilla Minecraft grant additional effects, like meals from this mod?", + "farmersdelight.configuration.rabbitStewBuff": "Enable Rabbit Stew buff", + "farmersdelight.configuration.rabbitStewBuff.tooltip": "Should Rabbit Stew be buffed with improved food stats?", + "farmersdelight.configuration.dispenserUsesToolsOnCuttingBoard": "Enable Dispenser to use tools on Cutting Board", + "farmersdelight.configuration.dispenserUsesToolsOnCuttingBoard.tooltip": "Should the Dispenser be able to operate a Cutting Board in front of it?", + + "farmersdelight.configuration.stack_size": "Stack size overrides", + "farmersdelight.configuration.enableStackableSoupItems": "Enable stackable soup items", + "farmersdelight.configuration.enableStackableSoupItems.tooltip": "Should BowlFoodItems in the following list become stackable to 16, much like Farmer's Delight's meals?", + "farmersdelight.configuration.soupItemList": "List of stackable soup items", + "farmersdelight.configuration.soupItemList.tooltip": "List of BowlFoodItems. They must extend this class to be affected. Default: vanilla soups and stews.", + + "farmersdelight.configuration.world": "World generation", + "farmersdelight.configuration.generateFDChestLoot": "Generate FD chest loot", + "farmersdelight.configuration.generateFDChestLoot.tooltip": "Should this mod add some of its items (ropes, seeds, knives, meals etc.) as extra chest loot across Minecraft?", + "farmersdelight.configuration.genVillageCompostHeaps": "Generate village Compost Heaps", + "farmersdelight.configuration.genVillageCompostHeaps.tooltip": "Generate Compost Heaps across all village biomes", + + "farmersdelight.configuration.nourishmentHungerOverlay": "Enable Nourishment hunger overlay", + "farmersdelight.configuration.nourishmentHungerOverlay.tooltip": "Should the hunger bar have a gilded overlay when the player has the Nourishment effect?", + "farmersdelight.configuration.comfortHealthOverlay": "Enable Comfort health overlay", + "farmersdelight.configuration.comfortHealthOverlay.tooltip": "Should the health bar have a silver sheen when the player has the Comfort effect?", + "farmersdelight.configuration.foodEffectTooltip": "Enable food effect tooltips", + "farmersdelight.configuration.foodEffectTooltip.tooltip": "Should meal and drink tooltips display which effects they provide?" + }