Class Soil
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
Represents additional properties for a soil in a botany pot.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic 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 net.minecraft.resources.ResourceLocationFields inherited from interface net.minecraft.world.item.crafting.Recipe
CODEC, STREAM_CODEC -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract DisplaygetDisplay(BotanyPotContext context, @NotNull net.minecraft.world.level.Level level) Gets the display for the soil.abstract floatgetGrowthModifier(@NotNull BotanyPotContext context, @NotNull net.minecraft.world.level.Level level) Gets the modifier to apply to the crop growth rate.abstract intgetLightLevel(@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<?> getType()voidonTick(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, showNotificationMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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
-
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
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.
-