All Implemented Interfaces:
CacheableRecipe, net.minecraft.world.item.crafting.Recipe<BotanyPotContext>

public class BasicPotInteraction extends PotInteraction implements CacheableRecipe
  • Field Details

  • Constructor Details

  • Method Details

    • getProperties

      public BasicPotInteraction.Properties getProperties()
    • apply

      public void apply(@NotNull @NotNull BotanyPotContext context)
      Description copied from class: PotInteraction
      Applies the interaction effect to the given context.
      Specified by:
      apply in class PotInteraction
      Parameters:
      context - The current context.
    • matches

      public boolean matches(@NotNull @NotNull BotanyPotContext input, @NotNull @NotNull net.minecraft.world.level.Level level)
      Specified by:
      matches in interface net.minecraft.world.item.crafting.Recipe<BotanyPotContext>
    • getSerializer

      @NotNull public @NotNull net.minecraft.world.item.crafting.RecipeSerializer<?> getSerializer()
      Specified by:
      getSerializer in interface net.minecraft.world.item.crafting.Recipe<BotanyPotContext>
    • couldMatch

      public boolean couldMatch(net.minecraft.world.item.ItemStack candidate, BotanyPotContext context, net.minecraft.world.level.Level level)
      Description copied from class: BotanyPotRecipe
      Tests if the recipe is valid for the current context.
      Specified by:
      couldMatch in class BotanyPotRecipe
      Parameters:
      candidate - The item to test.
      context - The current context.
      level - The current game level.
      Returns:
      If the recipe is valid.
    • canBeCached

      public boolean canBeCached()
      Description copied from interface: CacheableRecipe
      Determines if recipe can be cached based on the deserialized contents of the recipe. For example, imagine a recipe with an optional list of non-cacheable conditions. If this list is not present or empty, the recipe could be cached when it otherwise could not.
      Specified by:
      canBeCached in interface CacheableRecipe
      Returns:
      If the recipe can be cached.
    • isCacheKey

      public boolean isCacheKey(net.minecraft.world.item.ItemStack stack)
      Description copied from interface: CacheableRecipe
      Determines if a given item would be a valid cache key for this recipe. Recipes can have more than one valid key.

      Implementations should only check intrinsic properties of the stack like the item id, tags, and the type of the item. Properties like data components should not be checked as these are not intrinsic to the item. An ItemStack is only provided in this context because it is needed to test Ingredient.

      Specified by:
      isCacheKey in interface CacheableRecipe
      Parameters:
      stack - The item to test.
      Returns:
      If the item is a valid cache key for this recipe.