2022-01-07 00:16:37 +01:00
|
|
|
package de.ellpeck.actuallyadditions.data;
|
|
|
|
|
|
|
|
import com.google.gson.JsonObject;
|
|
|
|
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
2022-01-15 19:38:00 +01:00
|
|
|
import de.ellpeck.actuallyadditions.mod.crafting.FermentingRecipe;
|
2022-01-07 00:16:37 +01:00
|
|
|
import de.ellpeck.actuallyadditions.mod.crafting.PressingRecipe;
|
|
|
|
import de.ellpeck.actuallyadditions.mod.fluids.InitFluids;
|
|
|
|
import de.ellpeck.actuallyadditions.mod.items.ActuallyItems;
|
|
|
|
import net.minecraft.data.DataGenerator;
|
2024-03-02 21:23:08 +01:00
|
|
|
import net.minecraft.data.HashCache;
|
|
|
|
import net.minecraft.data.recipes.FinishedRecipe;
|
|
|
|
import net.minecraft.data.recipes.RecipeProvider;
|
|
|
|
import net.minecraft.resources.ResourceLocation;
|
|
|
|
import net.minecraft.world.item.crafting.Ingredient;
|
|
|
|
import net.minecraft.world.level.ItemLike;
|
2022-01-07 00:16:37 +01:00
|
|
|
import net.minecraftforge.fluids.FluidStack;
|
2022-08-31 00:20:32 +02:00
|
|
|
import net.minecraftforge.registries.ForgeRegistries;
|
2022-01-07 00:16:37 +01:00
|
|
|
|
|
|
|
import java.nio.file.Path;
|
|
|
|
import java.util.function.Consumer;
|
|
|
|
|
|
|
|
public class MiscMachineRecipeGenerator extends RecipeProvider {
|
|
|
|
public MiscMachineRecipeGenerator(DataGenerator pGenerator) {
|
|
|
|
super(pGenerator);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2024-03-02 21:23:08 +01:00
|
|
|
protected void saveAdvancement(HashCache pCache, JsonObject pAdvancementJson, Path pPath) {
|
2022-01-07 00:16:37 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2024-03-02 21:23:08 +01:00
|
|
|
protected void buildCraftingRecipes(Consumer<FinishedRecipe> consumer) {
|
|
|
|
consumer.accept(new PressingRecipe.Result(folderRecipe("pressing", "canola"),
|
2022-01-07 01:59:06 +01:00
|
|
|
Ingredient.of(ActuallyItems.CANOLA.get()), new FluidStack(InitFluids.CANOLA_OIL.get(), 80)));
|
2022-01-15 19:38:00 +01:00
|
|
|
|
2024-03-02 21:23:08 +01:00
|
|
|
consumer.accept(new FermentingRecipe.Result(folderRecipe("fermenting", "refined_canola"),
|
2022-01-15 19:38:00 +01:00
|
|
|
new FluidStack(InitFluids.CANOLA_OIL.get(), 80), new FluidStack(InitFluids.REFINED_CANOLA_OIL.get(), 80), 100));
|
2022-01-07 01:59:06 +01:00
|
|
|
}
|
|
|
|
|
2024-03-02 21:23:08 +01:00
|
|
|
// private String getItemName(ItemLike item) {
|
|
|
|
// return ForgeRegistries.ITEMS.getKey(item.asItem()).getPath();
|
|
|
|
// }
|
2022-08-31 00:20:32 +02:00
|
|
|
|
2022-01-07 01:59:06 +01:00
|
|
|
private ResourceLocation folderRecipe(String folder, String recipe) {
|
|
|
|
return new ResourceLocation(ActuallyAdditions.MODID, folder + "/" + recipe);
|
2022-01-07 00:16:37 +01:00
|
|
|
}
|
|
|
|
}
|