Record Class HugeFungusFeature

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

public record HugeFungusFeature(BlockState validBaseState, BlockState stemState, BlockState hatState, BlockState decorState, BlockPredicate replaceableBlocks, boolean planted) extends Record implements Feature
  • Field Details

    • validBaseState

      private final BlockState validBaseState
      The field for the validBaseState record component.
    • stemState

      private final BlockState stemState
      The field for the stemState record component.
    • hatState

      private final BlockState hatState
      The field for the hatState record component.
    • decorState

      private final BlockState decorState
      The field for the decorState record component.
    • replaceableBlocks

      private final BlockPredicate replaceableBlocks
      The field for the replaceableBlocks record component.
    • planted

      private final boolean planted
      The field for the planted record component.
    • HUGE_PROBABILITY

      private static final float HUGE_PROBABILITY
      See Also:
    • CODEC

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

    • HugeFungusFeature

      public HugeFungusFeature(BlockState validBaseState, BlockState stemState, BlockState hatState, BlockState decorState, BlockPredicate replaceableBlocks, boolean planted)
      Creates an instance of a HugeFungusFeature record class.
      Parameters:
      validBaseState - the value for the validBaseState record component
      stemState - the value for the stemState record component
      hatState - the value for the hatState record component
      decorState - the value for the decorState record component
      replaceableBlocks - the value for the replaceableBlocks record component
      planted - the value for the planted record component
  • Method Details

    • codec

      public com.mojang.serialization.MapCodec<HugeFungusFeature> codec()
      Specified by:
      codec in interface Feature
    • place

      public boolean place(WorldGenLevel level, ChunkGenerator chunkGenerator, RandomSource random, BlockPos origin)
      Specified by:
      place in interface Feature
    • isReplaceable

      private boolean isReplaceable(WorldGenLevel level, BlockPos pos, boolean checkNonReplaceablePlants)
    • placeStem

      private void placeStem(WorldGenLevel level, RandomSource random, BlockPos surfaceOrigin, int totalHeight, boolean isHuge)
    • placeHat

      private void placeHat(WorldGenLevel level, RandomSource random, BlockPos surfaceOrigin, int totalHeight, boolean isHuge)
    • placeHatBlock

      private void placeHatBlock(LevelAccessor level, RandomSource random, BlockPos.MutableBlockPos blockPos, float decorBlockProbability, float hatBlockProbability, float vinesProbability)
    • placeHatDropBlock

      private void placeHatDropBlock(LevelAccessor level, RandomSource random, BlockPos blockPos, boolean placeVines)
    • tryPlaceWeepingVines

      private static void tryPlaceWeepingVines(BlockPos hatBlockPos, LevelAccessor level, RandomSource random)
    • placeWeepingVinesColumn

      private static void placeWeepingVinesColumn(LevelAccessor level, RandomSource random, BlockPos origin, int totalHeight, int minAge, int naxAge)
    • 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.
    • validBaseState

      public BlockState validBaseState()
      Returns the value of the validBaseState record component.
      Returns:
      the value of the validBaseState record component
    • stemState

      public BlockState stemState()
      Returns the value of the stemState record component.
      Returns:
      the value of the stemState record component
    • hatState

      public BlockState hatState()
      Returns the value of the hatState record component.
      Returns:
      the value of the hatState record component
    • decorState

      public BlockState decorState()
      Returns the value of the decorState record component.
      Returns:
      the value of the decorState record component
    • replaceableBlocks

      public BlockPredicate replaceableBlocks()
      Returns the value of the replaceableBlocks record component.
      Returns:
      the value of the replaceableBlocks record component
    • planted

      public boolean planted()
      Returns the value of the planted record component.
      Returns:
      the value of the planted record component