Record Class StructureSpawnOverride
java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.structure.StructureSpawnOverride
public record StructureSpawnOverride(StructureSpawnOverride.BoundingBoxType boundingBox, WeightedRandomList<MobSpawnSettings.SpawnerData> spawns)
extends Record
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprivate final StructureSpawnOverride.BoundingBoxType
The field for theboundingBox
record component.static final com.mojang.serialization.Codec
<StructureSpawnOverride> private final WeightedRandomList
<MobSpawnSettings.SpawnerData> The field for thespawns
record component. -
Constructor Summary
ConstructorDescriptionStructureSpawnOverride
(StructureSpawnOverride.BoundingBoxType boundingBox, WeightedRandomList<MobSpawnSettings.SpawnerData> spawns) Creates an instance of aStructureSpawnOverride
record class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theboundingBox
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.spawns()
Returns the value of thespawns
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
boundingBox
The field for theboundingBox
record component. -
spawns
The field for thespawns
record component. -
CODEC
-
-
Constructor Details
-
StructureSpawnOverride
public StructureSpawnOverride(StructureSpawnOverride.BoundingBoxType boundingBox, WeightedRandomList<MobSpawnSettings.SpawnerData> spawns) Creates an instance of aStructureSpawnOverride
record class.- Parameters:
boundingBox
- the value for theboundingBox
record componentspawns
- the value for thespawns
record component
-
-
Method Details
-
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)
. -
boundingBox
Returns the value of theboundingBox
record component.- Returns:
- the value of the
boundingBox
record component
-
spawns
Returns the value of thespawns
record component.- Returns:
- the value of the
spawns
record component
-