Record Class CaveWorldCarver

java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.carver.CaveWorldCarver
All Implemented Interfaces:
WorldCarver

public record CaveWorldCarver(float probability, HeightProvider y, IntProvider count, FloatProvider thickness, boolean weirdThicknessBias, FloatProvider roomVerticalRadiusMultiplier, FloatProvider horizontalRadiusMultiplier, FloatProvider verticalRadiusMultiplier, FloatProvider startVerticalRadiusMultiplier, FloatProvider floorLevel) extends Record implements WorldCarver
  • Field Details

    • probability

      private final float probability
      The field for the probability record component.
    • y

      private final HeightProvider y
      The field for the y record component.
    • count

      private final IntProvider count
      The field for the count record component.
    • thickness

      private final FloatProvider thickness
      The field for the thickness record component.
    • weirdThicknessBias

      private final boolean weirdThicknessBias
      The field for the weirdThicknessBias record component.
    • roomVerticalRadiusMultiplier

      private final FloatProvider roomVerticalRadiusMultiplier
      The field for the roomVerticalRadiusMultiplier record component.
    • horizontalRadiusMultiplier

      private final FloatProvider horizontalRadiusMultiplier
      The field for the horizontalRadiusMultiplier record component.
    • verticalRadiusMultiplier

      private final FloatProvider verticalRadiusMultiplier
      The field for the verticalRadiusMultiplier record component.
    • startVerticalRadiusMultiplier

      private final FloatProvider startVerticalRadiusMultiplier
      The field for the startVerticalRadiusMultiplier record component.
    • floorLevel

      private final FloatProvider floorLevel
      The field for the floorLevel record component.
    • MAP_CODEC

      public static final com.mojang.serialization.MapCodec<CaveWorldCarver> MAP_CODEC
  • Constructor Details

    • CaveWorldCarver

      public CaveWorldCarver(float probability, HeightProvider y, IntProvider count, FloatProvider thickness, boolean weirdThicknessBias, FloatProvider roomVerticalRadiusMultiplier, FloatProvider horizontalRadiusMultiplier, FloatProvider verticalRadiusMultiplier, FloatProvider startVerticalRadiusMultiplier, FloatProvider floorLevel)
      Creates an instance of a CaveWorldCarver record class.
      Parameters:
      probability - the value for the probability record component
      y - the value for the y record component
      count - the value for the count record component
      thickness - the value for the thickness record component
      weirdThicknessBias - the value for the weirdThicknessBias record component
      roomVerticalRadiusMultiplier - the value for the roomVerticalRadiusMultiplier record component
      horizontalRadiusMultiplier - the value for the horizontalRadiusMultiplier record component
      verticalRadiusMultiplier - the value for the verticalRadiusMultiplier record component
      startVerticalRadiusMultiplier - the value for the startVerticalRadiusMultiplier record component
      floorLevel - the value for the floorLevel record component
  • Method Details

    • isStartChunk

      public boolean isStartChunk(RandomSource random)
      Specified by:
      isStartChunk in interface WorldCarver
    • carve

      public boolean carve(WorldGenerationContext context, RandomSource random, ChunkPos chunkPos, ChunkPos sourceChunkPos, CarverOutput output)
      Specified by:
      carve in interface WorldCarver
    • getThickness

      private float getThickness(RandomSource random)
    • createRoom

      private void createRoom(ChunkPos chunkPos, double x, double y, double z, float thickness, double yScale, CarverOutput output, WorldCarver.CarveSkipChecker skipChecker)
    • createTunnel

      private void createTunnel(ChunkPos chunkPos, long tunnelSeed, double x, double y, double z, double horizontalRadiusMultiplier, double verticalRadiusMultiplier, float thickness, float horizontalRotation, float verticalRotation, int step, int dist, double yScale, CarverOutput output, WorldCarver.CarveSkipChecker skipChecker)
    • shouldSkip

      private static boolean shouldSkip(double xd, double yd, double zd, double floorLevel)
    • codec

      public com.mojang.serialization.MapCodec<CaveWorldCarver> codec()
      Specified by:
      codec in interface WorldCarver
    • 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.
    • probability

      public float probability()
      Returns the value of the probability record component.
      Returns:
      the value of the probability record component
    • y

      public HeightProvider y()
      Returns the value of the y record component.
      Returns:
      the value of the y record component
    • count

      public IntProvider count()
      Returns the value of the count record component.
      Returns:
      the value of the count record component
    • thickness

      public FloatProvider thickness()
      Returns the value of the thickness record component.
      Returns:
      the value of the thickness record component
    • weirdThicknessBias

      public boolean weirdThicknessBias()
      Returns the value of the weirdThicknessBias record component.
      Returns:
      the value of the weirdThicknessBias record component
    • roomVerticalRadiusMultiplier

      public FloatProvider roomVerticalRadiusMultiplier()
      Returns the value of the roomVerticalRadiusMultiplier record component.
      Returns:
      the value of the roomVerticalRadiusMultiplier record component
    • horizontalRadiusMultiplier

      public FloatProvider horizontalRadiusMultiplier()
      Returns the value of the horizontalRadiusMultiplier record component.
      Returns:
      the value of the horizontalRadiusMultiplier record component
    • verticalRadiusMultiplier

      public FloatProvider verticalRadiusMultiplier()
      Returns the value of the verticalRadiusMultiplier record component.
      Returns:
      the value of the verticalRadiusMultiplier record component
    • startVerticalRadiusMultiplier

      public FloatProvider startVerticalRadiusMultiplier()
      Returns the value of the startVerticalRadiusMultiplier record component.
      Returns:
      the value of the startVerticalRadiusMultiplier record component
    • floorLevel

      public FloatProvider floorLevel()
      Returns the value of the floorLevel record component.
      Returns:
      the value of the floorLevel record component