Class BasicSoil
java.lang.Object
net.darkhax.bookshelf.api.data.recipes.RecipeBase<C>
net.darkhax.bookshelf.api.data.recipes.RecipeBaseData<net.minecraft.world.Container>
net.darkhax.botanypots.data.recipes.soil.Soil
net.darkhax.botanypots.data.recipes.soil.BasicSoil
- All Implemented Interfaces:
net.minecraft.world.item.crafting.Recipe<net.minecraft.world.Container>
-
Field Summary
FieldsModifier and TypeFieldDescriptionAn array of associated soil categories.protected DisplayStateThe blockstate used to render the soil.protected floatA modifier applied to the growth time of the crop.protected net.minecraft.world.item.crafting.IngredientThe item used to get the soil into the pot.protected intThe light level for the soil when placed in a botany pot. -
Constructor Summary
ConstructorsConstructorDescriptionBasicSoil(net.minecraft.resources.ResourceLocation id, net.minecraft.world.item.crafting.Ingredient ingredient, DisplayState renderState, float growthModifier, Set<String> categories, int lightLevel) -
Method Summary
Modifier and TypeMethodDescriptionbooleancanGrowCrop(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, BlockEntityBotanyPot pot, Crop crop) Determines if a given crop can grow in this soil.getCategories(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, BlockEntityBotanyPot pot) Gets a set of soil categories associated with the soil.getDisplayState(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, BlockEntityBotanyPot pot) Gets the display state for the soil.floatfloatgetGrowthModifier(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, BlockEntityBotanyPot pot, Crop crop) Gets the growth modifier applied by the soil when growing a crop.net.minecraft.world.item.crafting.IngredientintintgetLightLevel(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, BlockEntityBotanyPot pot) Gets the light level emitted by the soil when placed in a pot.net.minecraft.world.item.crafting.RecipeSerializer<?>net.minecraft.world.item.crafting.RecipeType<?>getType()booleanmatchesLookup(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, BlockEntityBotanyPot pot, net.minecraft.world.item.ItemStack placedStack) Tests if the soil matches the provided placement context.Methods inherited from class net.darkhax.botanypots.data.recipes.soil.Soil
onGrowthTick, onTickMethods inherited from class net.darkhax.bookshelf.api.data.recipes.RecipeBaseData
assemble, canCraftInDimensions, getResultItem, matchesMethods inherited from class net.darkhax.bookshelf.api.data.recipes.RecipeBase
getIdMethods 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, isSpecial, showNotification
-
Field Details
-
ingredient
protected net.minecraft.world.item.crafting.Ingredient ingredientThe item used to get the soil into the pot. -
displayState
The blockstate used to render the soil. -
growthModifier
protected float growthModifierA modifier applied to the growth time of the crop. -
categories
An array of associated soil categories. -
lightLevel
protected int lightLevelThe light level for the soil when placed in a botany pot.
-
-
Constructor Details
-
BasicSoil
public BasicSoil(net.minecraft.resources.ResourceLocation id, net.minecraft.world.item.crafting.Ingredient ingredient, DisplayState renderState, float growthModifier, Set<String> categories, int lightLevel)
-
-
Method Details
-
matchesLookup
public boolean matchesLookup(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, BlockEntityBotanyPot pot, net.minecraft.world.item.ItemStack placedStack) Description copied from class:SoilTests if the soil matches the provided placement context. This is used when looking up soils from their ItemStack and determines which soil they represent.- Specified by:
matchesLookupin classSoil- Parameters:
level- The current world level that the soil is in.pos- The position of the pot.pot- The pot being used.placedStack- The ItemStack being placed.- Returns:
- Whether the soil matches the lookup context or not.
-
getGrowthModifier
public float getGrowthModifier(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, BlockEntityBotanyPot pot, @Nullable Crop crop) Description copied from class:SoilGets the growth modifier applied by the soil when growing a crop. The growth modifier will be multiplied by the crops total growth time to create the required growth time. For example a growth modifier of 0.5f would make a crop that normally takes 1200 ticks to grow take just 600 ticks. A modifier of 2 would make the same crop take 2400 ticks. The base growth modifier value is 1f.The crop parameter may be null in some circumstances. This indicates that the crop is not available in the current context, such as generating tooltip information.
- Specified by:
getGrowthModifierin classSoil- Parameters:
level- The current world level that the soil is in.pos- The position that the soil is being used at.pot- The pot using the soil.crop- The crop being grown in the soil.- Returns:
- The growth modifier applied to the crop growth time when planted in this soil.
-
getLightLevel
public int getLightLevel(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, BlockEntityBotanyPot pot) Description copied from class:SoilGets the light level emitted by the soil when placed in a pot.- Specified by:
getLightLevelin classSoil- Parameters:
level- The current world level that the soil is in.pos- The position that the soil is being used at.pot- The pot using the soil.- Returns:
- The light level for the soil within the pot. This should be a value between 0 and 15.
-
canGrowCrop
public boolean canGrowCrop(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, BlockEntityBotanyPot pot, Crop crop) Description copied from class:SoilDetermines if a given crop can grow in this soil.- Specified by:
canGrowCropin classSoil- Parameters:
level- The current world level that the soil is in.pos- The position that the soil is being used at.pot- The pot using the soil.crop- The crop being tested.- Returns:
- Whether the crop can grow in the soil or not.
-
getCategories
public Set<String> getCategories(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, BlockEntityBotanyPot pot) Description copied from class:SoilGets a set of soil categories associated with the soil.- Specified by:
getCategoriesin classSoil- Parameters:
level- The current world level that the soil is in.pos- The position that the soil is being used at.pot- The pot using the soil.- Returns:
- A set of soil categories associated with the soil.
-
getDisplayState
public DisplayState getDisplayState(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, BlockEntityBotanyPot pot) Description copied from class:SoilGets the display state for the soil. This will be used to render the soil in the pot.- Specified by:
getDisplayStatein classSoil- Parameters:
level- The current world level that the soil is in.pos- The position that the soil is being used at.pot- The pot using the soil.- Returns:
- A display state to render inside the botany pot.
-
getType
public net.minecraft.world.item.crafting.RecipeType<?> getType() -
getSerializer
public net.minecraft.world.item.crafting.RecipeSerializer<?> getSerializer() -
getIngredient
public net.minecraft.world.item.crafting.Ingredient getIngredient() -
getDisplayState
-
getGrowthModifier
public float getGrowthModifier() -
getCategories
-
getLightLevel
public int getLightLevel()
-