Search in sources :

Example 1 with RitualRecipe

use of moriyashiine.bewitchment.common.recipe.RitualRecipe in project bewitchment by MoriyaShiine.

the class RitualProcessor method setup.

@Override
public void setup(IVariableProvider variables) {
    String recipeId = variables.get("recipe").asString();
    RecipeManager manager = MinecraftClient.getInstance().world.getRecipeManager();
    recipe = (RitualRecipe) manager.get(new Identifier(recipeId)).filter(recipe -> recipe.getType().equals(BWRecipeTypes.RITUAL_RECIPE_TYPE)).orElseThrow(IllegalArgumentException::new);
}
Also used : BWRecipeTypes(moriyashiine.bewitchment.common.registry.BWRecipeTypes) IVariableProvider(vazkii.patchouli.api.IVariableProvider) ItemStack(net.minecraft.item.ItemStack) IVariable(vazkii.patchouli.api.IVariable) I18n(net.minecraft.client.resource.language.I18n) TranslatableText(net.minecraft.text.TranslatableText) RitualRecipe(moriyashiine.bewitchment.common.recipe.RitualRecipe) Identifier(net.minecraft.util.Identifier) IComponentProcessor(vazkii.patchouli.api.IComponentProcessor) MinecraftClient(net.minecraft.client.MinecraftClient) RecipeManager(net.minecraft.recipe.RecipeManager) Identifier(net.minecraft.util.Identifier) RecipeManager(net.minecraft.recipe.RecipeManager)

Aggregations

RitualRecipe (moriyashiine.bewitchment.common.recipe.RitualRecipe)1 BWRecipeTypes (moriyashiine.bewitchment.common.registry.BWRecipeTypes)1 MinecraftClient (net.minecraft.client.MinecraftClient)1 I18n (net.minecraft.client.resource.language.I18n)1 ItemStack (net.minecraft.item.ItemStack)1 RecipeManager (net.minecraft.recipe.RecipeManager)1 TranslatableText (net.minecraft.text.TranslatableText)1 Identifier (net.minecraft.util.Identifier)1 IComponentProcessor (vazkii.patchouli.api.IComponentProcessor)1 IVariable (vazkii.patchouli.api.IVariable)1 IVariableProvider (vazkii.patchouli.api.IVariableProvider)1