Record Class OreVeinRule

java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.material.rule.OreVeinRule
All Implemented Interfaces:
MaterialRule

public record OreVeinRule(BlockState oreBlock, BlockState rawOreBlock, BlockState fillerBlock, float rawOreChance, DensityFunction density, DensityFunction richness, DensityFunction fillerGap) extends Record implements MaterialRule
  • Field Details

    • oreBlock

      private final BlockState oreBlock
      The field for the oreBlock record component.
    • rawOreBlock

      private final BlockState rawOreBlock
      The field for the rawOreBlock record component.
    • fillerBlock

      private final BlockState fillerBlock
      The field for the fillerBlock record component.
    • rawOreChance

      private final float rawOreChance
      The field for the rawOreChance record component.
    • density

      private final DensityFunction density
      The field for the density record component.
    • richness

      private final DensityFunction richness
      The field for the richness record component.
    • fillerGap

      private final DensityFunction fillerGap
      The field for the fillerGap record component.
    • VEININESS_THRESHOLD

      public static final float VEININESS_THRESHOLD
      See Also:
    • EDGE_ROUNDOFF_BEGIN

      public static final int EDGE_ROUNDOFF_BEGIN
      See Also:
    • MAX_EDGE_ROUNDOFF

      public static final float MAX_EDGE_ROUNDOFF
      See Also:
    • VEIN_SOLIDNESS

      public static final float VEIN_SOLIDNESS
      See Also:
    • MIN_RICHNESS

      public static final float MIN_RICHNESS
      See Also:
    • MAX_RICHNESS

      public static final float MAX_RICHNESS
      See Also:
    • MAX_RICHNESS_THRESHOLD

      public static final float MAX_RICHNESS_THRESHOLD
      See Also:
    • CHANCE_OF_RAW_ORE_BLOCK

      private static final float CHANCE_OF_RAW_ORE_BLOCK
      See Also:
    • SKIP_ORE_IF_GAP_NOISE_IS_BELOW

      public static final float SKIP_ORE_IF_GAP_NOISE_IS_BELOW
      See Also:
    • CODEC

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

    • OreVeinRule

      public OreVeinRule(BlockState oreBlock, BlockState rawOreBlock, BlockState fillerBlock, float rawOreChance, DensityFunction density, DensityFunction richness, DensityFunction fillerGap)
      Creates an instance of a OreVeinRule record class.
      Parameters:
      oreBlock - the value for the oreBlock record component
      rawOreBlock - the value for the rawOreBlock record component
      fillerBlock - the value for the fillerBlock record component
      rawOreChance - the value for the rawOreChance record component
      density - the value for the density record component
      richness - the value for the richness record component
      fillerGap - the value for the fillerGap record component
  • Method Details

    • compile

      public RuleEvaluator compile(MaterialRuleContext context)
      Specified by:
      compile in interface MaterialRule
    • codec

      public com.mojang.serialization.MapCodec<OreVeinRule> codec()
      Specified by:
      codec in interface MaterialRule
    • 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.
    • oreBlock

      public BlockState oreBlock()
      Returns the value of the oreBlock record component.
      Returns:
      the value of the oreBlock record component
    • rawOreBlock

      public BlockState rawOreBlock()
      Returns the value of the rawOreBlock record component.
      Returns:
      the value of the rawOreBlock record component
    • fillerBlock

      public BlockState fillerBlock()
      Returns the value of the fillerBlock record component.
      Returns:
      the value of the fillerBlock record component
    • rawOreChance

      public float rawOreChance()
      Returns the value of the rawOreChance record component.
      Returns:
      the value of the rawOreChance record component
    • density

      public DensityFunction density()
      Returns the value of the density record component.
      Returns:
      the value of the density record component
    • richness

      public DensityFunction richness()
      Returns the value of the richness record component.
      Returns:
      the value of the richness record component
    • fillerGap

      public DensityFunction fillerGap()
      Returns the value of the fillerGap record component.
      Returns:
      the value of the fillerGap record component