Class BasicFertilizer
java.lang.Object
net.darkhax.botanypots.common.api.data.recipes.BotanyPotRecipe
net.darkhax.botanypots.common.api.data.recipes.fertilizer.Fertilizer
net.darkhax.botanypots.common.impl.data.recipe.fertilizer.BasicFertilizer
- All Implemented Interfaces:
CacheableRecipe,net.minecraft.world.item.crafting.Recipe<BotanyPotContext>
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<BasicFertilizer> static final net.minecraft.world.item.crafting.RecipeSerializer<BasicFertilizer> static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, BasicFertilizer> Fields inherited from class net.darkhax.botanypots.common.api.data.recipes.fertilizer.Fertilizer
CACHE, RECIPES, TYPEFields inherited from interface net.minecraft.world.item.crafting.Recipe
STREAM_CODEC -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidapply(@NotNull BotanyPotContext input, @NotNull net.minecraft.world.level.Level level) Applies the fertilizer to the crop.booleanDetermines if recipe can be cached based on the deserialized contents of the recipe.booleancouldMatch(net.minecraft.world.item.ItemStack candidate, BotanyPotContext context, net.minecraft.world.level.Level level) Tests if the recipe is valid for the current context.@NotNull net.minecraft.world.item.crafting.RecipeSerializer<?> booleanisCacheKey(net.minecraft.world.item.ItemStack stack) Determines if a given item would be a valid cache key for this recipe.booleanmatches(@NotNull BotanyPotContext input, @NotNull net.minecraft.world.level.Level level) Methods inherited from class net.darkhax.botanypots.common.api.data.recipes.fertilizer.Fertilizer
getFertilizer, getTypeMethods inherited from class net.darkhax.botanypots.common.api.data.recipes.BotanyPotRecipe
assemble, canCraftInDimensions, 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, getToastSymbol, isIncomplete
-
Field Details
-
CODEC
-
STREAM
public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,BasicFertilizer> STREAM -
SERIALIZER
-
-
Constructor Details
-
BasicFertilizer
-
-
Method Details
-
getProperties
-
apply
public void apply(@NotNull @NotNull BotanyPotContext input, @NotNull @NotNull net.minecraft.world.level.Level level) Description copied from class:FertilizerApplies the fertilizer to the crop.- Specified by:
applyin classFertilizer- Parameters:
input- The context that the fertilizer is being used in.level- The current game level.
-
matches
public boolean matches(@NotNull @NotNull BotanyPotContext input, @NotNull @NotNull net.minecraft.world.level.Level level) - Specified by:
matchesin interfacenet.minecraft.world.item.crafting.Recipe<BotanyPotContext>
-
canBeCached
public boolean canBeCached()Description copied from interface:CacheableRecipeDetermines 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:
canBeCachedin interfaceCacheableRecipe- Returns:
- If the recipe can be cached.
-
isCacheKey
public boolean isCacheKey(net.minecraft.world.item.ItemStack stack) Description copied from interface:CacheableRecipeDetermines 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:
isCacheKeyin interfaceCacheableRecipe- Parameters:
stack- The item to test.- Returns:
- If the item is a valid cache key for this recipe.
-
getSerializer
@NotNull public @NotNull net.minecraft.world.item.crafting.RecipeSerializer<?> getSerializer()- Specified by:
getSerializerin interfacenet.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:BotanyPotRecipeTests if the recipe is valid for the current context.- Specified by:
couldMatchin classBotanyPotRecipe- Parameters:
candidate- The item to test.context- The current context.level- The current game level.- Returns:
- If the recipe is valid.
-