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
    Modifier and Type
    Class
    Description
    static final record 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static 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

    Constructors
    Constructor
    Description
    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 a CropFertilizingRecipe record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    static final boolean
    apply(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.ItemStack
    assemble(CropFertilizingRecipe.Input input, net.minecraft.core.HolderLookup.Provider registries)
     
    Optional<net.minecraft.core.HolderSet<net.minecraft.world.level.biome.Biome>>
    Returns the value of the biomes record component.
    boolean
    canCraftInDimensions(int width, int height)
     
    net.minecraft.advancements.critereon.BlockPredicate
    Returns the value of the crop record component.
    static final net.minecraft.world.item.ItemStack
    dispense(net.minecraft.core.dispenser.BlockSource blockSource, net.minecraft.world.item.ItemStack stack)
     
    final boolean
    Indicates whether some other object is "equal to" this one.
    net.minecraft.world.item.crafting.Ingredient
    Returns the value of the fertilizer record component.
    Optional<net.minecraft.core.HolderSet<net.minecraft.world.level.biome.Biome>>
     
    net.minecraft.world.item.ItemStack
    getResultItem(net.minecraft.core.HolderLookup.Provider registries)
     
    net.minecraft.world.level.block.state.BlockState
    getResultSoilState(net.minecraft.world.level.block.state.BlockState soilState)
     
    net.minecraft.world.item.ItemStack
     
    net.minecraft.world.level.block.state.BlockState
    getResultSubsoilState(net.minecraft.world.level.block.state.BlockState subsoilState)
     
    net.minecraft.world.item.crafting.RecipeSerializer<?>
     
    net.minecraft.world.item.crafting.RecipeType<?>
     
    final int
    Returns a hash code value for this object.
    boolean
    matches(CropFertilizingRecipe.Input input, net.minecraft.world.level.Level level)
     
    static final void
    onUseItemOnBlock(net.neoforged.neoforge.event.entity.player.UseItemOnBlockEvent event)
     
    net.minecraft.world.level.block.state.BlockState
    Returns the value of the result record component.
    boolean
     
    boolean
     
    Optional<net.minecraft.advancements.critereon.BlockPredicate>
    Returns the value of the soil record component.
    Optional<net.minecraft.world.level.block.state.BlockState>
    Returns the value of the soilResult record component.
    Optional<net.minecraft.advancements.critereon.BlockPredicate>
    Returns the value of the subsoil record component.
    Optional<net.minecraft.world.level.block.state.BlockState>
    Returns the value of the subsoilResult record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface com.petrolpark.core.recipe.IBiomeSpecificRecipe

    isValidAt, isValidIn

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

    getGroup, getIngredients, getRemainingItems, getToastSymbol, isIncomplete, isSpecial, showNotification
  • Field Details

    • CODEC

      public static final com.mojang.serialization.MapCodec<CropFertilizingRecipe> 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 a CropFertilizingRecipe record class.
      Parameters:
      crop - the value for the crop record component
      soil - the value for the soil record component
      subsoil - the value for the subsoil record component
      fertilizer - the value for the fertilizer record component
      biomes - the value for the biomes record component
      result - the value for the result record component
      soilResult - the value for the soilResult record component
      subsoilResult - the value for the subsoilResult record 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:
      getAllowedBiomes in interface IBiomeSpecificRecipe
    • matches

      public boolean matches(@Nonnull CropFertilizingRecipe.Input input, @Nonnull net.minecraft.world.level.Level level)
      Specified by:
      matches in interface net.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:
      assemble in interface net.minecraft.world.item.crafting.Recipe<CropFertilizingRecipe.Input>
    • canCraftInDimensions

      public boolean canCraftInDimensions(int width, int height)
      Specified by:
      canCraftInDimensions in interface net.minecraft.world.item.crafting.Recipe<CropFertilizingRecipe.Input>
    • getResultItem

      public net.minecraft.world.item.ItemStack getResultItem(@Nonnull net.minecraft.core.HolderLookup.Provider registries)
      Specified by:
      getResultItem in interface net.minecraft.world.item.crafting.Recipe<CropFertilizingRecipe.Input>
    • getSerializer

      public net.minecraft.world.item.crafting.RecipeSerializer<?> getSerializer()
      Specified by:
      getSerializer in interface net.minecraft.world.item.crafting.Recipe<CropFertilizingRecipe.Input>
    • getType

      public net.minecraft.world.item.crafting.RecipeType<?> getType()
      Specified by:
      getType in interface net.minecraft.world.item.crafting.Recipe<CropFertilizingRecipe.Input>
    • onUseItemOnBlock

      public static final void onUseItemOnBlock(net.neoforged.neoforge.event.entity.player.UseItemOnBlockEvent event)
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • crop

      public net.minecraft.advancements.critereon.BlockPredicate crop()
      Returns the value of the crop record component.
      Returns:
      the value of the crop record component
    • soil

      public Optional<net.minecraft.advancements.critereon.BlockPredicate> soil()
      Returns the value of the soil record component.
      Returns:
      the value of the soil record component
    • subsoil

      public Optional<net.minecraft.advancements.critereon.BlockPredicate> subsoil()
      Returns the value of the subsoil record component.
      Returns:
      the value of the subsoil record component
    • fertilizer

      public net.minecraft.world.item.crafting.Ingredient fertilizer()
      Returns the value of the fertilizer record component.
      Returns:
      the value of the fertilizer record component
    • biomes

      public Optional<net.minecraft.core.HolderSet<net.minecraft.world.level.biome.Biome>> biomes()
      Returns the value of the biomes record component.
      Returns:
      the value of the biomes record component
    • result

      public net.minecraft.world.level.block.state.BlockState result()
      Returns the value of the result record component.
      Returns:
      the value of the result record component
    • soilResult

      public Optional<net.minecraft.world.level.block.state.BlockState> soilResult()
      Returns the value of the soilResult record component.
      Returns:
      the value of the soilResult record component
    • subsoilResult

      public Optional<net.minecraft.world.level.block.state.BlockState> subsoilResult()
      Returns the value of the subsoilResult record component.
      Returns:
      the value of the subsoilResult record component