ActuallyAdditions/src/main/java/de/ellpeck/actuallyadditions/common/recipes/CoffeeMachineIngredient.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

59 lines
1.7 KiB
Java

package de.ellpeck.actuallyadditions.common.recipes;
import net.minecraft.item.crafting.IRecipeSerializer;
import net.minecraft.item.crafting.IRecipeType;
import net.minecraft.item.crafting.Ingredient;
import net.minecraft.potion.EffectInstance;
import net.minecraft.util.ResourceLocation;
import javax.annotation.Nonnull;
public class CoffeeMachineIngredient implements IDummyRecipe<CoffeeMachineIngredient> {
public static final IRecipeType<CoffeeMachineIngredient> COFFEE_MACHINE_RECIPE_TYPE = IRecipeType.register("actuallyadditions:coffee_machine");
@Nonnull private final ResourceLocation recipeId;
@Nonnull private final Ingredient input;
private final int maxAmplifier;
@Nonnull private final EffectInstance[] effects;
public CoffeeMachineIngredient(@Nonnull ResourceLocation recipeId, @Nonnull Ingredient input, int maxAmplifier, @Nonnull EffectInstance[] effects){
this.recipeId = recipeId;
this.input = input;
this.maxAmplifier = maxAmplifier;
this.effects = effects;
}
@Nonnull
public Ingredient getInput(){
return input;
}
public int getMaxAmplifier(){
return maxAmplifier;
}
@Nonnull
public EffectInstance[] getEffects(){
return effects;
}
@Nonnull
@Override
public ResourceLocation getId(){
return this.recipeId;
}
@Nonnull
@Override
public IRecipeSerializer<CoffeeMachineIngredient> getSerializer(){
return CoffeeMachineIngredientFactory.INSTANCE;
}
@Nonnull
@Override
public IRecipeType<?> getType(){
return COFFEE_MACHINE_RECIPE_TYPE;
}
}