Search in sources :

Example 1 with ActionRemoveRecipe

use of com.blamejared.crafttweaker.impl.actions.recipes.ActionRemoveRecipe in project AstralSorcery by HellFirePvP.

the class BlockTransmutationManager method removeRecipe.

@ZenCodeType.Method
public void removeRecipe(BlockState outputState, boolean exact) {
    BlockMatchInformation matcher = new BlockMatchInformation(outputState, exact);
    CraftTweakerAPI.apply(new ActionRemoveRecipe(this, iRecipe -> {
        if (iRecipe instanceof BlockTransmutation) {
            BlockTransmutation recipe = (BlockTransmutation) iRecipe;
            return matcher.test(recipe.getOutput());
        }
        return false;
    }, action -> "Removing Block Transmutation recipes that output " + ExpandBlockState.getCommandString(outputState)));
}
Also used : CraftTweakerAPI(com.blamejared.crafttweaker.api.CraftTweakerAPI) ActionRemoveRecipe(com.blamejared.crafttweaker.impl.actions.recipes.ActionRemoveRecipe) IRecipeManager(com.blamejared.crafttweaker.api.managers.IRecipeManager) ActionAddRecipe(com.blamejared.crafttweaker.impl.actions.recipes.ActionAddRecipe) BlockTransmutation(hellfirepvp.astralsorcery.common.crafting.recipe.BlockTransmutation) RegistriesAS(hellfirepvp.astralsorcery.common.lib.RegistriesAS) ITag(net.minecraft.tags.ITag) ZenCodeType(org.openzen.zencode.java.ZenCodeType) IItemStack(com.blamejared.crafttweaker.api.item.IItemStack) ExpandBlockState(com.blamejared.crafttweaker.impl_native.blocks.ExpandBlockState) BlockMatchInformation(hellfirepvp.astralsorcery.common.util.block.BlockMatchInformation) IRecipeType(net.minecraft.item.crafting.IRecipeType) Consumer(java.util.function.Consumer) ZenRegister(com.blamejared.crafttweaker.api.annotations.ZenRegister) Block(net.minecraft.block.Block) IWeakConstellation(hellfirepvp.astralsorcery.common.constellation.IWeakConstellation) ResourceLocation(net.minecraft.util.ResourceLocation) RecipeTypesAS(hellfirepvp.astralsorcery.common.lib.RecipeTypesAS) IConstellation(hellfirepvp.astralsorcery.common.constellation.IConstellation) MCTag(com.blamejared.crafttweaker.impl.tag.MCTag) BlockState(net.minecraft.block.BlockState) BlockMatchInformation(hellfirepvp.astralsorcery.common.util.block.BlockMatchInformation) BlockTransmutation(hellfirepvp.astralsorcery.common.crafting.recipe.BlockTransmutation) ActionRemoveRecipe(com.blamejared.crafttweaker.impl.actions.recipes.ActionRemoveRecipe)

Aggregations

CraftTweakerAPI (com.blamejared.crafttweaker.api.CraftTweakerAPI)1 ZenRegister (com.blamejared.crafttweaker.api.annotations.ZenRegister)1 IItemStack (com.blamejared.crafttweaker.api.item.IItemStack)1 IRecipeManager (com.blamejared.crafttweaker.api.managers.IRecipeManager)1 ActionAddRecipe (com.blamejared.crafttweaker.impl.actions.recipes.ActionAddRecipe)1 ActionRemoveRecipe (com.blamejared.crafttweaker.impl.actions.recipes.ActionRemoveRecipe)1 MCTag (com.blamejared.crafttweaker.impl.tag.MCTag)1 ExpandBlockState (com.blamejared.crafttweaker.impl_native.blocks.ExpandBlockState)1 IConstellation (hellfirepvp.astralsorcery.common.constellation.IConstellation)1 IWeakConstellation (hellfirepvp.astralsorcery.common.constellation.IWeakConstellation)1 BlockTransmutation (hellfirepvp.astralsorcery.common.crafting.recipe.BlockTransmutation)1 RecipeTypesAS (hellfirepvp.astralsorcery.common.lib.RecipeTypesAS)1 RegistriesAS (hellfirepvp.astralsorcery.common.lib.RegistriesAS)1 BlockMatchInformation (hellfirepvp.astralsorcery.common.util.block.BlockMatchInformation)1 Consumer (java.util.function.Consumer)1 Block (net.minecraft.block.Block)1 BlockState (net.minecraft.block.BlockState)1 IRecipeType (net.minecraft.item.crafting.IRecipeType)1 ITag (net.minecraft.tags.ITag)1 ResourceLocation (net.minecraft.util.ResourceLocation)1