Class PatchouliUtils

java.lang.Object
vazkii.botania.client.patchouli.PatchouliUtils

public class PatchouliUtils extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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 with crafttweaker to 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.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.
    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.
    static boolean
    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.
    static void
    setInVisualizer(boolean inVisualization)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 with crafttweaker to 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 slot
      longestIngredientSize - 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)