Search in sources :

Example 1 with CuttingRecipe

use of com.everlastsino.cate.recipe.recipes.CuttingRecipe in project SinoCate by EverlastSino.

the class CuttingBoardBlockEntity method matchRecipe.

public void matchRecipe() {
    if (this.world == null || this.itemStack.isEmpty())
        return;
    Optional<CuttingRecipe> recipe = this.world.getRecipeManager().getFirstMatch(CateRecipes.Cutting_RecipeType, new SimpleInventory(this.itemStack), this.world);
    if (recipe.isEmpty())
        return;
    CuttingRecipe newRecipe = recipe.get();
    this.requireSteps = newRecipe.steps;
    this.result = newRecipe.result.copy();
    this.tool = newRecipe.tool.copy();
    this.damageTool = newRecipe.damageTool;
    this.step = 0;
    this.matchedRecipe = true;
}
Also used : CuttingRecipe(com.everlastsino.cate.recipe.recipes.CuttingRecipe) SimpleInventory(net.minecraft.inventory.SimpleInventory)

Aggregations

CuttingRecipe (com.everlastsino.cate.recipe.recipes.CuttingRecipe)1 SimpleInventory (net.minecraft.inventory.SimpleInventory)1