Skip to content

Commit

Permalink
feat: add Overweight Farming compat
Browse files Browse the repository at this point in the history
  • Loading branch information
Elenterius committed Dec 2, 2024
1 parent 538ab42 commit adabe0b
Show file tree
Hide file tree
Showing 73 changed files with 2,507 additions and 20 deletions.
3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,8 @@ dependencies {
datagenImplementation fg.deobf("maven.modrinth:farmers-delight:1.20.1-1.2.5")
datagenImplementation fg.deobf("curse.maven:alexs-delight-556448:5028450")

// implementation fg.deobf("maven.modrinth:overweight-farming:1.20.1-2.1.0-forge")
implementation fg.deobf("maven.modrinth:overweight-farming:1.20.1-2.1.0-forge")
datagenImplementation fg.deobf("maven.modrinth:overweight-farming:1.20.1-2.1.0-forge")

datagenImplementation sourceSets.main.output
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
import net.minecraft.world.item.Items;
import net.minecraftforge.common.Tags;
import net.minecraftforge.registries.RegistryObject;
import net.orcinus.overweightfarming.OverweightFarming;
import net.orcinus.overweightfarming.init.OFBlocks;
import net.orcinus.overweightfarming.init.OFItems;
import vectorwing.farmersdelight.FarmersDelight;

import java.util.List;
Expand All @@ -54,6 +57,7 @@ protected void buildRecipes(Consumer<FinishedRecipe> consumer) {
buildBiomesOPlentyRecipes(consumer);

buildFarmersDelightRecipes(consumer);
buildOverweightFarmingRecipes(consumer);

buildAlexsMobsRecipes(consumer);
buildAlexsDelightRecipes(consumer);
Expand Down Expand Up @@ -424,6 +428,10 @@ private DecomposingRecipeBuilder farmersDelightRecipe() {
return DecomposingRecipeBuilder.create().ifModLoaded(FarmersDelight.MODID);
}

private DecomposingRecipeBuilder overweightFarmingRecipe() {
return DecomposingRecipeBuilder.create().ifModLoaded(OverweightFarming.MODID);
}

private DecomposingRecipeBuilder alexsMobsRecipe() {
return DecomposingRecipeBuilder.create().ifModLoaded(AlexsMobs.MODID);
}
Expand Down Expand Up @@ -461,6 +469,70 @@ class FarmersDelightItems extends vectorwing.farmersdelight.common.registry.ModI
.unlockedBy(FarmersDelightItems.HAM).save(consumer);
}

private void buildOverweightFarmingRecipes(Consumer<FinishedRecipe> consumer) {
overweightFarmingRecipe()
.setIngredient(OFItems.VEGETABLE_PEELS.get())
.addOutput(ModItems.ORGANIC_MATTER.get(), 2, 4)
.unlockedBy(OFItems.VEGETABLE_PEELS.get()).save(consumer);

overweightFarmingRecipe()
.setIngredient(OFBlocks.OVERWEIGHT_COCOA.get())
.addOutput(ModItems.ORGANIC_MATTER.get(), 2 * 10, 4 * 10)
.unlockedBy(OFBlocks.OVERWEIGHT_COCOA.get()).save(consumer);

overweightFarmingRecipe()
.setIngredient(OFBlocks.PEELED_OVERWEIGHT_COCOA.get())
.addOutput(ModItems.ORGANIC_MATTER.get(), 2 * 10 - 2, 4 * 10 - 4)
.unlockedBy(OFBlocks.OVERWEIGHT_COCOA.get()).save(consumer);

overweightFarmingRecipe()
.setIngredient(OFBlocks.OVERWEIGHT_APPLE.get())
.addOutput(ModItems.ORGANIC_MATTER.get(), 10, 2 * 10)
.unlockedBy(OFBlocks.OVERWEIGHT_APPLE.get()).save(consumer);

overweightFarmingRecipe()
.setIngredient(OFBlocks.OVERWEIGHT_BEETROOT.get())
.addOutput(ModItems.ORGANIC_MATTER.get(), 2 * 10, 4 * 10)
.unlockedBy(OFBlocks.OVERWEIGHT_BEETROOT.get()).save(consumer);

overweightFarmingRecipe()
.setIngredient(OFBlocks.OVERWEIGHT_CARROT.get())
.addOutput(ModItems.ORGANIC_MATTER.get(), 10, 2 * 10)
.unlockedBy(OFBlocks.OVERWEIGHT_CARROT.get()).save(consumer);

overweightFarmingRecipe()
.setIngredient(OFBlocks.OVERWEIGHT_POTATO.get())
.addOutput(ModItems.ORGANIC_MATTER.get(), 10, 2 * 10)
.unlockedBy(OFBlocks.OVERWEIGHT_POTATO.get()).save(consumer);

overweightFarmingRecipe()
.setIngredient(OFBlocks.OVERWEIGHT_POISONOUS_POTATO.get())
.addOutput(ModItems.TOXIN_EXTRACT.get(), 2 * 10, 4 * 10)
.addOutput(ModItems.ORGANIC_MATTER.get(), 10, 3 * 10)
.unlockedBy(OFBlocks.OVERWEIGHT_POISONOUS_POTATO.get()).save(consumer);

overweightFarmingRecipe()
.setIngredient(OFBlocks.OVERWEIGHT_BAKED_POTATO.get())
.addOutput(ModItems.ORGANIC_MATTER.get(), 2 * 10, 5 * 10)
.unlockedBy(OFBlocks.OVERWEIGHT_BAKED_POTATO.get()).save(consumer);

overweightFarmingRecipe()
.setIngredient(OFBlocks.OVERWEIGHT_NETHER_WART.get())
.addOutput(ModItems.ORGANIC_MATTER.get(), 10, 2 * 10)
.addOutput(ModItems.EXOTIC_DUST.get(), 4, 10)
.unlockedBy(OFBlocks.OVERWEIGHT_NETHER_WART.get()).save(consumer);

overweightFarmingRecipe().ifModLoaded(FarmersDelight.MODID)
.setIngredient(OFBlocks.OVERWEIGHT_CABBAGE.get())
.addOutput(ModItems.ORGANIC_MATTER.get(), 10, 2 * 10)
.unlockedBy(OFBlocks.OVERWEIGHT_CABBAGE.get()).save(consumer);

overweightFarmingRecipe().ifModLoaded(FarmersDelight.MODID)
.setIngredient(OFBlocks.OVERWEIGHT_ONION.get())
.addOutput(ModItems.ORGANIC_MATTER.get(), 10, 2 * 10)
.unlockedBy(OFBlocks.OVERWEIGHT_ONION.get()).save(consumer);
}

private void buildAlexsMobsRecipes(Consumer<FinishedRecipe> consumer) {
alexsMobsRecipe()
.setIngredient(AMItemRegistry.BEAR_FUR)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@
import net.minecraftforge.common.Tags;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.RegistryObject;
import net.orcinus.overweightfarming.OverweightFarming;
import net.orcinus.overweightfarming.init.OFBlocks;
import net.orcinus.overweightfarming.init.OFItems;
import vectorwing.farmersdelight.FarmersDelight;
import vectorwing.farmersdelight.common.FoodValues;

import java.util.List;
import java.util.function.Consumer;
Expand Down Expand Up @@ -64,6 +68,7 @@ protected void buildRecipes(Consumer<FinishedRecipe> consumer) {
buildFromOrganicRecipes(consumer);

buildFarmersDelightRecipes(consumer);
buildOverweightFarmingRecipes(consumer);

buildAlexsMobsRecipes(consumer);
buildAlexsCavesRecipes(consumer);
Expand Down Expand Up @@ -155,6 +160,10 @@ private DigesterRecipeBuilder farmersDelightRecipe(int count, ItemLike ingredien
return nutrientPasteRecipe(count, ingredient).ifModLoaded(FarmersDelight.MODID);
}

private DigesterRecipeBuilder overweightFarmingRecipe(int count, ItemLike ingredient) {
return nutrientPasteRecipe(count, ingredient).ifModLoaded(OverweightFarming.MODID);
}

private DigesterRecipeBuilder alexsMobsRecipe(int count, ItemLike ingredient) {
return nutrientPasteRecipe(count, ingredient).ifModLoaded(AlexsMobs.MODID);
}
Expand All @@ -181,6 +190,50 @@ class FarmersDelightItems extends vectorwing.farmersdelight.common.registry.ModI
farmersDelightRecipe(4 * 2 + 2, FarmersDelightItems.HOT_COCOA.get()).setCraftingCost(3).addCraftingTimeModifier(30).save(consumer);
}

private void buildOverweightFarmingRecipes(Consumer<FinishedRecipe> consumer) {
int peelNutrition = 1;
overweightFarmingRecipe(peelNutrition, OFItems.VEGETABLE_PEELS.get()).save(consumer);

int seedNutrition = 1;
overweightFarmingRecipe(7 * Foods.MELON_SLICE.getNutrition() - peelNutrition, OFBlocks.SEEDED_PEELED_MELON.get()).setCraftingCost(3).addCraftingTimeModifier(25).save(consumer);
overweightFarmingRecipe(7 * Foods.MELON_SLICE.getNutrition() - peelNutrition - seedNutrition, OFBlocks.HALF_SEEDED_PEELED_MELON.get()).setCraftingCost(3).addCraftingTimeModifier(20).save(consumer);
overweightFarmingRecipe(7 * Foods.MELON_SLICE.getNutrition() - peelNutrition - seedNutrition * 2, OFBlocks.SEEDLESS_PEELED_MELON.get()).setCraftingCost(3).addCraftingTimeModifier(15).save(consumer);

overweightFarmingRecipe(Foods.CARROT.getNutrition() * 10, OFBlocks.OVERWEIGHT_CARROT.get()).setCraftingCost(3).addCraftingTimeModifier(30).save(consumer);
overweightFarmingRecipe(Foods.BEETROOT.getNutrition() * 10, OFBlocks.OVERWEIGHT_BEETROOT.get()).setCraftingCost(3).addCraftingTimeModifier(30).save(consumer);
overweightFarmingRecipe(Foods.POTATO.getNutrition() * 10, OFBlocks.OVERWEIGHT_POTATO.get()).setCraftingCost(3).addCraftingTimeModifier(30).save(consumer);
overweightFarmingRecipe(Foods.POISONOUS_POTATO.getNutrition() * 10, OFBlocks.OVERWEIGHT_POISONOUS_POTATO.get()).setCraftingCost(3).addCraftingTimeModifier(30).save(consumer);
overweightFarmingRecipe(Foods.BAKED_POTATO.getNutrition() * 10, OFBlocks.OVERWEIGHT_BAKED_POTATO.get()).setCraftingCost(3).addCraftingTimeModifier(30).save(consumer);

overweightFarmingRecipe(4 * 10, OFBlocks.OVERWEIGHT_COCOA.get()).setCraftingCost(3).addCraftingTimeModifier(60).save(consumer);
overweightFarmingRecipe(4 * 10 - peelNutrition, OFBlocks.PEELED_OVERWEIGHT_COCOA.get()).setCraftingCost(3).addCraftingTimeModifier(45).save(consumer);
overweightFarmingRecipe(2 * 10, OFBlocks.OVERWEIGHT_NETHER_WART.get()).setCraftingCost(2 * 10 - 2).addCraftingTimeModifier(30).save(consumer);

overweightFarmingRecipe(Foods.APPLE.getNutrition() * 10, OFBlocks.OVERWEIGHT_APPLE.get()).setCraftingCost(3).addCraftingTimeModifier(30).save(consumer);
overweightFarmingRecipe(Foods.GOLDEN_APPLE.getNutrition() * 10, OFBlocks.OVERWEIGHT_GOLDEN_APPLE.get()).setCraftingCost(3).addCraftingTimeModifier(60).save(consumer);

overweightFarmingRecipe(FoodValues.ONION.getNutrition() * 10, OFBlocks.OVERWEIGHT_ONION.get()).ifModLoaded(FarmersDelight.MODID)
.setCraftingCost(3).addCraftingTimeModifier(30)
.save(consumer);
overweightFarmingRecipe(FoodValues.CABBAGE.getNutrition() * 10, OFBlocks.OVERWEIGHT_CABBAGE.get()).ifModLoaded(FarmersDelight.MODID)
.setCraftingCost(3).addCraftingTimeModifier(30)
.save(consumer);

overweightFarmingRecipe(10, OFBlocks.OVERWEIGHT_KIWI.get()).ifModLoaded("hedgehog")
.setCraftingCost(3).addCraftingTimeModifier(30)
.save(consumer);
overweightFarmingRecipe(10 - peelNutrition, OFBlocks.PEELED_OVERWEIGHT_KIWI.get()).ifModLoaded("hedgehog")
.setCraftingCost(3).addCraftingTimeModifier(20)
.save(consumer);

overweightFarmingRecipe(10, OFBlocks.OVERWEIGHT_GINGER.get()).ifModLoaded("snowyspirit")
.setCraftingCost(3).addCraftingTimeModifier(30)
.save(consumer);
overweightFarmingRecipe(10 - peelNutrition, OFBlocks.PEELED_OVERWEIGHT_GINGER.get()).ifModLoaded("snowyspirit")
.setCraftingCost(3).addCraftingTimeModifier(25)
.save(consumer);
}

private void buildAlexsMobsRecipes(Consumer<FinishedRecipe> consumer) {
alexsMobsRecipe(1, AMBlockRegistry.CAIMAN_EGG.get()).save(consumer);
alexsMobsRecipe(1, AMBlockRegistry.CROCODILE_EGG.get()).save(consumer);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"advancements": [
{
"advancement": {
"parent": "minecraft:recipes/root",
"criteria": {
"has_overweight_apple_block": {
"conditions": {
"items": [
{
"items": [
"overweight_farming:overweight_apple_block"
]
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_the_recipe": {
"conditions": {
"recipe": "biomancy:decomposing/overweight_apple_block"
},
"trigger": "minecraft:recipe_unlocked"
}
},
"requirements": [
[
"has_overweight_apple_block",
"has_the_recipe"
]
],
"rewards": {
"recipes": [
"biomancy:decomposing/overweight_apple_block"
]
},
"sends_telemetry_event": false
},
"conditions": [
{
"type": "forge:mod_loaded",
"modid": "overweight_farming"
}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"advancements": [
{
"advancement": {
"parent": "minecraft:recipes/root",
"criteria": {
"has_overweight_baked_potato_block": {
"conditions": {
"items": [
{
"items": [
"overweight_farming:overweight_baked_potato_block"
]
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_the_recipe": {
"conditions": {
"recipe": "biomancy:decomposing/overweight_baked_potato_block"
},
"trigger": "minecraft:recipe_unlocked"
}
},
"requirements": [
[
"has_overweight_baked_potato_block",
"has_the_recipe"
]
],
"rewards": {
"recipes": [
"biomancy:decomposing/overweight_baked_potato_block"
]
},
"sends_telemetry_event": false
},
"conditions": [
{
"type": "forge:mod_loaded",
"modid": "overweight_farming"
}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"advancements": [
{
"advancement": {
"parent": "minecraft:recipes/root",
"criteria": {
"has_overweight_beetroot_block": {
"conditions": {
"items": [
{
"items": [
"overweight_farming:overweight_beetroot_block"
]
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_the_recipe": {
"conditions": {
"recipe": "biomancy:decomposing/overweight_beetroot_block"
},
"trigger": "minecraft:recipe_unlocked"
}
},
"requirements": [
[
"has_overweight_beetroot_block",
"has_the_recipe"
]
],
"rewards": {
"recipes": [
"biomancy:decomposing/overweight_beetroot_block"
]
},
"sends_telemetry_event": false
},
"conditions": [
{
"type": "forge:mod_loaded",
"modid": "overweight_farming"
}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"advancements": [
{
"advancement": {
"parent": "minecraft:recipes/root",
"criteria": {
"has_overweight_cabbage_block": {
"conditions": {
"items": [
{
"items": [
"overweight_farming:overweight_cabbage_block"
]
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_the_recipe": {
"conditions": {
"recipe": "biomancy:decomposing/overweight_cabbage_block"
},
"trigger": "minecraft:recipe_unlocked"
}
},
"requirements": [
[
"has_overweight_cabbage_block",
"has_the_recipe"
]
],
"rewards": {
"recipes": [
"biomancy:decomposing/overweight_cabbage_block"
]
},
"sends_telemetry_event": false
},
"conditions": [
{
"type": "forge:mod_loaded",
"modid": "overweight_farming"
},
{
"type": "forge:mod_loaded",
"modid": "farmersdelight"
}
]
}
]
}
Loading

0 comments on commit adabe0b

Please sign in to comment.