Record Class SculkPatchFeature

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

public record SculkPatchFeature(int chargeCount, int amountPerCharge, int spreadAttempts, int growthRounds, int spreadRounds) extends Record implements Feature
  • Field Details

    • chargeCount

      private final int chargeCount
      The field for the chargeCount record component.
    • amountPerCharge

      private final int amountPerCharge
      The field for the amountPerCharge record component.
    • spreadAttempts

      private final int spreadAttempts
      The field for the spreadAttempts record component.
    • growthRounds

      private final int growthRounds
      The field for the growthRounds record component.
    • spreadRounds

      private final int spreadRounds
      The field for the spreadRounds record component.
    • CODEC

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

    • SculkPatchFeature

      public SculkPatchFeature(int chargeCount, int amountPerCharge, int spreadAttempts, int growthRounds, int spreadRounds)
      Creates an instance of a SculkPatchFeature record class.
      Parameters:
      chargeCount - the value for the chargeCount record component
      amountPerCharge - the value for the amountPerCharge record component
      spreadAttempts - the value for the spreadAttempts record component
      growthRounds - the value for the growthRounds record component
      spreadRounds - the value for the spreadRounds record component
  • Method Details

    • codec

      public com.mojang.serialization.MapCodec<SculkPatchFeature> 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
    • canSpreadFrom

      private boolean canSpreadFrom(LevelAccessor level, BlockPos origin)
    • 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 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.
    • chargeCount

      public int chargeCount()
      Returns the value of the chargeCount record component.
      Returns:
      the value of the chargeCount record component
    • amountPerCharge

      public int amountPerCharge()
      Returns the value of the amountPerCharge record component.
      Returns:
      the value of the amountPerCharge record component
    • spreadAttempts

      public int spreadAttempts()
      Returns the value of the spreadAttempts record component.
      Returns:
      the value of the spreadAttempts record component
    • growthRounds

      public int growthRounds()
      Returns the value of the growthRounds record component.
      Returns:
      the value of the growthRounds record component
    • spreadRounds

      public int spreadRounds()
      Returns the value of the spreadRounds record component.
      Returns:
      the value of the spreadRounds record component