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(Vec size, Vec start, Vec end, int width, int height, int depth, List<GenerationUnit> sections) extends Record
  • Constructor Details

    • AreaModifierImpl

      public AreaModifierImpl(Vec size, Vec start, Vec 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, Block block)
      Specified by:
      setBlock in interface Block.Setter
    • setBiome

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

      public void setRelative(int x, int y, int z, 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(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(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(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(RegistryKey<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, Block block)
      Description copied from interface: UnitModifier
      Fills the 3d rectangular area with the given block.
      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 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.
    • size

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

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

      public Vec 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(Point start, Point end, 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