Record Class HugeRedMushroomFeature

java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.feature.HugeRedMushroomFeature
All Implemented Interfaces:
AbstractHugeMushroomFeature, Feature

public record HugeRedMushroomFeature(Holder<BlockStateProvider> capProvider, Holder<BlockStateProvider> stemProvider, int foliageRadius, BlockPredicate canPlaceOn) extends Record implements AbstractHugeMushroomFeature
  • Field Details

    • capProvider

      private final Holder<BlockStateProvider> capProvider
      The field for the capProvider record component.
    • stemProvider

      private final Holder<BlockStateProvider> stemProvider
      The field for the stemProvider record component.
    • foliageRadius

      private final int foliageRadius
      The field for the foliageRadius record component.
    • canPlaceOn

      private final BlockPredicate canPlaceOn
      The field for the canPlaceOn record component.
    • CODEC

      public static final com.mojang.serialization.MapCodec<HugeRedMushroomFeature> CODEC
  • Constructor Details

    • HugeRedMushroomFeature

      public HugeRedMushroomFeature(Holder<BlockStateProvider> capProvider, Holder<BlockStateProvider> stemProvider, int foliageRadius, BlockPredicate canPlaceOn)
      Creates an instance of a HugeRedMushroomFeature record class.
      Parameters:
      capProvider - the value for the capProvider record component
      stemProvider - the value for the stemProvider record component
      foliageRadius - the value for the foliageRadius record component
      canPlaceOn - the value for the canPlaceOn record component
  • Method Details

    • codec

      public com.mojang.serialization.MapCodec<HugeRedMushroomFeature> codec()
      Specified by:
      codec in interface AbstractHugeMushroomFeature
      Specified by:
      codec in interface Feature
    • makeCap

      public void makeCap(WorldGenLevel level, RandomSource random, BlockPos origin, int treeHeight, BlockPos.MutableBlockPos blockPos)
      Specified by:
      makeCap in interface AbstractHugeMushroomFeature
    • getTreeRadiusForHeight

      public int getTreeRadiusForHeight(int trunkHeight, int treeHeight, int leafRadius, int yo)
      Specified by:
      getTreeRadiusForHeight in interface AbstractHugeMushroomFeature
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      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.
    • capProvider

      public Holder<BlockStateProvider> capProvider()
      Returns the value of the capProvider record component.
      Specified by:
      capProvider in interface AbstractHugeMushroomFeature
      Returns:
      the value of the capProvider record component
    • stemProvider

      public Holder<BlockStateProvider> stemProvider()
      Returns the value of the stemProvider record component.
      Specified by:
      stemProvider in interface AbstractHugeMushroomFeature
      Returns:
      the value of the stemProvider record component
    • foliageRadius

      public int foliageRadius()
      Returns the value of the foliageRadius record component.
      Specified by:
      foliageRadius in interface AbstractHugeMushroomFeature
      Returns:
      the value of the foliageRadius record component
    • canPlaceOn

      public BlockPredicate canPlaceOn()
      Returns the value of the canPlaceOn record component.
      Specified by:
      canPlaceOn in interface AbstractHugeMushroomFeature
      Returns:
      the value of the canPlaceOn record component