Package com.petrolpark.core.recipe
Record Class CropFertilizingRecipe
java.lang.Object
java.lang.Record
com.petrolpark.core.recipe.CropFertilizingRecipe
- All Implemented Interfaces:
IBiomeSpecificRecipe,net.minecraft.world.item.crafting.Recipe<CropFertilizingRecipe.Input>
public record CropFertilizingRecipe(net.minecraft.advancements.critereon.BlockPredicate crop, Optional<net.minecraft.advancements.critereon.BlockPredicate> soil, Optional<net.minecraft.advancements.critereon.BlockPredicate> subsoil, net.minecraft.world.item.crafting.Ingredient fertilizer, Optional<net.minecraft.core.HolderSet<net.minecraft.world.level.biome.Biome>> biomes, net.minecraft.world.level.block.state.BlockState result, Optional<net.minecraft.world.level.block.state.BlockState> soilResult, Optional<net.minecraft.world.level.block.state.BlockState> subsoilResult)
extends Record
implements net.minecraft.world.item.crafting.Recipe<CropFertilizingRecipe.Input>, IBiomeSpecificRecipe
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<CropFertilizingRecipe> static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, CropFertilizingRecipe> Fields inherited from interface net.minecraft.world.item.crafting.Recipe
CONDITIONAL_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionCropFertilizingRecipe(net.minecraft.advancements.critereon.BlockPredicate crop, Optional<net.minecraft.advancements.critereon.BlockPredicate> soil, Optional<net.minecraft.advancements.critereon.BlockPredicate> subsoil, net.minecraft.world.item.crafting.Ingredient fertilizer, Optional<net.minecraft.core.HolderSet<net.minecraft.world.level.biome.Biome>> biomes, net.minecraft.world.level.block.state.BlockState result, Optional<net.minecraft.world.level.block.state.BlockState> soilResult, Optional<net.minecraft.world.level.block.state.BlockState> subsoilResult) Creates an instance of aCropFertilizingReciperecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic final booleanapply(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos cropPos, net.minecraft.world.item.ItemStack stack, net.minecraft.world.entity.player.Player player) net.minecraft.world.item.ItemStackassemble(CropFertilizingRecipe.Input input, net.minecraft.core.HolderLookup.Provider registries) Optional<net.minecraft.core.HolderSet<net.minecraft.world.level.biome.Biome>> biomes()Returns the value of thebiomesrecord component.booleancanCraftInDimensions(int width, int height) net.minecraft.advancements.critereon.BlockPredicatecrop()Returns the value of thecroprecord component.static final net.minecraft.world.item.ItemStackdispense(net.minecraft.core.dispenser.BlockSource blockSource, net.minecraft.world.item.ItemStack stack) final booleanIndicates whether some other object is "equal to" this one.net.minecraft.world.item.crafting.IngredientReturns the value of thefertilizerrecord component.Optional<net.minecraft.core.HolderSet<net.minecraft.world.level.biome.Biome>> net.minecraft.world.item.ItemStackgetResultItem(net.minecraft.core.HolderLookup.Provider registries) net.minecraft.world.level.block.state.BlockStategetResultSoilState(net.minecraft.world.level.block.state.BlockState soilState) net.minecraft.world.item.ItemStacknet.minecraft.world.level.block.state.BlockStategetResultSubsoilState(net.minecraft.world.level.block.state.BlockState subsoilState) net.minecraft.world.item.crafting.RecipeSerializer<?> net.minecraft.world.item.crafting.RecipeType<?> getType()final inthashCode()Returns a hash code value for this object.booleanmatches(CropFertilizingRecipe.Input input, net.minecraft.world.level.Level level) static final voidonUseItemOnBlock(net.neoforged.neoforge.event.entity.player.UseItemOnBlockEvent event) net.minecraft.world.level.block.state.BlockStateresult()Returns the value of theresultrecord component.booleanbooleanOptional<net.minecraft.advancements.critereon.BlockPredicate> soil()Returns the value of thesoilrecord component.Optional<net.minecraft.world.level.block.state.BlockState> Returns the value of thesoilResultrecord component.Optional<net.minecraft.advancements.critereon.BlockPredicate> subsoil()Returns the value of thesubsoilrecord component.Optional<net.minecraft.world.level.block.state.BlockState> Returns the value of thesubsoilResultrecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.petrolpark.core.recipe.IBiomeSpecificRecipe
isValidAt, isValidInMethods inherited from interface net.minecraft.world.item.crafting.Recipe
getGroup, getIngredients, getRemainingItems, getToastSymbol, isIncomplete, isSpecial, showNotification
-
Field Details
-
CODEC
-
STREAM_CODEC
public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,CropFertilizingRecipe> STREAM_CODEC
-
-
Constructor Details
-
CropFertilizingRecipe
public CropFertilizingRecipe(net.minecraft.advancements.critereon.BlockPredicate crop, Optional<net.minecraft.advancements.critereon.BlockPredicate> soil, Optional<net.minecraft.advancements.critereon.BlockPredicate> subsoil, net.minecraft.world.item.crafting.Ingredient fertilizer, Optional<net.minecraft.core.HolderSet<net.minecraft.world.level.biome.Biome>> biomes, net.minecraft.world.level.block.state.BlockState result, Optional<net.minecraft.world.level.block.state.BlockState> soilResult, Optional<net.minecraft.world.level.block.state.BlockState> subsoilResult) Creates an instance of aCropFertilizingReciperecord class.- Parameters:
crop- the value for thecroprecord componentsoil- the value for thesoilrecord componentsubsoil- the value for thesubsoilrecord componentfertilizer- the value for thefertilizerrecord componentbiomes- the value for thebiomesrecord componentresult- the value for theresultrecord componentsoilResult- the value for thesoilResultrecord componentsubsoilResult- the value for thesubsoilResultrecord component
-
-
Method Details
-
apply
public static final boolean apply(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos cropPos, net.minecraft.world.item.ItemStack stack, @Nullable net.minecraft.world.entity.player.Player player) -
dispense
public static final net.minecraft.world.item.ItemStack dispense(net.minecraft.core.dispenser.BlockSource blockSource, net.minecraft.world.item.ItemStack stack) -
getResultStack
public net.minecraft.world.item.ItemStack getResultStack() -
shouldSetSoil
public boolean shouldSetSoil() -
getResultSoilState
public net.minecraft.world.level.block.state.BlockState getResultSoilState(net.minecraft.world.level.block.state.BlockState soilState) -
shouldSetSubSoil
public boolean shouldSetSubSoil() -
getResultSubsoilState
public net.minecraft.world.level.block.state.BlockState getResultSubsoilState(net.minecraft.world.level.block.state.BlockState subsoilState) -
getAllowedBiomes
public Optional<net.minecraft.core.HolderSet<net.minecraft.world.level.biome.Biome>> getAllowedBiomes()- Specified by:
getAllowedBiomesin interfaceIBiomeSpecificRecipe
-
matches
public boolean matches(@Nonnull CropFertilizingRecipe.Input input, @Nonnull net.minecraft.world.level.Level level) - Specified by:
matchesin interfacenet.minecraft.world.item.crafting.Recipe<CropFertilizingRecipe.Input>
-
assemble
public net.minecraft.world.item.ItemStack assemble(@Nonnull CropFertilizingRecipe.Input input, @Nonnull net.minecraft.core.HolderLookup.Provider registries) - Specified by:
assemblein interfacenet.minecraft.world.item.crafting.Recipe<CropFertilizingRecipe.Input>
-
canCraftInDimensions
public boolean canCraftInDimensions(int width, int height) - Specified by:
canCraftInDimensionsin interfacenet.minecraft.world.item.crafting.Recipe<CropFertilizingRecipe.Input>
-
getResultItem
public net.minecraft.world.item.ItemStack getResultItem(@Nonnull net.minecraft.core.HolderLookup.Provider registries) - Specified by:
getResultItemin interfacenet.minecraft.world.item.crafting.Recipe<CropFertilizingRecipe.Input>
-
getSerializer
public net.minecraft.world.item.crafting.RecipeSerializer<?> getSerializer()- Specified by:
getSerializerin interfacenet.minecraft.world.item.crafting.Recipe<CropFertilizingRecipe.Input>
-
getType
public net.minecraft.world.item.crafting.RecipeType<?> getType()- Specified by:
getTypein interfacenet.minecraft.world.item.crafting.Recipe<CropFertilizingRecipe.Input>
-
onUseItemOnBlock
public static final void onUseItemOnBlock(net.neoforged.neoforge.event.entity.player.UseItemOnBlockEvent event) -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
crop
public net.minecraft.advancements.critereon.BlockPredicate crop()Returns the value of thecroprecord component.- Returns:
- the value of the
croprecord component
-
soil
Returns the value of thesoilrecord component.- Returns:
- the value of the
soilrecord component
-
subsoil
Returns the value of thesubsoilrecord component.- Returns:
- the value of the
subsoilrecord component
-
fertilizer
public net.minecraft.world.item.crafting.Ingredient fertilizer()Returns the value of thefertilizerrecord component.- Returns:
- the value of the
fertilizerrecord component
-
biomes
Returns the value of thebiomesrecord component.- Returns:
- the value of the
biomesrecord component
-
result
public net.minecraft.world.level.block.state.BlockState result()Returns the value of theresultrecord component.- Returns:
- the value of the
resultrecord component
-
soilResult
Returns the value of thesoilResultrecord component.- Returns:
- the value of the
soilResultrecord component
-
subsoilResult
Returns the value of thesubsoilResultrecord component.- Returns:
- the value of the
subsoilResultrecord component
-