Skip to content

Commit

Permalink
1.18.2 - 3.2.4
Browse files Browse the repository at this point in the history
- Support for Enhanced Farming

- EnhancedFarmingConfig & EnhancedFarming Configuration
- EnhancedFarming CommonSetup
- EnhancedFarming ModBlocks
- EnhancedFarming ClientSetup
- EnhancedFarming CommonEvents
- EnhancedFarming WildCropGeneration
- EnhancedFarming Wildplants
- EnhancedFarming Translations
- EnhancedFarming ItemResources (JSON)

- Reformatting ImmersiveEngineeringConfig
- Reformatting MinecraftConfig
- Reformatting VeggieWayConfig
- ModBlocks now always load when mod is loaded
- ModItems now always go through renderpipeline when mod is loaded

- bumped version
  • Loading branch information
wolfkidsounds committed Jan 29, 2023
1 parent c817163 commit 374c929
Show file tree
Hide file tree
Showing 35 changed files with 1,078 additions and 67 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'org.parchmentmc.librarian.forgegradle'


version = '1.18.2_3.2.3_forge'
version = '1.18.2_3.2.4_forge'
group = 'wks.wolfkidsounds' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = 'wildplants'

Expand Down
18 changes: 16 additions & 2 deletions src/main/java/wks/wolfkidsounds/wildplants/ClientSetup.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,31 @@ public static void init(final FMLClientSetupEvent event) {
}

//IMMERSIVEENGINEERING
if (Configuration.ENABLE_IMMERSIVEENGINEERING.get() && Configuration.LOADED_IMMERSIVEENGINEERING) {
if (Configuration.LOADED_IMMERSIVEENGINEERING) {
ItemBlockRenderTypes.setRenderLayer(ModBlocks.IMMERSIVEENGINEERING_WILD_HEMP.get(), RenderType.cutout());
}

//VEGGIE_WAY
if (Configuration.ENABLE_VEGGIE_WAY.get() && Configuration.LOADED_VEGGIE_WAY) {
if (Configuration.LOADED_VEGGIE_WAY) {
ItemBlockRenderTypes.setRenderLayer(ModBlocks.VEGGIEWAY_WILD_CORN.get(), RenderType.cutout());
ItemBlockRenderTypes.setRenderLayer(ModBlocks.VEGGIEWAY_WILD_LENTIL.get(), RenderType.cutout());
ItemBlockRenderTypes.setRenderLayer(ModBlocks.VEGGIEWAY_WILD_QUINOA.get(), RenderType.cutout());
ItemBlockRenderTypes.setRenderLayer(ModBlocks.VEGGIEWAY_WILD_SOYBEAN.get(), RenderType.cutout());
ItemBlockRenderTypes.setRenderLayer(ModBlocks.VEGGIEWAY_WILD_COTTON.get(), RenderType.cutout());
}

//ENHANCEDFARMING
if (Configuration.LOADED_ENHANCEDFARMING) {
ItemBlockRenderTypes.setRenderLayer(ModBlocks.ENHANCEDFARMING_WILD_MINT.get(), RenderType.cutout());
ItemBlockRenderTypes.setRenderLayer(ModBlocks.ENHANCEDFARMING_WILD_TOMATO.get(), RenderType.cutout());
ItemBlockRenderTypes.setRenderLayer(ModBlocks.ENHANCEDFARMING_WILD_CUCUMBER.get(), RenderType.cutout());
ItemBlockRenderTypes.setRenderLayer(ModBlocks.ENHANCEDFARMING_WILD_AUBERGINE.get(), RenderType.cutout());
ItemBlockRenderTypes.setRenderLayer(ModBlocks.ENHANCEDFARMING_WILD_GRAPE.get(), RenderType.cutout());
ItemBlockRenderTypes.setRenderLayer(ModBlocks.ENHANCEDFARMING_WILD_PINEAPPLE.get(), RenderType.cutout());
ItemBlockRenderTypes.setRenderLayer(ModBlocks.ENHANCEDFARMING_WILD_CORN.get(), RenderType.cutout());
ItemBlockRenderTypes.setRenderLayer(ModBlocks.ENHANCEDFARMING_WILD_ONION.get(), RenderType.cutout());
ItemBlockRenderTypes.setRenderLayer(ModBlocks.ENHANCEDFARMING_WILD_GARLIC.get(), RenderType.cutout());
ItemBlockRenderTypes.setRenderLayer(ModBlocks.ENHANCEDFARMING_WILD_LETTUCE.get(), RenderType.cutout());
}
}
}
6 changes: 6 additions & 0 deletions src/main/java/wks/wolfkidsounds/wildplants/CommonSetup.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ public static void init(final FMLCommonSetupEvent event) {
WildCropGeneration.registerWildVeggieWayCropGeneration();
Wildplants.LOGGER.debug("setup-veggie_way");
}

//ENHANCEDFARMING
if (Configuration.ENABLE_ENHANCEDFARMING.get() && Configuration.LOADED_ENHANCEDFARMING) {
WildCropGeneration.registerWildEnhancedFarmingCropGeneration();
Wildplants.LOGGER.debug("setup-enhancedfarming");
}
});
}
}
6 changes: 2 additions & 4 deletions src/main/java/wks/wolfkidsounds/wildplants/Wildplants.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import wks.wolfkidsounds.wildplants.block.ModBlocks;
import wks.wolfkidsounds.wildplants.config.Configuration;
import wks.wolfkidsounds.wildplants.config.ImmersiveEngineeringConfig;
import wks.wolfkidsounds.wildplants.config.MinecraftConfig;
import wks.wolfkidsounds.wildplants.config.VeggieWayConfig;
import wks.wolfkidsounds.wildplants.config.*;
import wks.wolfkidsounds.wildplants.item.ModItems;
import wks.wolfkidsounds.wildplants.registry.ModBiomeFeatures;
import wks.wolfkidsounds.wildplants.registry.ModPlacementModifiers;
Expand Down Expand Up @@ -46,6 +43,7 @@ public Wildplants() {
ModLoadingContext.get().registerConfig(net.minecraftforge.fml.config.ModConfig.Type.COMMON, MinecraftConfig.SPEC, "wildplants/mods/minecraft.toml");
ModLoadingContext.get().registerConfig(net.minecraftforge.fml.config.ModConfig.Type.COMMON, ImmersiveEngineeringConfig.SPEC, "wildplants/mods/immersiveengineering.toml");
ModLoadingContext.get().registerConfig(net.minecraftforge.fml.config.ModConfig.Type.COMMON, VeggieWayConfig.SPEC, "wildplants/mods/veggieway.toml");
ModLoadingContext.get().registerConfig(net.minecraftforge.fml.config.ModConfig.Type.COMMON, EnhancedFarmingConfig.SPEC, "wildplants/mods/enhancedfarming.toml");
LOGGER.debug("register-config");

//Registry
Expand Down
32 changes: 24 additions & 8 deletions src/main/java/wks/wolfkidsounds/wildplants/block/ModBlocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,18 @@ public class ModBlocks {
public static final RegistryObject<Block> VEGGIEWAY_WILD_SOYBEAN = registerVeggieWayBlock("veggieway_wild_soybean", () -> new WildCropBlock(MobEffects.GLOWING, 1, Block.Properties.copy(Blocks.TALL_GRASS)));
public static final RegistryObject<Block> VEGGIEWAY_WILD_COTTON = registerVeggieWayBlock("veggieway_wild_cotton", () -> new WildCropBlock(MobEffects.GLOWING, 1, Block.Properties.copy(Blocks.TALL_GRASS)));

//ENHANCEDFARMING
public static final RegistryObject<Block> ENHANCEDFARMING_WILD_MINT = registerEnhancedFarmingBlock("enhancedfarming_wild_mint", () -> new WildCropBlock(MobEffects.GLOWING, 1, Block.Properties.copy(Blocks.TALL_GRASS)));
public static final RegistryObject<Block> ENHANCEDFARMING_WILD_TOMATO = registerEnhancedFarmingBlock("enhancedfarming_wild_tomato", () -> new WildCropBlock(MobEffects.GLOWING, 1, Block.Properties.copy(Blocks.TALL_GRASS)));
public static final RegistryObject<Block> ENHANCEDFARMING_WILD_CUCUMBER = registerEnhancedFarmingBlock("enhancedfarming_wild_cucumber", () -> new WildCropBlock(MobEffects.GLOWING, 1, Block.Properties.copy(Blocks.TALL_GRASS)));
public static final RegistryObject<Block> ENHANCEDFARMING_WILD_AUBERGINE = registerEnhancedFarmingBlock("enhancedfarming_wild_aubergine", () -> new WildCropBlock(MobEffects.GLOWING, 1, Block.Properties.copy(Blocks.TALL_GRASS)));
public static final RegistryObject<Block> ENHANCEDFARMING_WILD_GRAPE = registerEnhancedFarmingBlock("enhancedfarming_wild_grape", () -> new WildCropBlock(MobEffects.GLOWING, 1, Block.Properties.copy(Blocks.TALL_GRASS)));
public static final RegistryObject<Block> ENHANCEDFARMING_WILD_PINEAPPLE = registerEnhancedFarmingBlock("enhancedfarming_wild_pineapple", () -> new WildCropBlock(MobEffects.GLOWING, 1, Block.Properties.copy(Blocks.TALL_GRASS)));
public static final RegistryObject<Block> ENHANCEDFARMING_WILD_CORN = registerEnhancedFarmingBlock("enhancedfarming_wild_corn", () -> new WildCropBlock(MobEffects.GLOWING, 1, Block.Properties.copy(Blocks.TALL_GRASS)));
public static final RegistryObject<Block> ENHANCEDFARMING_WILD_ONION = registerEnhancedFarmingBlock("enhancedfarming_wild_onion", () -> new WildCropBlock(MobEffects.GLOWING, 1, Block.Properties.copy(Blocks.TALL_GRASS)));
public static final RegistryObject<Block> ENHANCEDFARMING_WILD_GARLIC = registerEnhancedFarmingBlock("enhancedfarming_wild_garlic", () -> new WildCropBlock(MobEffects.GLOWING, 1, Block.Properties.copy(Blocks.TALL_GRASS)));
public static final RegistryObject<Block> ENHANCEDFARMING_WILD_LETTUCE = registerEnhancedFarmingBlock("enhancedfarming_wild_lettuce", () -> new WildCropBlock(MobEffects.GLOWING, 1, Block.Properties.copy(Blocks.TALL_GRASS)));

//----------------------------------------------------------------------------------------------
private static <T extends Block> RegistryObject<T> registerMinecraftBlock(String name, Supplier<T> block) {
RegistryObject<T> toReturn = BLOCKS.register(name, block);
Expand All @@ -47,7 +59,7 @@ private static <T extends Block> RegistryObject<T> registerMinecraftBlock(String

private static <T extends Block> RegistryObject<T> registerImmersiveEngineeringBlock(String name, Supplier<T> block) {
RegistryObject<T> toReturn = BLOCKS.register(name, block);
if (Configuration.ENABLE_IMMERSIVEENGINEERING.get() && Configuration.LOADED_IMMERSIVEENGINEERING) {
if (Configuration.LOADED_IMMERSIVEENGINEERING) {
registerBlockItem(name, toReturn);
Wildplants.LOGGER.debug("register-blocks-immersiveengineering");
}
Expand All @@ -56,9 +68,18 @@ private static <T extends Block> RegistryObject<T> registerImmersiveEngineeringB

private static <T extends Block> RegistryObject<T> registerVeggieWayBlock(String name, Supplier<T> block) {
RegistryObject<T> toReturn = BLOCKS.register(name, block);
if (Configuration.ENABLE_VEGGIE_WAY.get() && Configuration.LOADED_VEGGIE_WAY) {
if (Configuration.LOADED_VEGGIE_WAY) {
registerBlockItem(name, toReturn);
Wildplants.LOGGER.debug("register-blocks-immersiveengineering");
Wildplants.LOGGER.debug("register-blocks-veggie_way");
}
return toReturn;
}

private static <T extends Block> RegistryObject<T> registerEnhancedFarmingBlock(String name, Supplier<T> block) {
RegistryObject<T> toReturn = BLOCKS.register(name, block);
if (Configuration.LOADED_ENHANCEDFARMING) {
registerBlockItem(name, toReturn);
Wildplants.LOGGER.debug("register-blocks-enhancedfarming");
}
return toReturn;
}
Expand All @@ -69,9 +90,4 @@ private static <T extends Block> void registerBlockItem(String name, RegistryObj
ModItems.ITEMS.register(name, () -> new BlockItem(block.get(), new Item.Properties().tab(Wildplants.CREATIVE_MODE_TAB)));
Wildplants.LOGGER.debug("register-block-ttems");
}

public static void register(IEventBus eventBus) {
BLOCKS.register(eventBus);
Wildplants.LOGGER.debug("register-modblocks-moditems");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,15 @@ public class Configuration {

BUILDER.push("General");
BUILDER.push("Global_Modifier");
GLOBAL_FREQUENCY = BUILDER
.comment("How often to try to place a patch. (smaller is more) [Default: 64]")
.define("Frequency", 64);
GLOBAL_SPREAD_SIZE = BUILDER
.comment("How far apart crops are planted in a patch. (higher is more) [Default: 6]")
.define("Size", 4);
GLOBAL_FREQUENCY = BUILDER.comment("How often to try to place a patch. (smaller is more) [Default: 64]").define("Frequency", 64);
GLOBAL_SPREAD_SIZE = BUILDER.comment("How far apart crops are planted in a patch. (higher is more) [Default: 6]").define("Size", 4);
BUILDER.pop();
BUILDER.push("Compat");
ENABLE_MINECRAFT = BUILDER
.define("Minecraft", true);
ENABLE_IMMERSIVEENGINEERING = BUILDER
.define("Immersive_Engineering", true);
ENABLE_VEGGIE_WAY = BUILDER
.define("Veggie_Way", true);
ENABLE_HARVESTCRAFT = BUILDER
.define("Harvestcraft", true);
ENABLE_ENHANCEDFARMING = BUILDER
.define("EnhancedFarming", true);
ENABLE_MINECRAFT = BUILDER.define("Minecraft", true);
ENABLE_IMMERSIVEENGINEERING = BUILDER.define("Immersive_Engineering", true);
ENABLE_VEGGIE_WAY = BUILDER.define("Veggie_Way", true);
ENABLE_HARVESTCRAFT = BUILDER.define("Harvestcraft", true);
ENABLE_ENHANCEDFARMING = BUILDER.define("EnhancedFarming", true);
BUILDER.pop();
BUILDER.pop();

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
package wks.wolfkidsounds.wildplants.config;

import net.minecraftforge.common.ForgeConfigSpec;
import wks.wolfkidsounds.wildplants.Wildplants;

public class EnhancedFarmingConfig {
public static final ForgeConfigSpec.Builder BUILDER = new ForgeConfigSpec.Builder();
public static final ForgeConfigSpec SPEC;

//ENHANCEDFARMING
public static ForgeConfigSpec.ConfigValue<Integer> CHANCE_ENHANCEDFARMING_WILD_MINT;
public static ForgeConfigSpec.BooleanValue GENERATE_ENHANCEDFARMING_WILD_MINT;

public static ForgeConfigSpec.ConfigValue<Integer> CHANCE_ENHANCEDFARMING_WILD_TOMATO;
public static ForgeConfigSpec.BooleanValue GENERATE_ENHANCEDFARMING_WILD_TOMATO;

public static ForgeConfigSpec.ConfigValue<Integer> CHANCE_ENHANCEDFARMING_WILD_CUCUMBER;
public static ForgeConfigSpec.BooleanValue GENERATE_ENHANCEDFARMING_WILD_CUCUMBER;

public static ForgeConfigSpec.ConfigValue<Integer> CHANCE_ENHANCEDFARMING_WILD_AUBERGINE;
public static ForgeConfigSpec.BooleanValue GENERATE_ENHANCEDFARMING_WILD_AUBERGINE;

public static ForgeConfigSpec.ConfigValue<Integer> CHANCE_ENHANCEDFARMING_WILD_GRAPE;
public static ForgeConfigSpec.BooleanValue GENERATE_ENHANCEDFARMING_WILD_GRAPE;

public static ForgeConfigSpec.ConfigValue<Integer> CHANCE_ENHANCEDFARMING_WILD_PINEAPPLE;
public static ForgeConfigSpec.BooleanValue GENERATE_ENHANCEDFARMING_WILD_PINEAPPLE;

public static ForgeConfigSpec.ConfigValue<Integer> CHANCE_ENHANCEDFARMING_WILD_CORN;
public static ForgeConfigSpec.BooleanValue GENERATE_ENHANCEDFARMING_WILD_CORN;

public static ForgeConfigSpec.ConfigValue<Integer> CHANCE_ENHANCEDFARMING_WILD_ONION;
public static ForgeConfigSpec.BooleanValue GENERATE_ENHANCEDFARMING_WILD_ONION;

public static ForgeConfigSpec.ConfigValue<Integer> CHANCE_ENHANCEDFARMING_WILD_GARLIC;
public static ForgeConfigSpec.BooleanValue GENERATE_ENHANCEDFARMING_WILD_GARLIC;

public static ForgeConfigSpec.ConfigValue<Integer> CHANCE_ENHANCEDFARMING_WILD_LETTUCE;
public static ForgeConfigSpec.BooleanValue GENERATE_ENHANCEDFARMING_WILD_LETTUCE;

static {
Wildplants.LOGGER.debug("init-enhancedfarming-feature-config");

BUILDER.push("ENHANCEDFARMING WILD MINT");
GENERATE_ENHANCEDFARMING_WILD_MINT = BUILDER.define("Enabled:", true);
CHANCE_ENHANCEDFARMING_WILD_MINT = BUILDER.comment("SMALLER=MORE - Default [64]").defineInRange("Chance:", 64, 0, Integer.MAX_VALUE);
BUILDER.pop();

BUILDER.push("ENHANCEDFARMING WILD TOMATO");
GENERATE_ENHANCEDFARMING_WILD_TOMATO = BUILDER.define("Enabled:", true);
CHANCE_ENHANCEDFARMING_WILD_TOMATO = BUILDER.comment("SMALLER=MORE - Default [64]").defineInRange("Chance:", 64, 0, Integer.MAX_VALUE);
BUILDER.pop();

BUILDER.push("ENHANCEDFARMING WILD CUCUMBER");
GENERATE_ENHANCEDFARMING_WILD_CUCUMBER = BUILDER.define("Enabled:", true);
CHANCE_ENHANCEDFARMING_WILD_CUCUMBER = BUILDER.comment("SMALLER=MORE - Default [64]").defineInRange("Chance:", 64, 0, Integer.MAX_VALUE);
BUILDER.pop();

BUILDER.push("ENHANCEDFARMING WILD AUBERGINE");
GENERATE_ENHANCEDFARMING_WILD_AUBERGINE = BUILDER.define("Enabled:", true);
CHANCE_ENHANCEDFARMING_WILD_AUBERGINE = BUILDER.comment("SMALLER=MORE - Default [64]").defineInRange("Chance:", 64, 0, Integer.MAX_VALUE);
BUILDER.pop();

BUILDER.push("ENHANCEDFARMING WILD GRAPE");
GENERATE_ENHANCEDFARMING_WILD_GRAPE = BUILDER.define("Enabled:", true);
CHANCE_ENHANCEDFARMING_WILD_GRAPE = BUILDER.comment("SMALLER=MORE - Default [64]").defineInRange("Chance:", 64, 0, Integer.MAX_VALUE);
BUILDER.pop();

BUILDER.push("ENHANCEDFARMING WILD PINEAPPLE");
GENERATE_ENHANCEDFARMING_WILD_PINEAPPLE = BUILDER.define("Enabled:", true);
CHANCE_ENHANCEDFARMING_WILD_PINEAPPLE = BUILDER.comment("SMALLER=MORE - Default [64]").defineInRange("Chance:", 64, 0, Integer.MAX_VALUE);
BUILDER.pop();

BUILDER.push("ENHANCEDFARMING WILD CORN");
GENERATE_ENHANCEDFARMING_WILD_CORN = BUILDER.define("Enabled:", true);
CHANCE_ENHANCEDFARMING_WILD_CORN = BUILDER.comment("SMALLER=MORE - Default [64]").defineInRange("Chance:", 64, 0, Integer.MAX_VALUE);
BUILDER.pop();

BUILDER.push("ENHANCEDFARMING WILD ONION");
GENERATE_ENHANCEDFARMING_WILD_ONION = BUILDER.define("Enabled:", true);
CHANCE_ENHANCEDFARMING_WILD_ONION = BUILDER.comment("SMALLER=MORE - Default [64]").defineInRange("Chance:", 64, 0, Integer.MAX_VALUE);
BUILDER.pop();

BUILDER.push("ENHANCEDFARMING WILD GARLIC");
GENERATE_ENHANCEDFARMING_WILD_GARLIC = BUILDER.define("Enabled:", true);
CHANCE_ENHANCEDFARMING_WILD_GARLIC = BUILDER.comment("SMALLER=MORE - Default [64]").define("Patch Size: ", 1);
BUILDER.pop();

BUILDER.push("ENHANCEDFARMING WILD LETTUCE");
GENERATE_ENHANCEDFARMING_WILD_LETTUCE = BUILDER.define("Enabled:", true);
CHANCE_ENHANCEDFARMING_WILD_LETTUCE = BUILDER.comment("SMALLER=MORE - Default [64]").defineInRange("Chance:", 64, 0, Integer.MAX_VALUE);
BUILDER.pop();


SPEC = BUILDER.build();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@


import net.minecraftforge.common.ForgeConfigSpec;
import wks.wolfkidsounds.wildplants.Wildplants;

public class ImmersiveEngineeringConfig {

Expand All @@ -13,12 +14,10 @@ public class ImmersiveEngineeringConfig {
public static ForgeConfigSpec.BooleanValue GENERATE_IMMERSIVEENGINEERING_WILD_HEMP;

static {
Wildplants.LOGGER.debug("init-immersiveengineering-feature-config");
BUILDER.push("IMMERSIVEENGINEERING WILD HEMP");
GENERATE_IMMERSIVEENGINEERING_WILD_HEMP = BUILDER
.define("Enabled:", true);
CHANCE_IMMERSIVEENGINEERING_WILD_HEMP = BUILDER
.comment("SMALLER=MORE - Default [64]")
.defineInRange("Chance:", 64, 0, Integer.MAX_VALUE);
GENERATE_IMMERSIVEENGINEERING_WILD_HEMP = BUILDER.define("Enabled:", true);
CHANCE_IMMERSIVEENGINEERING_WILD_HEMP = BUILDER.comment("SMALLER=MORE - Default [64]").defineInRange("Chance:", 64, 0, Integer.MAX_VALUE);
BUILDER.pop();

SPEC = BUILDER.build();
Expand Down
Loading

0 comments on commit 374c929

Please sign in to comment.