Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

Commit

Permalink
added wod cutting recipes, including special tfc versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Trinsdar committed Sep 26, 2023
1 parent 2400dd1 commit 4fc2b72
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
package muramasa.gregtech.loader.machines;

import io.github.gregtechintergalactical.gtrubber.GTRubberData;
import muramasa.antimatter.AntimatterAPI;
import muramasa.antimatter.data.AntimatterMaterialTypes;
import muramasa.antimatter.data.AntimatterMaterials;
import muramasa.antimatter.material.Material;
import muramasa.antimatter.material.MaterialTags;
import muramasa.antimatter.recipe.ingredient.RecipeIngredient;
import muramasa.gregtech.data.Materials;
import muramasa.gregtech.data.RecipeMaps;
import net.minecraft.tags.ItemTags;
import net.minecraft.tags.TagKey;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;
import net.minecraft.world.level.material.Fluids;
import tesseract.FluidPlatformUtils;
import tesseract.TesseractGraphWrappers;

import static muramasa.antimatter.data.AntimatterMaterialTypes.*;
import static muramasa.antimatter.data.AntimatterMaterials.Wood;
import static muramasa.gregtech.data.RecipeMaps.CUTTING;

public class CuttingLoader {
Expand All @@ -40,6 +45,17 @@ public static void init() {
AntimatterMaterialTypes.ROD_LONG.all().forEach(m -> {
addCutterRecipe(ROD_LONG.getMaterialTag(m), ROD.get(m, 2), "rod_" + m.getId(), (int) (m.getMass() * 2), 4);
});
if (!AntimatterAPI.isModLoaded("tfc")){
addWoodRecipe(ItemTags.OAK_LOGS, Items.OAK_PLANKS, 1, "oak_planks", 200, 8);
addWoodRecipe(ItemTags.BIRCH_LOGS, Items.BIRCH_PLANKS, 1, "birch_planks", 200, 8);
addWoodRecipe(ItemTags.SPRUCE_LOGS, Items.SPRUCE_PLANKS, 1, "spruce_planks", 200, 8);
addWoodRecipe(ItemTags.ACACIA_LOGS, Items.ACACIA_PLANKS, 1, "acacia_planks", 200, 8);
addWoodRecipe(ItemTags.DARK_OAK_LOGS, Items.DARK_OAK_PLANKS, 1, "dark_oak_planks", 200, 8);
addWoodRecipe(ItemTags.JUNGLE_LOGS, Items.JUNGLE_PLANKS, 1, "jungle_planks", 200, 8);
addWoodRecipe(ItemTags.CRIMSON_STEMS, Items.CRIMSON_PLANKS, 1, "crimson_planks", 200, 8);
addWoodRecipe(ItemTags.WARPED_STEMS, Items.WARPED_PLANKS, 1, "warped_planks", 200, 8);
addWoodRecipe(GTRubberData.RUBBER_LOGS, GTRubberData.RUBBER_PLANKS.asItem(), 1, "rubber_planks", 200, 8);
}
}

private static void addCutterRecipe(TagKey<Item> input, ItemStack output, String id, int duration, int euPerTick){
Expand All @@ -53,4 +69,16 @@ private static void addCutterRecipe(TagKey<Item> input, ItemStack output, String
.fi(Materials.DistilledWater.getLiquid(Math.max(3, Math.min(750, duration * euPerTick / 426))))
.io(output).add(id + "_with_distilled_water", duration * 2L, euPerTick);
}

public static void addWoodRecipe(TagKey<Item> input, Item output, int multiplier, String id, int duration, int euPerTick){
CUTTING.RB().ii(RecipeIngredient.of(input, 1))
.fi(FluidPlatformUtils.createFluidStack(Fluids.WATER, Math.max(4, Math.min(1000, duration * euPerTick / 320)) * TesseractGraphWrappers.dropletMultiplier))
.io(new ItemStack(output, 4 * multiplier), DUST.get(Wood, 2)).add(id + "_with_water", duration * 2L, euPerTick);
CUTTING.RB().ii(RecipeIngredient.of(input, 1))
.fi(Materials.Lubricant.getLiquid(Math.max(1, Math.min(250, duration * euPerTick / 1280))))
.io(new ItemStack(output, 6 * multiplier), DUST.get(Wood, 1)).add(id + "_with_lubricant", duration, euPerTick);
CUTTING.RB().ii(RecipeIngredient.of(input, 1))
.fi(Materials.DistilledWater.getLiquid(Math.max(3, Math.min(750, duration * euPerTick / 426))))
.io(new ItemStack(output, 4 * multiplier), DUST.get(Wood, 2)).add(id + "_with_distilled_water", duration * 2L, euPerTick);
}
}
Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
package muramasa.gregtech.integration.forge.tfc;

import io.github.gregtechintergalactical.gtrubber.GTRubberData;
import io.github.gregtechintergalactical.gtrubber.forge.GTRubberDataImpl;
import io.github.gregtechintergalactical.gtrubber.tfc.TFCRubberData;
import muramasa.antimatter.data.AntimatterMaterialTypes;
import muramasa.antimatter.data.AntimatterMaterials;
import muramasa.antimatter.material.Material;
import muramasa.antimatter.util.AntimatterPlatformUtils;
import muramasa.antimatter.util.TagUtils;
import muramasa.antimatter.util.Utils;
import muramasa.gregtech.GregTech;
import muramasa.gregtech.data.Materials;
import muramasa.gregtech.data.RecipeMaps;
import muramasa.gregtech.loader.machines.CuttingLoader;
import net.dries007.tfc.common.blocks.TFCBlocks;
import net.dries007.tfc.common.blocks.TFCMaterials;
import net.dries007.tfc.common.blocks.rock.Ore;
import net.dries007.tfc.common.blocks.wood.Wood;
import net.dries007.tfc.common.items.TFCItems;
import net.dries007.tfc.util.Helpers;
import net.dries007.tfc.util.Metal;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;

Expand Down Expand Up @@ -62,6 +71,11 @@ public static void initMaceratorRecipes(){
/*for (Material material : TFCRegistrar.array) {
addMaceratorRecipe(material);
}*/
Helpers.mapOfKeys(net.dries007.tfc.common.blocks.wood.Wood.class, w -> {
CuttingLoader.addWoodRecipe(TagUtils.getItemTag(new ResourceLocation("tfc", w.name().toLowerCase() + "_logs")), AntimatterPlatformUtils.getItemFromID("tfc", "wood/lumber/" + w.name().toLowerCase()), 2, w.name().toLowerCase() + "_lumber", 200, 8);
return true;
});
CuttingLoader.addWoodRecipe(GTRubberData.RUBBER_LOGS, TFCRubberData.RUBBER_LUMBER, 2, "rubber_lumber", 200, 8);
}

private static void addMaceratorRecipe(Ore input, Material material){
Expand Down

0 comments on commit 4fc2b72

Please sign in to comment.