From 99a2e73d1848d0a26f5e5075a23fe60a31a136e6 Mon Sep 17 00:00:00 2001 From: KrLite <68179735+KrLite@users.noreply.github.com> Date: Sun, 17 Sep 2023 15:02:58 +0800 Subject: [PATCH] threads --- .../cabricality/content/core/TechThread.java | 12 +- .../content/core/threads/CopperThread.java | 78 +++-- .../content/core/threads/EnderiumThread.java | 29 +- .../content/core/threads/FluixThread.java | 261 +++++++++----- .../content/core/threads/InvarThread.java | 325 ++++++++++++------ .../content/core/threads/MathThread.java | 60 ++-- .../content/core/threads/ObsidianThread.java | 13 +- .../content/core/threads/ZincThread.java | 44 ++- 8 files changed, 544 insertions(+), 278 deletions(-) diff --git a/src/main/java/com/dm/earth/cabricality/content/core/TechThread.java b/src/main/java/com/dm/earth/cabricality/content/core/TechThread.java index 2ea2127f..db1b0510 100644 --- a/src/main/java/com/dm/earth/cabricality/content/core/TechThread.java +++ b/src/main/java/com/dm/earth/cabricality/content/core/TechThread.java @@ -18,9 +18,15 @@ public interface TechThread { List THREADS = List.of( - new AndesiteThread(), new BrassThread(), new CopperThread(), - new ZincThread(), new ObsidianThread(), new InvarThread(), - new EnderiumThread(), new FluixThread(), new MathThread() + new AndesiteThread(), + new BrassThread(), + new CopperThread(), + new ZincThread(), + new ObsidianThread(), + new InvarThread(), + new EnderiumThread(), + new FluixThread(), + new MathThread() ); default void addRecipes(AddRecipesCallback.RecipeHandler handler) {} diff --git a/src/main/java/com/dm/earth/cabricality/content/core/threads/CopperThread.java b/src/main/java/com/dm/earth/cabricality/content/core/threads/CopperThread.java index a08623fd..a0f07a84 100644 --- a/src/main/java/com/dm/earth/cabricality/content/core/threads/CopperThread.java +++ b/src/main/java/com/dm/earth/cabricality/content/core/threads/CopperThread.java @@ -13,8 +13,9 @@ import net.minecraft.fluid.Fluids; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; +import net.minecraft.recipe.CookingCategory; import net.minecraft.recipe.Ingredient; -import net.minecraft.tag.ItemTags; +import net.minecraft.registry.tag.ItemTags; import net.minecraft.util.Identifier; import org.jetbrains.annotations.Contract; import org.jetbrains.annotations.NotNull; @@ -34,44 +35,75 @@ public class CopperThread implements TechThread { @Override public void addRecipes(AddRecipesCallback.@NotNull RecipeHandler handler) { - handler.register(recipeId("crafting", "belt_connector"), - id -> VanillaRecipeBuilders.shapedRecipe("XXX", "XXX") + handler.register( + recipeId("crafting", "belt_connector"), + id -> VanillaRecipeBuilders + .shapedRecipe("XXX", "XXX") .ingredient('X', CabfItems.CURED_RUBBER) - .output(new ItemStack(CR.asItem("belt_connector"), 3)).build(id, "")); + .output(new ItemStack(CR.asItem("belt_connector"), 3)) + .build(id, "") + ); - handler.register(recipeId("smelting", "cured_rubber"), - id -> VanillaRecipeBuilders.smeltingRecipe(id, "", + handler.register( + recipeId("smelting", "cured_rubber"), + id -> VanillaRecipeBuilders.smeltingRecipe( + id, "", Ingredient.ofItems(CabfItems.RUBBER), - CabfItems.CURED_RUBBER.getDefaultStack(), 0.1F, 120)); + CookingCategory.MISC, + CabfItems.CURED_RUBBER.getDefaultStack(), + 0.1F, 120 + ) + ); - handler.register(recipeId("crafting", "sealed_mechanism"), - id -> VanillaRecipeBuilders.shapedRecipe("XOX") + handler.register( + recipeId("crafting", "sealed_mechanism"), + id -> VanillaRecipeBuilders + .shapedRecipe("XOX") .ingredient('X', Ingredient.ofItems(CabfItems.CURED_RUBBER)) .ingredient('O', Ingredient.ofItems(CABF.asItem("kinetic_mechanism"))) - .output(CABF.asItem("sealed_mechanism").getDefaultStack()).build(id, "")); + .output(CABF.asItem("sealed_mechanism").getDefaultStack()) + .build(id, "") + ); - handler.register(recipeId("crafting", "copper_machine"), - id -> RecipeBuilderUtil.donutRecipe(id, CR.asItem("copper_casing"), - CABF.asItem("sealed_mechanism"), CABF.asItem("copper_machine"), 1)); + handler.register( + recipeId("crafting", "copper_machine"), + id -> RecipeBuilderUtil.donutRecipe( + id, + CR.asItem("copper_casing"), + CABF.asItem("sealed_mechanism"), + CABF.asItem("copper_machine"), + 1 + ) + ); - handler.register(recipeId("compacting", "rubber"), + handler.register( + recipeId("compacting", "rubber"), id -> new CompactingRecipe(new FreePRP(id) .setFluidIngredient(FluidIngredient.fromFluid(CabfFluids.RESIN, FluidConstants.BOTTLE)) - .setResult(new ProcessingOutput(CabfItems.RUBBER.getDefaultStack(), 1)))); + .setResult(new ProcessingOutput(CabfItems.RUBBER.getDefaultStack(), 1))) + ); - handler.register(recipeId("compacting", "rubber_from_flower"), + handler.register( + recipeId("compacting", "rubber_from_flower"), id -> new CompactingRecipe(new FreePRP(id) .setFluidIngredient(FluidIngredient.fromFluid(Fluids.WATER, FluidConstants.BOTTLE)) - .setIngredient(Ingredient.ofTag(ItemTags.FLOWERS), Ingredient.ofTag(ItemTags.FLOWERS), - Ingredient.ofTag(ItemTags.FLOWERS), Ingredient.ofTag(ItemTags.FLOWERS)) - .setResult(new ProcessingOutput(CabfItems.RUBBER.getDefaultStack(), 1)))); + .setIngredient( + Ingredient.ofTag(ItemTags.FLOWERS), Ingredient.ofTag(ItemTags.FLOWERS), + Ingredient.ofTag(ItemTags.FLOWERS), Ingredient.ofTag(ItemTags.FLOWERS) + ) + .setResult(new ProcessingOutput(CabfItems.RUBBER.getDefaultStack(), 1))) + ); - handler.register(recipeId("compacting", "rubber_from_vine"), + handler.register( + recipeId("compacting", "rubber_from_vine"), id -> new CompactingRecipe(new FreePRP(id) .setFluidIngredient(FluidIngredient.fromFluid(Fluids.WATER, FluidConstants.BOTTLE)) - .setIngredient(Ingredient.ofItems(Items.VINE), Ingredient.ofItems(Items.VINE), - Ingredient.ofItems(Items.VINE), Ingredient.ofItems(Items.VINE)) - .setResult(new ProcessingOutput(CabfItems.RUBBER.getDefaultStack(), 1)))); + .setIngredient( + Ingredient.ofItems(Items.VINE), Ingredient.ofItems(Items.VINE), + Ingredient.ofItems(Items.VINE), Ingredient.ofItems(Items.VINE) + ) + .setResult(new ProcessingOutput(CabfItems.RUBBER.getDefaultStack(), 1))) + ); } @Override diff --git a/src/main/java/com/dm/earth/cabricality/content/core/threads/EnderiumThread.java b/src/main/java/com/dm/earth/cabricality/content/core/threads/EnderiumThread.java index 174897e4..243f26b3 100644 --- a/src/main/java/com/dm/earth/cabricality/content/core/threads/EnderiumThread.java +++ b/src/main/java/com/dm/earth/cabricality/content/core/threads/EnderiumThread.java @@ -35,21 +35,32 @@ public void load() { @Override public void addRecipes(AddRecipesCallback.RecipeHandler handler) { - handler.register(recipeId("crafting", "enderium_machine"), - id -> VanillaRecipeBuilders.shapedRecipe("SSS", "SCS", "SSS") + handler.register( + recipeId("crafting", "enderium_machine"), + id -> VanillaRecipeBuilders + .shapedRecipe("SSS", "SCS", "SSS") .ingredient('S', CABF.asIngredient("abstruse_mechanism")) .ingredient('C', CABF.asIngredient("enderium_casing")) - .output(CABF.asStack("enderium_machine")).build(id, "")); + .output(CABF.asStack("enderium_machine")) + .build(id, "") + ); - handler.register(recipeId("melting", "dark_amaranth_fungus"), - id -> RecipeManager.deserialize(id, - RecipeBuilderUtil.generateMelting(PM.id("dark_amaranth_fungus"), - TC.id("ender_slime"), FluidConstants.BOTTLE, null, 0, 100, 10))); + handler.register( + recipeId("melting", "dark_amaranth_fungus"), + id -> RecipeManager.deserialize(id, RecipeBuilderUtil.generateMelting( + PM.id("dark_amaranth_fungus"), + TC.id("ender_slime"), + FluidConstants.BOTTLE, + null, 0, 100, 10 + )) + ); - handler.register(recipeId("item_application", "enderium_casing"), + handler.register( + recipeId("item_application", "enderium_casing"), id -> new ManualApplicationRecipe(new FreePRP(id) .setIngredient(MC.asIngredient("obsidian"), CABF.asIngredient("enderium_ingot")) - .setResult(CABF.asProcessingOutput("enderium_casing")))); + .setResult(CABF.asProcessingOutput("enderium_casing"))) + ); } @Override diff --git a/src/main/java/com/dm/earth/cabricality/content/core/threads/FluixThread.java b/src/main/java/com/dm/earth/cabricality/content/core/threads/FluixThread.java index b8083701..ba4ca2fe 100644 --- a/src/main/java/com/dm/earth/cabricality/content/core/threads/FluixThread.java +++ b/src/main/java/com/dm/earth/cabricality/content/core/threads/FluixThread.java @@ -8,6 +8,11 @@ import com.simibubi.create.content.fluids.transfer.EmptyingRecipe; import com.simibubi.create.content.fluids.transfer.FillingRecipe; import com.simibubi.create.content.processing.recipe.HeatCondition; +import io.github.fabricators_of_create.porting_lib.fluids.FluidStack; +import net.minecraft.registry.Registries; +import net.minecraft.registry.RegistryKeys; +import net.minecraft.registry.tag.ItemTags; +import net.minecraft.registry.tag.TagKey; import org.jetbrains.annotations.Contract; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -50,8 +55,7 @@ public void load() { MechAndSmithCraft.addEntry(entry(AE2.id("condenser"), 1, AE2.id("fluix_pearl"))); MechAndSmithCraft.addEntry(entry(AE2.id("drive"), 1, AE2.id("engineering_processor"))); MechAndSmithCraft.addEntry(entry(AE2.id("formation_core"), 4, AE2.id("logic_processor"))); - MechAndSmithCraft - .addEntry(entry(AE2.id("annihilation_core"), 4, AE2.id("calculation_processor"))); + MechAndSmithCraft.addEntry(entry(AE2.id("annihilation_core"), 4, AE2.id("calculation_processor"))); MechAndSmithCraft.addEntry(entry(AE2.id("chest"), 1, MC.id("chest"))); } @@ -63,143 +67,218 @@ public String getLevel() { @SuppressWarnings("UnstableApiUsage") @Override public void addRecipes(AddRecipesCallback.RecipeHandler handler) { - handler.register(recipeId("crafting", "flash_drive"), - id -> VanillaRecipeBuilders.shapedRecipe("SCA") + handler.register( + recipeId("crafting", "flash_drive"), + id -> VanillaRecipeBuilders + .shapedRecipe("SCA") .ingredient('A', TC.asIngredient("cobalt_ingot")) .ingredient('C', AE2.asIngredient("logic_processor")) .ingredient('S', MC.asIngredient("iron_ingot")) - .output(CABF.asStack("flash_drive")).build(id, "")); + .output(CABF.asStack("flash_drive")) + .build(id, "") + ); - handler.register(recipeId("crafting", "controller"), - id -> RecipeBuilderUtil.donutRecipe(id, CABF.asItem("fluix_casing"), - CABF.asItem("calculation_mechanism"), AE2.asItem("controller"), 1)); + handler.register( + recipeId("crafting", "controller"), + id -> RecipeBuilderUtil.donutRecipe( + id, CABF.asItem("fluix_casing"), + CABF.asItem("calculation_mechanism"), + AE2.asItem("controller"), 1) + ); - handler.register(recipeId("stonecutting", "silicon_press"), - id -> VanillaRecipeBuilders.stonecuttingRecipe(id, "", + handler.register( + recipeId("stonecutting", "silicon_press"), + id -> VanillaRecipeBuilders.stonecuttingRecipe( + id, "", Ingredient.ofItems(CABF.asItem("circuit_scrap")), - AE2.asStack("silicon_press"))); + AE2.asStack("silicon_press") + ) + ); - handler.register(recipeId("stonecutting", "engineering_processor_press"), - id -> VanillaRecipeBuilders.stonecuttingRecipe(id, "", + handler.register( + recipeId("stonecutting", "engineering_processor_press"), + id -> VanillaRecipeBuilders.stonecuttingRecipe( + id, "", Ingredient.ofItems(CABF.asItem("circuit_scrap")), - AE2.asStack("engineering_processor_press"))); + AE2.asStack("engineering_processor_press") + ) + ); - handler.register(recipeId("stonecutting", "calculation_processor_press"), - id -> VanillaRecipeBuilders.stonecuttingRecipe(id, "", + handler.register( + recipeId("stonecutting", "calculation_processor_press"), + id -> VanillaRecipeBuilders.stonecuttingRecipe( + id, "", Ingredient.ofItems(CABF.asItem("circuit_scrap")), - AE2.asStack("calculation_processor_press"))); + AE2.asStack("calculation_processor_press") + ) + ); - handler.register(recipeId("stonecutting", "logic_processor_press"), - id -> VanillaRecipeBuilders.stonecuttingRecipe(id, "", + handler.register( + recipeId("stonecutting", "logic_processor_press"), + id -> VanillaRecipeBuilders.stonecuttingRecipe( + id, "", Ingredient.ofItems(CABF.asItem("circuit_scrap")), - AE2.asStack("logic_processor_press"))); + AE2.asStack("logic_processor_press") + ) + ); handler.register(recipeId("crafting", "circuit_scrap"), id -> VanillaRecipeBuilders.shapedRecipe(" A ", "ABA", " A ") .ingredient('A', CabfItems.INVAR_INGOT) - .ingredient('B', TagKey.of(Registry.ITEM_KEY, CABF.id("circuit_press"))) - .output(CABF.asStack(2, "circuit_scrap")).build(id, "")); + .ingredient('B', TagKey.of(RegistryKeys.ITEM, CABF.id("circuit_press"))) + .output(CABF.asStack(2, "circuit_scrap")) + .build(id, "") + ); - handler.register(recipeId("deploying", "printed_silicon"), + handler.register( + recipeId("deploying", "printed_silicon"), id -> new DeployerApplicationRecipe(new FreePRP(id) - .setIngredient(Ingredient.ofItems(AE2.asItem("silicon")), - Ingredient.ofItems(AE2.asItem("silicon_press"))) - .keepHeldItem().setResult(AE2.asProcessingOutput("printed_silicon")))); - - handler.register(recipeId("crushing", "blizz_cube"), - id -> new CrushingRecipe( - new FreePRP(id).setIngredient(CABF.asIngredient("blizz_cube")) - .setResult(CABF.asProcessingOutput(1, 2, "blizz_powder"), - CABF.asProcessingOutput(0.5F, 1, "blizz_powder")) - .setProcessingTime(350))); - - handler.register(recipeId("crushing", "basalz_shard"), - id -> new CrushingRecipe( - new FreePRP(id).setIngredient(CABF.asIngredient("basalz_shard")) - .setResult(CABF.asProcessingOutput(1, 2, "basalz_powder"), - CABF.asProcessingOutput(0.5F, 1, "basalz_powder")) - .setProcessingTime(350))); + .setIngredient( + Ingredient.ofItems(AE2.asItem("silicon")), + Ingredient.ofItems(AE2.asItem("silicon_press")) + ) + .keepHeldItem().setResult(AE2.asProcessingOutput("printed_silicon")) + ) + ); + + handler.register( + recipeId("crushing", "blizz_cube"), + id -> new CrushingRecipe(new FreePRP(id) + .setIngredient(CABF.asIngredient("blizz_cube")) + .setResult( + CABF.asProcessingOutput(1, 2, "blizz_powder"), + CABF.asProcessingOutput(0.5F, 1, "blizz_powder") + ) + .setProcessingTime(350)) + ); + + handler.register( + recipeId("crushing", "basalz_shard"), + id -> new CrushingRecipe(new FreePRP(id) + .setIngredient(CABF.asIngredient("basalz_shard")) + .setResult( + + CABF.asProcessingOutput(1, 2, "basalz_powder"), + CABF.asProcessingOutput(0.5F, 1, "basalz_powder") + ) + .setProcessingTime(350)) + ); var blizz = CABF.asIngredient("blizz_powder"); var basalz = CABF.asIngredient("basalz_powder"); - handler.register(recipeId("splashing", "sandstone"), - id -> new SplashingRecipe( - new FreePRP(id).setIngredient(MC.asIngredient("sandstone")) - .setResult(CABF.asProcessingOutput(0.65F, "sand_ball")))); - handler.register(recipeId("compacting", "ice_charge"), + handler.register( + recipeId("splashing", "sandstone"), + id -> new SplashingRecipe(new FreePRP(id) + .setIngredient(MC.asIngredient("sandstone")) + .setResult(CABF.asProcessingOutput(0.65F, "sand_ball"))) + ); + + handler.register( + recipeId("compacting", "ice_charge"), id -> new CompactingRecipe(new FreePRP(id) .setIngredient(blizz, blizz, blizz, blizz, blizz, blizz, blizz, blizz) - .setResult(CABF.asProcessingOutput("ice_charge")))); + .setResult(CABF.asProcessingOutput("ice_charge"))) + ); - handler.register(recipeId("compacting", "earth_charge"), - id -> new CompactingRecipe( - new FreePRP(id) - .setIngredient(basalz, basalz, basalz, basalz, basalz, basalz, - basalz, basalz) - .setResult(CABF.asProcessingOutput("earth_charge")))); + handler.register( + recipeId("compacting", "earth_charge"), + id -> new CompactingRecipe(new FreePRP(id) + .setIngredient(basalz, basalz, basalz, basalz, basalz, basalz, basalz, basalz) + .setResult(CABF.asProcessingOutput("earth_charge"))) + ); // Coke Processing - handler.register(recipeId("compacting", "coal"), + handler.register( + recipeId("compacting", "coal"), id -> new CompactingRecipe(new FreePRP(id) .setIngredient(Ingredient.ofTag(ItemTags.COALS)) .setFluidResult(new FluidStack(CabfFluids.COKE, FluidConstants.INGOT)) - .setHeatRequirement(HeatCondition.HEATED))); + .setHeatRequirement(HeatCondition.HEATED)) + ); - handler.register(recipeId("filling", "coal"), + handler.register( + recipeId("filling", "coal"), id -> new FillingRecipe(new FreePRP(id) .setIngredient(Ingredient.ofTag(ItemTags.COALS)) - .setFluidIngredient( - FluidIngredient.fromFluid(CabfFluids.COKE, FluidConstants.BOTTLE)) - .setResult(CABF.asProcessingOutput("coal_coke")))); + .setFluidIngredient(FluidIngredient.fromFluid(CabfFluids.COKE, FluidConstants.BOTTLE)) + .setResult(CABF.asProcessingOutput("coal_coke"))) + ); - handler.register(recipeId("compacting", "coal_coke"), + handler.register( + recipeId("compacting", "coal_coke"), id -> new CompactingRecipe(new FreePRP(id) .setIngredient(CABF.asIngredient("coal_coke")) - .setFluidIngredient( - FluidIngredient.fromFluid(Fluids.WATER, FluidConstants.INGOT)) - .setResult(MC.asProcessingOutput("coal")))); + .setFluidIngredient(FluidIngredient.fromFluid(Fluids.WATER, FluidConstants.INGOT)) + .setResult(MC.asProcessingOutput("coal"))) + ); - handler.register(recipeId("emptying", "sand_ball"), + handler.register( + recipeId("emptying", "sand_ball"), id -> new EmptyingRecipe(new FreePRP(id) .setIngredient(CABF.asIngredient("sand_ball")) - .setResult(CABF.asProcessingOutput("rough_sand")).setFluidResult( - new FluidStack(CabfFluids.FINE_SAND, FluidConstants.BUCKET / 2)))); + .setResult(CABF.asProcessingOutput("rough_sand")) + .setFluidResult(new FluidStack(CabfFluids.FINE_SAND, FluidConstants.BUCKET / 2))) + ); - handler.register(recipeId("compacting", "silicon_compound"), + handler.register( + recipeId("compacting", "silicon_compound"), id -> new CompactingRecipe(new FreePRP(id) - .setIngredient(CABF.asIngredient("purified_sand"), - CABF.asIngredient("coke_chunk")) - .setFluidIngredient(FluidIngredient.fromFluid(CabfFluids.FINE_SAND, - FluidConstants.BOTTLE)) - .setResult(CABF.asProcessingOutput("silicon_compound")))); - - handler.register(recipeId("mixing", "purified_sand"), id -> new MixingRecipe(new FreePRP(id) - .setIngredient(CABF.asIngredient("rough_sand"), CABF.asIngredient("earth_charge")) - .setResult(CABF.asProcessingOutput("purified_sand")) - .setHeatRequirement(HeatCondition.HEATED))); - - handler.register(recipeId("mixing", "silicon"), id -> new MixingRecipe(new FreePRP(id) - .setIngredient(CABF.asIngredient("silicon_compound"), CABF.asIngredient("ice_charge")) - .setResult(AE2.asProcessingOutput("silicon")) - .setHeatRequirement(HeatCondition.HEATED))); - - handler.register(recipeId("item_application", "fluix_casing"), + .setIngredient( + CABF.asIngredient("purified_sand"), + CABF.asIngredient("coke_chunk") + ) + .setFluidIngredient( + FluidIngredient.fromFluid(CabfFluids.FINE_SAND, + FluidConstants.BOTTLE) + ) + .setResult(CABF.asProcessingOutput("silicon_compound"))) + ); + + handler.register( + recipeId("mixing", "purified_sand"), + id -> new MixingRecipe(new FreePRP(id) + .setIngredient( + CABF.asIngredient("rough_sand"), + CABF.asIngredient("earth_charge") + ) + .setResult(CABF.asProcessingOutput("purified_sand")) + .setHeatRequirement(HeatCondition.HEATED)) + ); + + handler.register( + recipeId("mixing", "silicon"), + id -> new MixingRecipe(new FreePRP(id) + .setIngredient( + CABF.asIngredient("silicon_compound"), + CABF.asIngredient("ice_charge")) + .setResult(AE2.asProcessingOutput("silicon")) + .setHeatRequirement(HeatCondition.HEATED)) + ); + + handler.register( + recipeId("item_application", "fluix_casing"), id -> new ManualApplicationRecipe(new FreePRP(id) - .setIngredient(MC.asIngredient("obsidian"), - AE2.asIngredient("fluix_crystal")) - .setResult(CABF.asProcessingOutput("fluix_casing")))); + .setIngredient( + MC.asIngredient("obsidian"), + AE2.asIngredient("fluix_crystal") + ) + .setResult(CABF.asProcessingOutput("fluix_casing"))) + ); - handler.register(recipeId("fluid_infuse", "snow"), - id -> new FluidInfuserRecipe(id, ArrayUtil.of(new InputEntry(MC.asIngredient("ice"), 0)), + handler.register( + recipeId("fluid_infuse", "snow"), + id -> new FluidInfuserRecipe(id, + ArrayUtil.of(new InputEntry(MC.asIngredient("ice"), 0)), ArrayUtil.of(new OutputEntry(MC.asStack("snowball"), 0.5)), ArrayUtil.of(new ResourceAmount<>(FluidVariant.of(Fluids.WATER), FluidConstants.BOTTLE)), - ArrayUtil.>of(), 120)); + ArrayUtil.>of(), + 120) + ); } @Contract("_, _, _ -> new") - private MechAndSmithCraft.@NotNull Entry entry(Identifier output, int count, - @Nullable Identifier other) { + private MechAndSmithCraft.@NotNull Entry entry(Identifier output, int count, @Nullable Identifier other) { return MechAndSmithCraft.entry(this.getLevel(), AE2.id("controller"), output, count, other); } diff --git a/src/main/java/com/dm/earth/cabricality/content/core/threads/InvarThread.java b/src/main/java/com/dm/earth/cabricality/content/core/threads/InvarThread.java index 154aade2..a3670804 100644 --- a/src/main/java/com/dm/earth/cabricality/content/core/threads/InvarThread.java +++ b/src/main/java/com/dm/earth/cabricality/content/core/threads/InvarThread.java @@ -1,25 +1,5 @@ package com.dm.earth.cabricality.content.core.threads; -import static com.dm.earth.cabricality.ModEntry.AE2; -import static com.dm.earth.cabricality.ModEntry.C; -import static com.dm.earth.cabricality.ModEntry.CABF; -import static com.dm.earth.cabricality.ModEntry.CR; -import static com.dm.earth.cabricality.ModEntry.CX; -import static com.dm.earth.cabricality.ModEntry.IR; -import static com.dm.earth.cabricality.ModEntry.KB; -import static com.dm.earth.cabricality.ModEntry.MC; -import static com.dm.earth.cabricality.ModEntry.TC; - -import java.util.List; - -import com.simibubi.create.content.fluids.transfer.EmptyingRecipe; -import org.jetbrains.annotations.Contract; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.quiltmc.qsl.recipe.api.RecipeLoadingEvents.AddRecipesCallback; -import org.quiltmc.qsl.recipe.api.RecipeLoadingEvents.RemoveRecipesCallback; -import org.quiltmc.qsl.recipe.api.builder.VanillaRecipeBuilders; - import com.dm.earth.cabricality.content.core.TechThread; import com.dm.earth.cabricality.content.core.items.ColoredFernItem; import com.dm.earth.cabricality.content.entries.CabfFluids; @@ -29,6 +9,7 @@ import com.dm.earth.cabricality.tweak.base.MechAndSmithCraft; import com.nhoryzon.mc.farmersdelight.recipe.CuttingBoardRecipe; import com.nhoryzon.mc.farmersdelight.recipe.ingredient.ChanceResult; +import com.simibubi.create.content.fluids.transfer.EmptyingRecipe; import com.simibubi.create.content.kinetics.crusher.CrushingRecipe; import com.simibubi.create.content.kinetics.deployer.DeployerApplicationRecipe; import com.simibubi.create.content.kinetics.deployer.ManualApplicationRecipe; @@ -37,154 +18,277 @@ import com.simibubi.create.content.kinetics.mixer.CompactingRecipe; import com.simibubi.create.content.kinetics.press.PressingRecipe; import com.simibubi.create.content.processing.recipe.ProcessingOutput; - -import io.github.fabricators_of_create.porting_lib.util.FluidStack; -import me.alphamode.forgetags.Tags; +import io.github.fabricators_of_create.porting_lib.fluids.FluidStack; +import io.github.fabricators_of_create.porting_lib.tags.Tags; import net.fabricmc.fabric.api.transfer.v1.fluid.FluidConstants; import net.minecraft.item.Item; import net.minecraft.item.Items; import net.minecraft.recipe.CampfireCookingRecipe; +import net.minecraft.recipe.CookingCategory; import net.minecraft.recipe.Ingredient; import net.minecraft.recipe.RecipeManager; -import net.minecraft.tag.TagKey; +import net.minecraft.registry.Registries; +import net.minecraft.registry.RegistryKeys; +import net.minecraft.registry.tag.TagKey; import net.minecraft.util.Identifier; import net.minecraft.util.collection.DefaultedList; -import net.minecraft.util.registry.Registry; +import org.jetbrains.annotations.Contract; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import org.quiltmc.qsl.recipe.api.RecipeLoadingEvents.AddRecipesCallback; +import org.quiltmc.qsl.recipe.api.RecipeLoadingEvents.RemoveRecipesCallback; +import org.quiltmc.qsl.recipe.api.builder.VanillaRecipeBuilders; + +import java.util.List; + +import static com.dm.earth.cabricality.ModEntry.AE2; +import static com.dm.earth.cabricality.ModEntry.C; +import static com.dm.earth.cabricality.ModEntry.CABF; +import static com.dm.earth.cabricality.ModEntry.CR; +import static com.dm.earth.cabricality.ModEntry.CX; +import static com.dm.earth.cabricality.ModEntry.IR; +import static com.dm.earth.cabricality.ModEntry.KB; +import static com.dm.earth.cabricality.ModEntry.MC; +import static com.dm.earth.cabricality.ModEntry.TC; public class InvarThread implements TechThread { - private static final List REMOVE_OUTPUTS = List.of(IR.id("compressor_mk1"), IR.id("chopper_mk1"), - IR.id("farmer_mk1"), IR.id("slaughter_mk1"), IR.id("rancher_mk1"), IR.id("pump_mk1"), - IR.id("mining_rig_mk4"), IR.id("data_card_writer_mk4"), IR.id("drain_mk1")); + private static final List REMOVE_OUTPUTS = List.of( + IR.id("compressor_mk1"), + IR.id("chopper_mk1"), + IR.id("farmer_mk1"), + IR.id("slaughter_mk1"), + IR.id("rancher_mk1"), + IR.id("pump_mk1"), + IR.id("mining_rig_mk4"), + IR.id("data_card_writer_mk4"), + IR.id("drain_mk1") + ); @Override public void load() { - MechAndSmithCraft.addEntry(entry(IR.id("electric_furnace_mk1"), 1, MC.id("furnace"))); - MechAndSmithCraft.addEntry(entry(IR.id("compressor_mk1"), 1, MC.id("iron_block"))); - MechAndSmithCraft.addEntry(entry(IR.id("smelter_mk4"), 1, MC.id("blast_furnace"))); - MechAndSmithCraft.addEntry(entry(IR.id("pulverizer_mk1"), 1, MC.id("flint"))); - MechAndSmithCraft.addEntry(entry(IR.id("sawmill_mk1"), 1, CABF.id("saw_blade"))); - MechAndSmithCraft.addEntry(entry(IR.id("recycler_mk2"), 1, MC.id("composter"))); - MechAndSmithCraft.addEntry(entry(IR.id("condenser_mk4"), 1, MC.id("packed_ice"))); - MechAndSmithCraft.addEntry(entry(IR.id("fluid_infuser_mk1"), 1, CR.id("whisk"))); - MechAndSmithCraft.addEntry(entry(IR.id("modular_workbench_mk4"), 1, MC.id("crafting_table"))); + MechAndSmithCraft.addEntry(entry(IR.id("electric_furnace_mk1"), 1, MC.id("furnace"))); + MechAndSmithCraft.addEntry(entry(IR.id("compressor_mk1"), 1, MC.id("iron_block"))); + MechAndSmithCraft.addEntry(entry(IR.id("smelter_mk4"), 1, MC.id("blast_furnace"))); + MechAndSmithCraft.addEntry(entry(IR.id("pulverizer_mk1"), 1, MC.id("flint"))); + MechAndSmithCraft.addEntry(entry(IR.id("sawmill_mk1"), 1, CABF.id("saw_blade"))); + MechAndSmithCraft.addEntry(entry(IR.id("recycler_mk2"), 1, MC.id("composter"))); + MechAndSmithCraft.addEntry(entry(IR.id("condenser_mk4"), 1, MC.id("packed_ice"))); + MechAndSmithCraft.addEntry(entry(IR.id("fluid_infuser_mk1"), 1, CR.id("whisk"))); + MechAndSmithCraft.addEntry(entry(IR.id("modular_workbench_mk4"), 1, MC.id("crafting_table"))); MechAndSmithCraft.addEntry(entry(IR.id("lazuli_flux_container_mk1"), 1, MC.id("redstone_block"))); - MechAndSmithCraft.addEntry(entry(IR.id("laser_emitter_mk4"), 1, MC.id("lightning_rod"))); - MechAndSmithCraft.addEntry(entry(CX.id("energy_trash_can"), 1, KB.id("trash_can"))); + MechAndSmithCraft.addEntry(entry(IR.id("laser_emitter_mk4"), 1, MC.id("lightning_rod"))); + MechAndSmithCraft.addEntry(entry(CX.id("energy_trash_can"), 1, KB.id("trash_can"))); } @Override public void addRecipes(AddRecipesCallback.RecipeHandler handler) { - handler.register(recipeId("mechanical_crafting", "crushing_wheel"), - id -> RecipeBuilderUtil.mechanicalFromShaped(VanillaRecipeBuilders - .shapedRecipe(" AAA ", "AABAA", "ABBBA", "AABAA", " AAA") - .ingredient('A', Tags.Items.COBBLESTONE).ingredient('B', Items.STICK) - .output(CR.asItem("crushing_wheel").getDefaultStack()).build(id, ""), - false)); + handler.register( + recipeId("mechanical_crafting", "crushing_wheel"), + id -> RecipeBuilderUtil.mechanicalFromShaped( + VanillaRecipeBuilders + .shapedRecipe(" AAA ", "AABAA", "ABBBA", "AABAA", " AAA") + .ingredient('A', Tags.Items.COBBLESTONE) + .ingredient('B', Items.STICK) + .output(CR.asItem("crushing_wheel").getDefaultStack()) + .build(id, ""), + false + ) + ); for (ColoredFernItem.Entry entry : ColoredFernItem.Entry.values()) { String fern = entry.name + "_slime_fern"; String leaf = entry.name + "_slime_fern_leaf"; String paste = entry.name + "_slime_fern_paste"; - TagKey knives = TagKey.of(Registry.ITEM_KEY, C.id("tools/knives")); + + TagKey knives = TagKey.of(RegistryKeys.ITEM, C.id("tools/knives")); + DefaultedList results = DefaultedList.of(); results.add(new ChanceResult(CABF.asStack(2, leaf), 1)); - handler.register(recipeId("fd_cutting", fern), - id -> new CuttingBoardRecipe(id, "", TC.asIngredient(fern), - Ingredient.ofTag(knives), results, "minecraft:block.grass.break")); - handler.register(recipeId("deploying", fern), - id -> new DeployerApplicationRecipe( - new FreePRP(id).setIngredient(TC.asIngredient(fern), Ingredient.ofTag(knives)) - .setResult(CABF.asProcessingOutput(1, 2, leaf)).keepHeldItem())); - handler.register(recipeId("haunting", leaf), - id -> new HauntingRecipe(new FreePRP(id).setIngredient(CABF.asIngredient(leaf)) - .setResult(TC.asProcessingOutput(fern)))); - handler.register(recipeId("milling", leaf), - id -> new MillingRecipe(new FreePRP(id).setIngredient(CABF.asIngredient(leaf)) - .setResult(CABF.asProcessingOutput(paste)).setProcessingTime(70))); - handler.register(recipeId("campfire_cooking", paste), id -> new CampfireCookingRecipe(id, "", - CABF.asIngredient(paste), entry.getOutputItem().getDefaultStack(), 0, 300)); + + handler.register( + recipeId("fd_cutting", fern), + id -> new CuttingBoardRecipe( + id, "", + TC.asIngredient(fern), Ingredient.ofTag(knives), + results, + "minecraft:block.grass.break" + ) + ); + + handler.register( + recipeId("deploying", fern), + id -> new DeployerApplicationRecipe(new FreePRP(id) + .setIngredient(TC.asIngredient(fern), Ingredient.ofTag(knives)) + .setResult(CABF.asProcessingOutput(1, 2, leaf)) + .keepHeldItem()) + ); + + handler.register( + recipeId("haunting", leaf), + id -> new HauntingRecipe(new FreePRP(id) + .setIngredient(CABF.asIngredient(leaf)) + .setResult(TC.asProcessingOutput(fern))) + ); + + handler.register( + recipeId("milling", leaf), + id -> new MillingRecipe(new FreePRP(id) + .setIngredient(CABF.asIngredient(leaf)) + .setResult(CABF.asProcessingOutput(paste)) + .setProcessingTime(70)) + ); + + handler.register( + recipeId("campfire_cooking", paste), + id -> new CampfireCookingRecipe( + id, "", + CookingCategory.MISC, + CABF.asIngredient(paste), + entry.getOutputItem().getDefaultStack(), + 0, 300) + ); } - handler.register(recipeId("campfire_cooking", "stick"), id -> new CampfireCookingRecipe(id, - "", MC.asIngredient("stick"), MC.asStack("torch"), 0, 20)); + handler.register( + recipeId("campfire_cooking", "stick"), + id -> new CampfireCookingRecipe( + id, "", + CookingCategory.MISC, + MC.asIngredient("stick"), + MC.asStack("torch"), + 0, 20 + ) + ); - handler.register(recipeId("blasting", "nickel_compound"), - id -> VanillaRecipeBuilders.blastingRecipe(id, "", - CABF.asIngredient("nickel_compound"), CABF.asStack("invar_compound"), 0.1F, - 400)); + handler.register( + recipeId("blasting", "nickel_compound"), + id -> VanillaRecipeBuilders.blastingRecipe( + id, "", + CABF.asIngredient("nickel_compound"), + CookingCategory.MISC, + CABF.asStack("invar_compound"), + 0.1F, 400 + ) + ); - handler.register(recipeId("crushing", "crushing_wheel"), + handler.register( + recipeId("crushing", "crushing_wheel"), id -> new CrushingRecipe(new FreePRP(id) .setIngredient(CR.asIngredient("crushing_wheel")) - .setResult(AE2.asProcessingOutput("singularity")).setProcessingTime(250))); + .setResult(AE2.asProcessingOutput("singularity")) + .setProcessingTime(250)) + ); - handler.register(recipeId("compacting", "dye_entangled_singularity"), + handler.register( + recipeId("compacting", "dye_entangled_singularity"), id -> new CompactingRecipe(new FreePRP(id) - .setIngredient(Ingredient.ofTag(Tags.Items.DYES), - AE2.asIngredient("quantum_entangled_singularity")) - .setResult(CABF.asProcessingOutput("dye_entangled_singularity")))); + .setIngredient( + Ingredient.ofTag(Tags.Items.DYES), + AE2.asIngredient("quantum_entangled_singularity") + ) + .setResult(CABF.asProcessingOutput("dye_entangled_singularity"))) + ); - List balls = List.of(AE2.asItem("red_paint_ball"), AE2.asItem("yellow_paint_ball"), - AE2.asItem("green_paint_ball"), AE2.asItem("blue_paint_ball"), - AE2.asItem("magenta_paint_ball")); + List balls = List.of( + AE2.asItem("red_paint_ball"), + AE2.asItem("yellow_paint_ball"), + AE2.asItem("green_paint_ball"), + AE2.asItem("blue_paint_ball"), + AE2.asItem("magenta_paint_ball") + ); - handler.register(recipeId("crushing", "dye_entangled_singularity"), + handler.register( + recipeId("crushing", "dye_entangled_singularity"), id -> new CrushingRecipe(new FreePRP(id) .setIngredient(CABF.asIngredient("dye_entangled_singularity")) .setResult(balls.stream() - .map(item -> new ProcessingOutput(item.getDefaultStack(), - 0.9f - 0.1f * balls.indexOf(item))) + .map(item -> new ProcessingOutput( + item.getDefaultStack(), + 0.9f - 0.1f * balls.indexOf(item)) + ) .toList()) - .setProcessingTime(50))); + .setProcessingTime(50)) + ); for (Item item : balls) { int index = balls.indexOf(item); - Item output = index < balls.size() - 1 ? balls.get(index + 1) + Item output = index < balls.size() - 1 + ? balls.get(index + 1) : AE2.asItem("black_paint_ball"); - handler.register(recipeId("emptying", Registry.ITEM.getId(item).getPath()), - id -> new EmptyingRecipe(new FreePRP(id).setIngredient(Ingredient.ofItems(item)) + + handler.register( + recipeId("emptying", Registries.ITEM.getId(item).getPath()), + id -> new EmptyingRecipe(new FreePRP(id) + .setIngredient(Ingredient.ofItems(item)) .setFluidResult(new FluidStack(CabfFluids.WASTE, FluidConstants.BOTTLE)) - .setResult(new ProcessingOutput(output.getDefaultStack(), 1)))); + .setResult(new ProcessingOutput(output.getDefaultStack(), 1))) + ); } - handler.register(recipeId("pressing", "refined_radiance"), + handler.register( + recipeId("pressing", "refined_radiance"), id -> new PressingRecipe(new FreePRP(id) .setIngredient(Ingredient.ofItems(CR.asItem("refined_radiance"))) - .setResult(CABF.asProcessingOutput("radiant_sheet")))); + .setResult(CABF.asProcessingOutput("radiant_sheet"))) + ); - handler.register(recipeId("mechanical_crafting", "radiant_coil"), + handler.register( + recipeId("mechanical_crafting", "radiant_coil"), id -> RecipeBuilderUtil.mechanicalFromShaped( - VanillaRecipeBuilders.shapedRecipe("A") + VanillaRecipeBuilders + .shapedRecipe("A") .ingredient('A', CabfItems.RADIANT_SHEET) - .output(CabfItems.RADIANT_COIL.getDefaultStack()).build(id, ""), - true)); + .output(CabfItems.RADIANT_COIL.getDefaultStack()) + .build(id, ""), + true) + ); - handler.register(recipeId("mechanical_crafting", "chromatic_compound"), - id -> RecipeBuilderUtil - .mechanicalFromShaped( - VanillaRecipeBuilders.shapedRecipe("AA", "AA") + handler.register( + recipeId("mechanical_crafting", "chromatic_compound"), + id -> RecipeBuilderUtil.mechanicalFromShaped( + VanillaRecipeBuilders + .shapedRecipe("AA", "AA") .ingredient('A', AE2.asIngredient("magenta_paint_ball")) - .output(CR.asStack("chromatic_compound")).build(id, ""), - false)); + .output(CR.asStack("chromatic_compound")) + .build(id, ""), + false) + ); - handler.register(recipeId("crafting", "chromatic_resonator"), id -> VanillaRecipeBuilders - .shapedRecipe(" R ", "R S", "LS ").ingredient('R', CABF.asItem("ruby")) - .ingredient('L', IR.asItem("lead_ingot")).ingredient('S', CABF.asItem("sapphire")) - .output(CABF.asStack("chromatic_resonator")).build(id, "")); + handler.register( + recipeId("crafting", "chromatic_resonator"), + id -> VanillaRecipeBuilders + .shapedRecipe(" R ", "R S", "LS ") + .ingredient('R', CABF.asItem("ruby")) + .ingredient('L', IR.asItem("lead_ingot")) + .ingredient('S', CABF.asItem("sapphire")) + .output(CABF.asStack("chromatic_resonator")) + .build(id, "") + ); - handler.register(recipeId("crafting", "machine_block"), - id -> VanillaRecipeBuilders.shapedRecipe("SSS", "SCS", "SSS") + handler.register( + recipeId("crafting", "machine_block"), + id -> VanillaRecipeBuilders + .shapedRecipe("SSS", "SCS", "SSS") .ingredient('C', CABF.asItem("invar_casing")) .ingredient('S', CABF.asItem("inductive_mechanism")) - .output(IR.asStack("machine_block")).build(id, "")); + .output(IR.asStack("machine_block")) + .build(id, "") + ); - handler.register(recipeId("item_application", "invar_casing"), + handler.register( + recipeId("item_application", "invar_casing"), id -> new ManualApplicationRecipe(new FreePRP(id) .setIngredient(MC.asIngredient("calcite"), CABF.asIngredient("invar_ingot")) - .setResult(CABF.asProcessingOutput("invar_casing")))); + .setResult(CABF.asProcessingOutput("invar_casing"))) + ); - handler.register(recipeId("melting", "ender_dust"), id -> RecipeManager.deserialize(id, RecipeBuilderUtil - .generateMelting(AE2.id("ender_dust"), TC.id("molten_ender"), FluidConstants.INGOT, null, 0, 350, 35))); + handler.register( + recipeId("melting", "ender_dust"), + id -> RecipeManager.deserialize(id, RecipeBuilderUtil.generateMelting( + AE2.id("ender_dust"), TC.id("molten_ender"), + FluidConstants.INGOT, + null, 0, 350, 35)) + ); } @Override @@ -201,7 +305,10 @@ public String getLevel() { public void removeRecipes(RemoveRecipesCallback.RecipeHandler handler) { handler.remove(CR.id("mechanical_crafting", "crushing_wheel")); handler.removeIf(IR.predicateOutput(false, "machine_block")); - handler.removeIf(p -> !CABF.checkContains(p) && REMOVE_OUTPUTS.stream() - .anyMatch(id -> id.equals(Registry.ITEM.getId(p.getOutput().getItem())))); + handler.removeIf( + p -> !CABF.checkContains(p) + && REMOVE_OUTPUTS.stream() + .anyMatch(id -> id.equals(Registries.ITEM.getId(p.getResult(null).getItem()))) + ); } } diff --git a/src/main/java/com/dm/earth/cabricality/content/core/threads/MathThread.java b/src/main/java/com/dm/earth/cabricality/content/core/threads/MathThread.java index 078e4347..a22f1806 100644 --- a/src/main/java/com/dm/earth/cabricality/content/core/threads/MathThread.java +++ b/src/main/java/com/dm/earth/cabricality/content/core/threads/MathThread.java @@ -1,48 +1,56 @@ package com.dm.earth.cabricality.content.core.threads; -import static com.dm.earth.cabricality.ModEntry.CABF; -import static com.dm.earth.cabricality.ModEntry.CR; - -import org.quiltmc.qsl.recipe.api.RecipeLoadingEvents.AddRecipesCallback.RecipeHandler; -import org.quiltmc.qsl.recipe.api.builder.VanillaRecipeBuilders; - import com.dm.earth.cabricality.Cabricality; import com.dm.earth.cabricality.content.core.TechThread; import com.dm.earth.cabricality.content.entries.CabfItems; import com.dm.earth.cabricality.content.math.CalculationRecipe; import com.dm.earth.cabricality.content.math.item.NumberItem; import com.dm.earth.cabricality.lib.math.RecipeBuilderUtil; - import net.fabricmc.fabric.api.transfer.v1.fluid.FluidConstants; import net.minecraft.recipe.RecipeManager; -import net.minecraft.util.registry.Registry; +import net.minecraft.registry.Registries; +import org.quiltmc.qsl.recipe.api.RecipeLoadingEvents.AddRecipesCallback.RecipeHandler; +import org.quiltmc.qsl.recipe.api.builder.VanillaRecipeBuilders; -public class MathThread implements TechThread { - @Override - public String getLevel() { - return "math"; - } +import static com.dm.earth.cabricality.ModEntry.CABF; +import static com.dm.earth.cabricality.ModEntry.CR; +public class MathThread implements TechThread { @Override public void addRecipes(RecipeHandler handler) { handler.register(recipeId("crafting", "calculation"), CalculationRecipe::new); - CabfItems.MATH_CASTS - .forEach(str -> handler.register(recipeId("stonecutting", str + "_cast"), - id -> VanillaRecipeBuilders.stonecuttingRecipe(id, "", - CR.asIngredient("copper_sheet"), CABF.asStack(str + "_cast")))); + CabfItems.MATH_CASTS.forEach(str -> handler.register( + recipeId("stonecutting", str + "_cast"), + id -> VanillaRecipeBuilders.stonecuttingRecipe( + id, "", + CR.asIngredient("copper_sheet"), + CABF.asStack(str + "_cast")) + )); - CabfItems.NUMBERS.forEach(num -> handler.register(recipeId("melting", NumberItem.getNumberItemName(num)), + CabfItems.NUMBERS.forEach(num -> handler.register( + recipeId("melting", NumberItem.getNumberItemName(num)), id -> RecipeManager.deserialize(id, RecipeBuilderUtil.generateMelting( Cabricality.id(NumberItem.getNumberItemName(num)), - Registry.FLUID.getId( - ((NumberItem) Registry.ITEM.get(Cabricality.id(NumberItem.getNumberItemName(num)))) - .getFluid()), - FluidConstants.DROPLET, null, 0, 200, 20)))); + Registries.FLUID.getId(((NumberItem) + Registries.ITEM.get(Cabricality.id(NumberItem.getNumberItemName(num))) + ).getFluid()), + FluidConstants.DROPLET, + null, 0, 200, 20)) + )); + + handler.register( + recipeId("melting", "calculation_mechanism"), + id -> RecipeManager.deserialize(id, RecipeBuilderUtil.generateMelting( + Cabricality.id("calculation_mechanism"), + Cabricality.id("raw_logic"), + FluidConstants.NUGGET * 3, + null, 0, 200, 20)) + ); + } - handler.register(recipeId("melting", "calculation_mechanism"), - id -> RecipeManager.deserialize(id, - RecipeBuilderUtil.generateMelting(Cabricality.id("calculation_mechanism"), - Cabricality.id("raw_logic"), FluidConstants.NUGGET * 3, null, 0, 200, 20))); + @Override + public String getLevel() { + return "math"; } } diff --git a/src/main/java/com/dm/earth/cabricality/content/core/threads/ObsidianThread.java b/src/main/java/com/dm/earth/cabricality/content/core/threads/ObsidianThread.java index 8b458140..c5a4c153 100644 --- a/src/main/java/com/dm/earth/cabricality/content/core/threads/ObsidianThread.java +++ b/src/main/java/com/dm/earth/cabricality/content/core/threads/ObsidianThread.java @@ -16,9 +16,16 @@ public class ObsidianThread implements TechThread { @Override public void addRecipes(RecipeHandler handler) { - handler.register(recipeId("crafting", "obsidian_machine"), - id -> RecipeBuilderUtil.donutRecipe(id, CR.asItem("railway_casing"), - CABF.asItem("sturdy_mechanism"), CABF.asItem("obsidian_machine"), 1)); + handler.register( + recipeId("crafting", "obsidian_machine"), + id -> RecipeBuilderUtil.donutRecipe( + id, + CR.asItem("railway_casing"), + CABF.asItem("sturdy_mechanism"), + CABF.asItem("obsidian_machine"), + 1 + ) + ); } @Override diff --git a/src/main/java/com/dm/earth/cabricality/content/core/threads/ZincThread.java b/src/main/java/com/dm/earth/cabricality/content/core/threads/ZincThread.java index dcc6894f..6c6327fb 100644 --- a/src/main/java/com/dm/earth/cabricality/content/core/threads/ZincThread.java +++ b/src/main/java/com/dm/earth/cabricality/content/core/threads/ZincThread.java @@ -7,11 +7,11 @@ import com.simibubi.create.content.kinetics.deployer.ManualApplicationRecipe; import com.simibubi.create.content.kinetics.mixer.MixingRecipe; import com.simibubi.create.content.processing.recipe.HeatCondition; -import io.github.fabricators_of_create.porting_lib.util.FluidStack; +import io.github.fabricators_of_create.porting_lib.fluids.FluidStack; import net.fabricmc.fabric.api.transfer.v1.fluid.FluidConstants; import net.minecraft.item.Items; import net.minecraft.recipe.Ingredient; -import net.minecraft.tag.ItemTags; +import net.minecraft.registry.tag.ItemTags; import net.minecraft.util.Identifier; import org.jetbrains.annotations.Contract; import org.jetbrains.annotations.NotNull; @@ -31,21 +31,37 @@ public class ZincThread implements TechThread { @Override public void addRecipes(AddRecipesCallback.@NotNull RecipeHandler handler) { - handler.register(recipeId("mixing", "liquid_soul"), id -> new MixingRecipe(new FreePRP(id) - .setIngredient(Ingredient.ofItems(Items.WEEPING_VINES), - Ingredient.ofItems(Items.TWISTING_VINES)) - .setFluidResult(new FluidStack(TC.asFluid("liquid_soul"), FluidConstants.BOTTLE)) - .setHeatRequirement(HeatCondition.HEATED))); + handler.register( + recipeId("mixing", "liquid_soul"), + id -> new MixingRecipe(new FreePRP(id) + .setIngredient( + Ingredient.ofItems(Items.WEEPING_VINES), + Ingredient.ofItems(Items.TWISTING_VINES) + ) + .setFluidResult(new FluidStack(TC.asFluid("liquid_soul"), FluidConstants.BOTTLE)) + .setHeatRequirement(HeatCondition.HEATED)) + ); - handler.register(recipeId("crafting", "zinc_machine"), - id -> RecipeBuilderUtil.donutRecipe(id, CABF.asItem("zinc_casing"), - CABF.asItem("infernal_mechanism"), CABF.asItem("zinc_machine"), 1)); + handler.register( + recipeId("crafting", "zinc_machine"), + id -> RecipeBuilderUtil.donutRecipe( + id, + CABF.asItem("zinc_casing"), + CABF.asItem("infernal_mechanism"), + CABF.asItem("zinc_machine"), + 1 + ) + ); - handler.register(recipeId("item_application", "zinc_casing"), + handler.register( + recipeId("item_application", "zinc_casing"), id -> new ManualApplicationRecipe(new FreePRP(id) - .setIngredient(Ingredient.ofTag(ItemTags.STONE_CRAFTING_MATERIALS), - CABF.asIngredient("zinc_sheet")) - .setResult(CABF.asProcessingOutput("zinc_casing")))); + .setIngredient( + Ingredient.ofTag(ItemTags.STONE_CRAFTING_MATERIALS), + CABF.asIngredient("zinc_sheet") + ) + .setResult(CABF.asProcessingOutput("zinc_casing"))) + ); } @Override