Record Class StructureCheck
java.lang.Object
java.lang.Record
net.minecraft.world.entity.variant.StructureCheck
- All Implemented Interfaces:
Predicate<SpawnContext>
,PriorityProvider.SelectorCondition<SpawnContext>
,SpawnCondition
public record StructureCheck(HolderSet<Structure> requiredStructures)
extends Record
implements SpawnCondition
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec
<StructureCheck> The field for therequiredStructures
record component.Fields inherited from interface net.minecraft.world.entity.variant.SpawnCondition
CODEC
-
Constructor Summary
ConstructorsConstructorDescriptionStructureCheck
(HolderSet<Structure> requiredStructures) Creates an instance of aStructureCheck
record class. -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.MapCodec
<StructureCheck> codec()
final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.Returns the value of therequiredStructures
record component.boolean
test
(SpawnContext pContext) final String
toString()
Returns a string representation of this record class.
-
Field Details
-
requiredStructures
The field for therequiredStructures
record component. -
MAP_CODEC
-
-
Constructor Details
-
StructureCheck
Creates an instance of aStructureCheck
record class.- Parameters:
requiredStructures
- the value for therequiredStructures
record component
-
-
Method Details
-
test
- Specified by:
test
in interfacePredicate<SpawnContext>
-
codec
- Specified by:
codec
in interfaceSpawnCondition
-
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)
. -
requiredStructures
Returns the value of therequiredStructures
record component.- Returns:
- the value of the
requiredStructures
record component
-