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 Summary
ConstructorsConstructorDescriptionUnitImpl
(DynamicRegistry<Biome> biomeRegistry, UnitModifier modifier, Point size, Point absoluteStart, Point absoluteEnd, List<GenerationUnit> divided, List<GeneratorImpl.UnitImpl> forks) Creates an instance of aUnitImpl
record class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theabsoluteEnd
record component.Returns the value of theabsoluteStart
record component.Returns the value of thebiomeRegistry
record component.divided()
Returns the value of thedivided
record component.final boolean
Indicates whether some other object is "equal to" this one.void
fork
(@NotNull Consumer<@NotNull Block.Setter> consumer) Creates a fork of this unit depending on the blocks placed within the consumer.@NotNull GenerationUnit
Creates a fork of this unit, which will be applied to the instance whenever possible.forks()
Returns the value of theforks
record component.final int
hashCode()
Returns a hash code value for this object.modifier()
Returns the value of themodifier
record component.size()
Returns the value of thesize
record component.@NotNull List
<GenerationUnit> Divides this unit into the smallest independent units.final String
toString()
Returns a string representation of this record class.
-
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 aUnitImpl
record class.- Parameters:
biomeRegistry
- the value for thebiomeRegistry
record componentmodifier
- the value for themodifier
record componentsize
- the value for thesize
record componentabsoluteStart
- the value for theabsoluteStart
record componentabsoluteEnd
- the value for theabsoluteEnd
record componentdivided
- the value for thedivided
record componentforks
- the value for theforks
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 interfaceGenerationUnit
- Parameters:
start
- the start of the forkend
- the end of the fork- Returns:
- the fork
-
fork
Description copied from interface:GenerationUnit
Creates a fork of this unit depending on the blocks placed within the consumer.- Specified by:
fork
in interfaceGenerationUnit
- Parameters:
consumer
- the consumer
-
subdivide
Description copied from interface:GenerationUnit
Divides this unit into the smallest independent units.- Specified by:
subdivide
in interfaceGenerationUnit
- Returns:
- an immutable list of independent units
-
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. -
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. -
equals
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 withObjects::equals(Object,Object)
. -
biomeRegistry
Returns the value of thebiomeRegistry
record component.- Returns:
- the value of the
biomeRegistry
record component
-
modifier
Returns the value of themodifier
record component.- Specified by:
modifier
in interfaceGenerationUnit
- Returns:
- the value of the
modifier
record component
-
size
Returns the value of thesize
record component.- Specified by:
size
in interfaceGenerationUnit
- Returns:
- the value of the
size
record component
-
absoluteStart
Returns the value of theabsoluteStart
record component.- Specified by:
absoluteStart
in interfaceGenerationUnit
- Returns:
- the value of the
absoluteStart
record component
-
absoluteEnd
Returns the value of theabsoluteEnd
record component.- Specified by:
absoluteEnd
in interfaceGenerationUnit
- Returns:
- the value of the
absoluteEnd
record component
-
divided
Returns the value of thedivided
record component.- Returns:
- the value of the
divided
record component
-
forks
Returns the value of theforks
record component.- Returns:
- the value of the
forks
record component
-