java.lang.Object
net.darkhax.botanypots.common.api.data.recipes.BotanyPotRecipe
net.darkhax.botanypots.common.api.data.recipes.soil.Soil
All Implemented Interfaces:
net.minecraft.world.item.crafting.Recipe<BotanyPotContext>
Direct Known Subclasses:
BasicSoil

public abstract class Soil extends BotanyPotRecipe
Represents additional properties for a soil in a botany pot.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final net.darkhax.bookshelf.common.api.function.SidedReloadableCache<RecipeCache<Soil>>
     
    static final net.darkhax.bookshelf.common.api.function.SidedReloadableCache<Map<net.minecraft.resources.ResourceLocation,net.minecraft.world.item.crafting.RecipeHolder<Soil>>>
     
    static final Supplier<net.minecraft.world.item.crafting.RecipeType<Soil>>
     
    static final net.minecraft.resources.ResourceLocation
     

    Fields inherited from interface net.minecraft.world.item.crafting.Recipe

    CODEC, STREAM_CODEC
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract Display
    getDisplay(BotanyPotContext context, @NotNull net.minecraft.world.level.Level level)
    Gets the display for the soil.
    abstract float
    getGrowthModifier(@NotNull BotanyPotContext context, @NotNull net.minecraft.world.level.Level level)
    Gets the modifier to apply to the crop growth rate.
    abstract int
    getLightLevel(@NotNull BotanyPotContext context, @NotNull net.minecraft.world.level.Level level)
    Gets the light level emitted by the soil.
    static @Nullable net.minecraft.world.item.crafting.RecipeHolder<Soil>
    getSoil(net.minecraft.world.level.Level level, BotanyPotContext context, net.minecraft.world.item.ItemStack stack)
    Gets the soil that best represents a given item stack.
    @NotNull net.minecraft.world.item.crafting.RecipeType<?>
     
    void
    onTick(BotanyPotContext context, net.minecraft.world.level.Level level)
    An optional hook that fires every tick the soil is in a botany pot.

    Methods inherited from class net.darkhax.botanypots.common.api.data.recipes.BotanyPotRecipe

    assemble, canCraftInDimensions, couldMatch, getResultItem, hoverTooltip, isSpecial, recipeCodec, recipeStream, showNotification

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface net.minecraft.world.item.crafting.Recipe

    getGroup, getIngredients, getRemainingItems, getSerializer, getToastSymbol, isIncomplete, matches
  • Field Details

    • TYPE_ID

      public static final net.minecraft.resources.ResourceLocation TYPE_ID
    • TYPE

      public static final Supplier<net.minecraft.world.item.crafting.RecipeType<Soil>> TYPE
    • RECIPES

      public static final net.darkhax.bookshelf.common.api.function.SidedReloadableCache<Map<net.minecraft.resources.ResourceLocation,net.minecraft.world.item.crafting.RecipeHolder<Soil>>> RECIPES
    • CACHE

      public static final net.darkhax.bookshelf.common.api.function.SidedReloadableCache<RecipeCache<Soil>> CACHE
  • Constructor Details

    • Soil

      public Soil()
  • Method Details

    • getGrowthModifier

      public abstract float getGrowthModifier(@NotNull @NotNull BotanyPotContext context, @NotNull @NotNull net.minecraft.world.level.Level level)
      Gets the modifier to apply to the crop growth rate.
      Parameters:
      context - The current context.
      level - The current game level.
      Returns:
      The growth modifier of the soil.
    • getLightLevel

      public abstract int getLightLevel(@NotNull @NotNull BotanyPotContext context, @NotNull @NotNull net.minecraft.world.level.Level level)
      Gets the light level emitted by the soil.
      Parameters:
      context - The current context.
      level - The current game level.
      Returns:
      The light level emitted by the soil.
    • getDisplay

      public abstract Display getDisplay(BotanyPotContext context, @NotNull @NotNull net.minecraft.world.level.Level level)
      Gets the display for the soil.
      Parameters:
      context - The current context.
      level - The current game level.
      Returns:
      The display for the soil.
    • onTick

      public void onTick(BotanyPotContext context, net.minecraft.world.level.Level level)
      An optional hook that fires every tick the soil is in a botany pot.
      Parameters:
      context - The current context.
      level - The current game level.
    • getType

      @NotNull public @NotNull net.minecraft.world.item.crafting.RecipeType<?> getType()
    • getSoil

      @Nullable public static @Nullable net.minecraft.world.item.crafting.RecipeHolder<Soil> getSoil(net.minecraft.world.level.Level level, BotanyPotContext context, net.minecraft.world.item.ItemStack stack)
      Gets the soil that best represents a given item stack.
      Parameters:
      level - The current game level.
      context - The current context.
      stack - The item to lookup.
      Returns:
      The soil that best represents the given item stack.