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