ActuallyAdditions/src/main/java/de/ellpeck/actuallyadditions/data/MiscMachineRecipeGenerator.java

53 lines
2 KiB
Java
Raw Normal View History

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;
2024-03-03 01:20:53 +01:00
import net.minecraft.data.CachedOutput;
import net.minecraft.data.PackOutput;
2024-03-02 21:23:08 +01:00
import net.minecraft.data.recipes.FinishedRecipe;
import net.minecraft.data.recipes.RecipeProvider;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.crafting.Ingredient;
2022-01-07 00:16:37 +01:00
import net.minecraftforge.fluids.FluidStack;
2024-03-03 01:20:53 +01:00
import org.jetbrains.annotations.Nullable;
2022-01-07 00:16:37 +01:00
2024-03-03 01:20:53 +01:00
import java.util.concurrent.CompletableFuture;
2022-01-07 00:16:37 +01:00
import java.util.function.Consumer;
public class MiscMachineRecipeGenerator extends RecipeProvider {
2024-03-03 01:20:53 +01:00
public MiscMachineRecipeGenerator(PackOutput packOutput) {
super(packOutput);
2022-01-07 00:16:37 +01:00
}
@Override
2024-03-03 01:20:53 +01:00
public String getName() {
return "Misc " + super.getName();
2022-01-07 00:16:37 +01:00
}
@Override
2024-03-03 01:20:53 +01:00
protected @Nullable CompletableFuture<?> saveAdvancement(CachedOutput output, FinishedRecipe finishedRecipe, JsonObject advancementJson) {
return null; //Nope...
}
@Override
protected void buildRecipes(Consumer<FinishedRecipe> consumer) {
2024-03-02 21:23:08 +01:00
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
}
}