ActuallyAdditions/src/main/java/de/ellpeck/actuallyadditions/data/recipes/CrusherRecipeGenerator.java
canitzp 2c07ef0fa0
Start to work on DataGenerator. Crusher Recipes should now be able to be serialized to json by its Factory. In general the serializing to json is handled by the RecipeFactoryBase class.
Removed some Recipes after the decision to not port it or change it to loot tables in favor of recipes.
A lot more @Nonnull annotations.

Signed-off-by: canitzp <canitzp@gmail.com>
2020-10-07 08:25:54 +02:00

27 lines
978 B
Java

package de.ellpeck.actuallyadditions.data.recipes;
import de.ellpeck.actuallyadditions.common.ActuallyAdditions;
import de.ellpeck.actuallyadditions.common.recipes.CrusherRecipe;
import net.minecraft.data.DataGenerator;
import net.minecraft.data.IFinishedRecipe;
import net.minecraft.data.RecipeProvider;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.item.crafting.Ingredient;
import net.minecraft.util.ResourceLocation;
import java.util.function.Consumer;
public class CrusherRecipeGenerator extends RecipeProvider {
public CrusherRecipeGenerator(DataGenerator dataGenerator){
super(dataGenerator);
}
@Override
protected void registerRecipes(Consumer<IFinishedRecipe> consumer){
super.registerRecipes(consumer);
consumer.accept(new CrusherRecipe(new ResourceLocation(ActuallyAdditions.MODID, "test"), Ingredient.fromItems(Items.DIAMOND), new ItemStack(Items.DIRT, 64)));
}
}