Record Class GeneratorImpl.UnitImpl

java.lang.Object
java.lang.Record
net.minestom.server.instance.generator.GeneratorImpl.UnitImpl
All Implemented Interfaces:
GenerationUnit
Enclosing class:
GeneratorImpl

public static record GeneratorImpl.UnitImpl(DynamicRegistry<Biome> biomeRegistry, UnitModifier modifier, Point size, Point absoluteStart, Point absoluteEnd, List<GenerationUnit> divided, List<GeneratorImpl.UnitImpl> forks) extends Record implements GenerationUnit
  • Constructor Details

    • UnitImpl

      public UnitImpl(DynamicRegistry<Biome> biomeRegistry, UnitModifier modifier, Point size, Point absoluteStart, Point absoluteEnd, List<GenerationUnit> divided, List<GeneratorImpl.UnitImpl> forks)
      Creates an instance of a UnitImpl record class.
      Parameters:
      biomeRegistry - the value for the biomeRegistry record component
      modifier - the value for the modifier record component
      size - the value for the size record component
      absoluteStart - the value for the absoluteStart record component
      absoluteEnd - the value for the absoluteEnd record component
      divided - the value for the divided record component
      forks - the value for the forks record component
  • Method Details

    • fork

      @NotNull public @NotNull GenerationUnit fork(@NotNull @NotNull Point start, @NotNull @NotNull Point end)
      Description copied from interface: GenerationUnit
      Creates a fork of this unit, which will be applied to the instance whenever possible.
      Specified by:
      fork in interface GenerationUnit
      Parameters:
      start - the start of the fork
      end - the end of the fork
      Returns:
      the fork
    • fork

      public void fork(@NotNull @NotNull Consumer<@NotNull Block.Setter> consumer)
      Description copied from interface: GenerationUnit
      Creates a fork of this unit depending on the blocks placed within the consumer.
      Specified by:
      fork in interface GenerationUnit
      Parameters:
      consumer - the consumer
    • subdivide

      @NotNull public @NotNull List<GenerationUnit> subdivide()
      Description copied from interface: GenerationUnit
      Divides this unit into the smallest independent units.
      Specified by:
      subdivide in interface GenerationUnit
      Returns:
      an immutable list of independent units
    • 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 Objects::equals(Object,Object).
      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.
    • biomeRegistry

      public DynamicRegistry<Biome> biomeRegistry()
      Returns the value of the biomeRegistry record component.
      Returns:
      the value of the biomeRegistry record component
    • modifier

      public UnitModifier modifier()
      Returns the value of the modifier record component.
      Specified by:
      modifier in interface GenerationUnit
      Returns:
      the value of the modifier record component
    • size

      public Point size()
      Returns the value of the size record component.
      Specified by:
      size in interface GenerationUnit
      Returns:
      the value of the size record component
    • absoluteStart

      public Point absoluteStart()
      Returns the value of the absoluteStart record component.
      Specified by:
      absoluteStart in interface GenerationUnit
      Returns:
      the value of the absoluteStart record component
    • absoluteEnd

      public Point absoluteEnd()
      Returns the value of the absoluteEnd record component.
      Specified by:
      absoluteEnd in interface GenerationUnit
      Returns:
      the value of the absoluteEnd record component
    • divided

      public List<GenerationUnit> divided()
      Returns the value of the divided record component.
      Returns:
      the value of the divided record component
    • forks

      public List<GeneratorImpl.UnitImpl> forks()
      Returns the value of the forks record component.
      Returns:
      the value of the forks record component