Record Class GeneratorImpl.AreaModifierImpl

java.lang.Object
java.lang.Record
net.minestom.server.instance.generator.GeneratorImpl.AreaModifierImpl
All Implemented Interfaces:
Block.Setter, UnitModifier, Biome.Setter
Enclosing class:
GeneratorImpl

public static record GeneratorImpl.AreaModifierImpl(Point size, Point start, Point end, int width, int height, int depth, List<GenerationUnit> sections) extends Record
  • Nested Class Summary

    Nested classes/interfaces inherited from interface net.minestom.server.instance.generator.UnitModifier

    UnitModifier.Supplier
  • Constructor Summary

    Constructors
    Constructor
    Description
    AreaModifierImpl(Point size, Point start, Point end, int width, int height, int depth, List<GenerationUnit> sections)
    Creates an instance of a AreaModifierImpl record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the value of the depth record component.
    end()
    Returns the value of the end record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    default void
    fill(@NotNull Point start, @NotNull Point end, @NotNull Block block)
    Fills the 3d rectangular area with the given block.
    void
    fill(@NotNull Block block)
    Fills the unit with the given block.
    void
    Fills the 3d rectangular area with the given biome.
    void
    fillHeight(int minHeight, int maxHeight, @NotNull Block block)
    Fills the 3d rectangular area with the given biome.
    final int
    Returns a hash code value for this object.
    int
    Returns the value of the height record component.
    Returns the value of the sections record component.
    void
    setAll(@NotNull UnitModifier.Supplier supplier)
    Sets all blocks within the unit to the block given by the supplier.
    void
    Sets all blocks within the unit to the block given by the supplier, relative to the absolute position of the unit.
    void
    setBiome(int x, int y, int z, DynamicRegistry.Key<Biome> biome)
     
    void
    setBlock(int x, int y, int z, @NotNull Block block)
     
    void
    setRelative(int x, int y, int z, @NotNull Block block)
    Sets the block relative to the absolute position of the unit.
    Returns the value of the size record component.
    Returns the value of the start record component.
    final String
    Returns a string representation of this record class.
    int
    Returns the value of the width record component.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface net.minestom.server.world.biome.Biome.Setter

    setBiome

    Methods inherited from interface net.minestom.server.instance.block.Block.Setter

    setBlock
  • Constructor Details

    • AreaModifierImpl

      public AreaModifierImpl(Point size, Point start, Point end, int width, int height, int depth, List<GenerationUnit> sections)
      Creates an instance of a AreaModifierImpl record class.
      Parameters:
      size - the value for the size record component
      start - the value for the start record component
      end - the value for the end record component
      width - the value for the width record component
      height - the value for the height record component
      depth - the value for the depth record component
      sections - the value for the sections record component
  • Method Details

    • setBlock

      public void setBlock(int x, int y, int z, @NotNull @NotNull Block block)
      Specified by:
      setBlock in interface Block.Setter
    • setBiome

      public void setBiome(int x, int y, int z, @NotNull DynamicRegistry.Key<Biome> biome)
      Specified by:
      setBiome in interface Biome.Setter
    • setRelative

      public void setRelative(int x, int y, int z, @NotNull @NotNull Block block)
      Description copied from interface: UnitModifier
      Sets the block relative to the absolute position of the unit.
      Specified by:
      setRelative in interface UnitModifier
      Parameters:
      x - the x coordinate
      y - the y coordinate
      z - the z coordinate
      block - the block to set
    • setAll

      public void setAll(@NotNull @NotNull UnitModifier.Supplier supplier)
      Description copied from interface: UnitModifier
      Sets all blocks within the unit to the block given by the supplier.
      Specified by:
      setAll in interface UnitModifier
      Parameters:
      supplier - the supplier of the block to set
    • setAllRelative

      public void setAllRelative(@NotNull @NotNull UnitModifier.Supplier supplier)
      Description copied from interface: UnitModifier
      Sets all blocks within the unit to the block given by the supplier, relative to the absolute position of the unit.
      Specified by:
      setAllRelative in interface UnitModifier
      Parameters:
      supplier - the supplier of the block to set
    • fill

      public void fill(@NotNull @NotNull Block block)
      Description copied from interface: UnitModifier
      Fills the unit with the given block.
      Specified by:
      fill in interface UnitModifier
      Parameters:
      block - the block to fill
    • fillBiome

      public void fillBiome(@NotNull DynamicRegistry.Key<Biome> biome)
      Description copied from interface: UnitModifier
      Fills the 3d rectangular area with the given biome.
      Specified by:
      fillBiome in interface UnitModifier
      Parameters:
      biome - the biome to fill
    • fillHeight

      public void fillHeight(int minHeight, int maxHeight, @NotNull @NotNull Block block)
      Description copied from interface: UnitModifier
      Fills the 3d rectangular area with the given biome.
      Specified by:
      fillHeight in interface UnitModifier
      Parameters:
      minHeight - the minimum height of the area
      maxHeight - the maximum height of the area
      block - the block to fill
    • 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 '=='.
      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.
    • size

      public Point size()
      Returns the value of the size record component.
      Returns:
      the value of the size record component
    • start

      public Point start()
      Returns the value of the start record component.
      Returns:
      the value of the start record component
    • end

      public Point end()
      Returns the value of the end record component.
      Returns:
      the value of the end record component
    • width

      public int width()
      Returns the value of the width record component.
      Returns:
      the value of the width record component
    • height

      public int height()
      Returns the value of the height record component.
      Returns:
      the value of the height record component
    • depth

      public int depth()
      Returns the value of the depth record component.
      Returns:
      the value of the depth record component
    • sections

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

      default void fill(@NotNull @NotNull Point start, @NotNull @NotNull Point end, @NotNull @NotNull Block block)
      Description copied from interface: UnitModifier
      Fills the 3d rectangular area with the given block.
      Specified by:
      fill in interface UnitModifier
      Parameters:
      start - the start (min) point of the area
      end - the end (max) point of the area
      block - the block to fill