Package vazkii.botania.client.patchouli
Class PatchouliUtils
java.lang.Object
vazkii.botania.client.patchouli.PatchouliUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends net.minecraft.world.item.crafting.Recipe<C>,C extends net.minecraft.world.item.crafting.RecipeInput>
TgetRecipe(net.minecraft.world.level.Level level, net.minecraft.world.item.crafting.RecipeType<T> type, net.minecraft.resources.ResourceLocation id) Gets a recipe of a specified type and ID, and replaces the namespace withcrafttweakerto try and find replacements if the recipe doesn't exist.static <T extends net.minecraft.world.item.crafting.Recipe<C>,C extends net.minecraft.world.item.crafting.RecipeInput>
List<T> getRecipeGroup(net.minecraft.world.item.crafting.RecipeType<T> type, String group) Get all recipes of the specified type that belong to the specified recipe group.static vazkii.patchouli.api.IVariableinterweaveIngredients(List<net.minecraft.world.item.crafting.Ingredient> ingredients, int longestIngredientSize, net.minecraft.world.level.Level level) Combines the ingredients, returning the first matching stack of each, then the second stack of each, etc.static vazkii.patchouli.api.IVariableinterweaveIngredients(List<net.minecraft.world.item.crafting.Ingredient> ingredients, net.minecraft.world.level.Level level) Overload of the method above that uses the provided list's longest ingredient size.static booleanWorkaround for Patchouli limitation - Allow block entity-rendered blocks to detect being rendered in a multiblock visualization and switch to block model rendering to actually be visible.static voidsetInVisualizer(boolean inVisualization)
-
Constructor Details
-
PatchouliUtils
public PatchouliUtils()
-
-
Method Details
-
getRecipe
public static <T extends net.minecraft.world.item.crafting.Recipe<C>,C extends net.minecraft.world.item.crafting.RecipeInput> T getRecipe(net.minecraft.world.level.Level level, net.minecraft.world.item.crafting.RecipeType<T> type, net.minecraft.resources.ResourceLocation id) Gets a recipe of a specified type and ID, and replaces the namespace withcrafttweakerto try and find replacements if the recipe doesn't exist. If the recipe has no replacement, it will be logged. -
getRecipeGroup
public static <T extends net.minecraft.world.item.crafting.Recipe<C>,C extends net.minecraft.world.item.crafting.RecipeInput> List<T> getRecipeGroup(net.minecraft.world.item.crafting.RecipeType<T> type, String group) Get all recipes of the specified type that belong to the specified recipe group. -
interweaveIngredients
public static vazkii.patchouli.api.IVariable interweaveIngredients(List<net.minecraft.world.item.crafting.Ingredient> ingredients, int longestIngredientSize, net.minecraft.world.level.Level level) Combines the ingredients, returning the first matching stack of each, then the second stack of each, etc. looping back ingredients that run out of matched stacks, until the ingredients reach the length of the longest ingredient in the recipe set.- Parameters:
ingredients- List of ingredients in the specific slotlongestIngredientSize- Longest ingredient in the entire recipe- Returns:
- Serialized Patchouli ingredient string
-
interweaveIngredients
public static vazkii.patchouli.api.IVariable interweaveIngredients(List<net.minecraft.world.item.crafting.Ingredient> ingredients, net.minecraft.world.level.Level level) Overload of the method above that uses the provided list's longest ingredient size. -
isInVisualizer
public static boolean isInVisualizer()Workaround for Patchouli limitation - Allow block entity-rendered blocks to detect being rendered in a multiblock visualization and switch to block model rendering to actually be visible. -
setInVisualizer
public static void setInVisualizer(boolean inVisualization)
-