Record Class BiomeCheck
java.lang.Object
java.lang.Record
net.minecraft.world.entity.variant.BiomeCheck
- All Implemented Interfaces:
Predicate<SpawnContext>
,PriorityProvider.SelectorCondition<SpawnContext>
,SpawnCondition
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec
<BiomeCheck> The field for therequiredBiomes
record component.Fields inherited from interface net.minecraft.world.entity.variant.SpawnCondition
CODEC
-
Constructor Summary
ConstructorsConstructorDescriptionBiomeCheck
(HolderSet<Biome> requiredBiomes) Creates an instance of aBiomeCheck
record class. -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.MapCodec
<BiomeCheck> 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 therequiredBiomes
record component.boolean
test
(SpawnContext p_400182_) final String
toString()
Returns a string representation of this record class.
-
Field Details
-
requiredBiomes
The field for therequiredBiomes
record component. -
MAP_CODEC
-
-
Constructor Details
-
BiomeCheck
Creates an instance of aBiomeCheck
record class.- Parameters:
requiredBiomes
- the value for therequiredBiomes
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)
. -
requiredBiomes
Returns the value of therequiredBiomes
record component.- Returns:
- the value of the
requiredBiomes
record component
-